zigbee2mqtt-windfront 2.5.0 → 2.6.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/assets/{About-0JhLYcso.js → About-ZTihYbyu.js} +1 -1
- package/dist/assets/About-ZTihYbyu.js.br +0 -0
- package/dist/assets/{ActivityPage-CdjTizOC.js → ActivityPage-bbClQpZV.js} +1 -1
- package/dist/assets/ActivityPage-bbClQpZV.js.br +0 -0
- package/dist/assets/{Availability-C0Y2p5y5.js → Availability-DMgEcrpI.js} +1 -1
- package/dist/assets/Availability-DMgEcrpI.js.br +0 -0
- package/dist/assets/{Bind-BsHnEg5N.js → Bind-Bw00iF3V.js} +1 -1
- package/dist/assets/Bind-Bw00iF3V.js.br +0 -0
- package/dist/assets/{BindRow-w2c7dORs.js → BindRow-Cqb2dOWr.js} +1 -1
- package/dist/assets/BindRow-Cqb2dOWr.js.br +0 -0
- package/dist/assets/{BindingsPage-CsojvWXO.js → BindingsPage-XWvJqKeA.js} +1 -1
- package/dist/assets/BindingsPage-XWvJqKeA.js.br +0 -0
- package/dist/assets/Bridge-C4PBtT5N.js +1 -0
- package/dist/assets/Bridge-C4PBtT5N.js.br +0 -0
- package/dist/assets/{CheckboxField-BajnAXBH.js → CheckboxField-VUm-0hft.js} +1 -1
- package/dist/assets/CheckboxField-VUm-0hft.js.br +0 -0
- package/dist/assets/{ClusterSinglePicker-DYwW-4KK.js → ClusterSinglePicker-B-he_crF.js} +1 -1
- package/dist/assets/ClusterSinglePicker-B-he_crF.js.br +0 -0
- package/dist/assets/{Clusters-Cb2V5JOj.js → Clusters-DXWNWsJu.js} +1 -1
- package/dist/assets/Clusters-DXWNWsJu.js.br +0 -0
- package/dist/assets/{ContributePage-Bk7jCRoh.js → ContributePage-DUQYHsWS.js} +1 -1
- package/dist/assets/ContributePage-DUQYHsWS.js.br +0 -0
- package/dist/assets/{Dashboard-gqQdaDQW.js → Dashboard-B-NOlhzR.js} +1 -1
- package/dist/assets/Dashboard-B-NOlhzR.js.br +0 -0
- package/dist/assets/{DashboardFeatureWrapper-DcNRF4Ns.js → DashboardFeatureWrapper-B3lAVBjM.js} +1 -1
- package/dist/assets/DashboardFeatureWrapper-B3lAVBjM.js.br +0 -0
- package/dist/assets/{DebouncedInput-D4UGfbPH.js → DebouncedInput-dOweMuV9.js} +1 -1
- package/dist/assets/DebouncedInput-dOweMuV9.js.br +0 -0
- package/dist/assets/{DevConsole-BJvvnpYc.js → DevConsole-CApS179g.js} +1 -1
- package/dist/assets/DevConsole-CApS179g.js.br +0 -0
- package/dist/assets/{DevConsole-Cvc83WAN.js → DevConsole-h2vdYRbh.js} +1 -1
- package/dist/assets/DevConsole-h2vdYRbh.js.br +0 -0
- package/dist/assets/{DeviceCard-DdiWYGMo.js → DeviceCard-6wkIXy3n.js} +1 -1
- package/dist/assets/DeviceCard-6wkIXy3n.js.br +0 -0
- package/dist/assets/DeviceImage-DyYFIRjz.js +1 -0
- package/dist/assets/DeviceImage-DyYFIRjz.js.br +0 -0
- package/dist/assets/{DeviceInfo-DKG0lBq7.js → DeviceInfo-k6u06K2f.js} +1 -1
- package/dist/assets/DeviceInfo-k6u06K2f.js.br +0 -0
- package/dist/assets/{DevicePage-BjK-kGuL.js → DevicePage-B7nAn1iO.js} +2 -2
- package/dist/assets/DevicePage-B7nAn1iO.js.br +0 -0
- package/dist/assets/{DevicePicker-C3RVTPDq.js → DevicePicker-BfBbyuS8.js} +1 -1
- package/dist/assets/DevicePicker-BfBbyuS8.js.br +0 -0
- package/dist/assets/{DeviceSettings-DW3ZG1wM.js → DeviceSettings-1iuu0tJ7.js} +1 -1
- package/dist/assets/DeviceSettings-1iuu0tJ7.js.br +0 -0
- package/dist/assets/{DeviceSpecificSettings-GsJG2-ES.js → DeviceSpecificSettings-Cm4xvfzJ.js} +1 -1
- package/dist/assets/DeviceSpecificSettings-Cm4xvfzJ.js.br +1 -0
- package/dist/assets/{Devices-DQEI3oHI.js → Devices-nN5Vdq46.js} +1 -1
- package/dist/assets/Devices-nN5Vdq46.js.br +0 -0
- package/dist/assets/{DevicesPage-BOhNAwrw.js → DevicesPage-BV-Ijsev.js} +1 -1
- package/dist/assets/DevicesPage-BV-Ijsev.js.br +0 -0
- package/dist/assets/{DisplayValue-D99M7yUO.js → DisplayValue-DLP2mg_V.js} +1 -1
- package/dist/assets/DisplayValue-DLP2mg_V.js.br +0 -0
- package/dist/assets/{Duration-CDV4rYXE.js → Duration-DzRD0grs.js} +1 -1
- package/dist/assets/Duration-DzRD0grs.js.br +0 -0
- package/dist/assets/{EndpointPicker-dJfXG_xO.js → EndpointPicker-Ck1CULcK.js} +1 -1
- package/dist/assets/EndpointPicker-Ck1CULcK.js.br +0 -0
- package/dist/assets/{Exposes-D8X0Hc9b.js → Exposes-BPSB0xC5.js} +1 -1
- package/dist/assets/Exposes-BPSB0xC5.js.br +0 -0
- package/dist/assets/Feature-CZ82llrY.js +1 -0
- package/dist/assets/Feature-CZ82llrY.js.br +0 -0
- package/dist/assets/{FrontendSettingsPage-Dgb_oie6.js → FrontendSettingsPage-SIfuHMNE.js} +1 -1
- package/dist/assets/FrontendSettingsPage-SIfuHMNE.js.br +0 -0
- package/dist/assets/{GroupPage-Cptx9yjL.js → GroupPage-CrU_oF2n.js} +2 -2
- package/dist/assets/GroupPage-CrU_oF2n.js.br +0 -0
- package/dist/assets/{GroupSettings-Prxd7Qlt.js → GroupSettings-B4eB1ZDP.js} +1 -1
- package/dist/assets/GroupSettings-B4eB1ZDP.js.br +0 -0
- package/dist/assets/{Groups-COEbGPHG.js → Groups-ClkUi4Az.js} +1 -1
- package/dist/assets/Groups-ClkUi4Az.js.br +0 -0
- package/dist/assets/{GroupsPage-DSzMPn-Z.js → GroupsPage-DPkJb1fr.js} +1 -1
- package/dist/assets/GroupsPage-DPkJb1fr.js.br +0 -0
- package/dist/assets/{Health-CqF8Y4Z5.js → Health-B6Q28am3.js} +1 -1
- package/dist/assets/Health-B6Q28am3.js.br +0 -0
- package/dist/assets/{HomePage-BmNAarrj.js → HomePage-Dk_sBoEb.js} +1 -1
- package/dist/assets/HomePage-Dk_sBoEb.js.br +0 -0
- package/dist/assets/{IndeterminateCheckbox-3T9i4WJQ.js → IndeterminateCheckbox-C_ecvCeC.js} +1 -1
- package/dist/assets/IndeterminateCheckbox-C_ecvCeC.js.br +1 -0
- package/dist/assets/InfoAlert-Duqe1W84.js +1 -0
- package/dist/assets/InfoAlert-Duqe1W84.js.br +0 -0
- package/dist/assets/{InputField-D5pYA6K1.js → InputField-ClGszlbJ.js} +1 -1
- package/dist/assets/InputField-ClGszlbJ.js.br +0 -0
- package/dist/assets/{Json-CWviVtn9.js → Json-DEpnDDlz.js} +1 -1
- package/dist/assets/Json-DEpnDDlz.js.br +0 -0
- package/dist/assets/{LastSeen-D-s98gu3.js → LastSeen-Ch5q_qaC.js} +1 -1
- package/dist/assets/LastSeen-Ch5q_qaC.js.br +0 -0
- package/dist/assets/{LogsPage-DT_GxSzV.js → LogsPage-BRzBMY4H.js} +1 -1
- package/dist/assets/LogsPage-BRzBMY4H.js.br +0 -0
- package/dist/assets/Lqi-VJh_Noo2.js +1 -0
- package/dist/assets/Lqi-VJh_Noo2.js.br +0 -0
- package/dist/assets/{NetworkPage-DSSR5mM-.js → NetworkPage-Ba3EmhQT.js} +2 -2
- package/dist/assets/NetworkPage-Ba3EmhQT.js.br +0 -0
- package/dist/assets/{NumberField-nnfJmgIW.js → NumberField-BjCMByny.js} +1 -1
- package/dist/assets/NumberField-BjCMByny.js.br +0 -0
- package/dist/assets/{OtaPage-z6sX3vSt.js → OtaPage-DUvmm6At.js} +1 -1
- package/dist/assets/OtaPage-DUvmm6At.js.br +0 -0
- package/dist/assets/{PowerSource-DL31isBE.js → PowerSource-CgR95qOm.js} +1 -1
- package/dist/assets/PowerSource-CgR95qOm.js.br +0 -0
- package/dist/assets/{RawNetworkData-DZU6h6Sp.js → RawNetworkData-Bbaa-PvD.js} +1 -1
- package/dist/assets/RawNetworkData-Bbaa-PvD.js.br +0 -0
- package/dist/assets/{RawNetworkMap-B-llrjOJ.js → RawNetworkMap-CdocP6HT.js} +5 -5
- package/dist/assets/RawNetworkMap-CdocP6HT.js.br +0 -0
- package/dist/assets/{RecallRemove-U3vwtGLP.js → RecallRemove-Bg_AJVfE.js} +1 -1
- package/dist/assets/RecallRemove-Bg_AJVfE.js.br +0 -0
- package/dist/assets/{RemoveDeviceModal-D5ICjHc7.js → RemoveDeviceModal-B_L_rBvK.js} +1 -1
- package/dist/assets/RemoveDeviceModal-B_L_rBvK.js.br +0 -0
- package/dist/assets/{Reporting-Ce7cITwl.js → Reporting-CEj72PxA.js} +1 -1
- package/dist/assets/Reporting-CEj72PxA.js.br +0 -0
- package/dist/assets/{ReportingPage-BbaKa1_f.js → ReportingPage-CooLISus.js} +1 -1
- package/dist/assets/ReportingPage-CooLISus.js.br +0 -0
- package/dist/assets/{ReportingRow-C9fDMkPu.js → ReportingRow-BBoyE6oF.js} +1 -1
- package/dist/assets/ReportingRow-BBoyE6oF.js.br +0 -0
- package/dist/assets/{Scene-DgzthncJ.js → Scene-KSSvws8r.js} +1 -1
- package/dist/assets/Scene-KSSvws8r.js.br +0 -0
- package/dist/assets/{SelectField-Bpb1ZZPg.js → SelectField-D8d6iiLj.js} +1 -1
- package/dist/assets/SelectField-D8d6iiLj.js.br +0 -0
- package/dist/assets/{Settings-C3XpdT1V.js → Settings-amzT9Wy4.js} +1 -1
- package/dist/assets/Settings-amzT9Wy4.js.br +0 -0
- package/dist/assets/{SettingsList-BmzgCeLd.js → SettingsList-Dk4_bVrB.js} +1 -1
- package/dist/assets/SettingsList-Dk4_bVrB.js.br +0 -0
- package/dist/assets/{SettingsPage-sjb3rCvJ.js → SettingsPage-ENZ7Owke.js} +2 -2
- package/dist/assets/SettingsPage-ENZ7Owke.js.br +0 -0
- package/dist/assets/State-Csk9AgRC.js +1 -0
- package/dist/assets/State-Csk9AgRC.js.br +0 -0
- package/dist/assets/{Table-DFVhG_w7.js → Table-a9jksZ8Q.js} +1 -1
- package/dist/assets/Table-a9jksZ8Q.js.br +0 -0
- package/dist/assets/{TextareaField-CY5D5vpL.js → TextareaField-KWfoNm-T.js} +1 -1
- package/dist/assets/TextareaField-KWfoNm-T.js.br +0 -0
- package/dist/assets/{TimeAgo-BkY8w41z.js → TimeAgo-CLxEA7lv.js} +1 -1
- package/dist/assets/TimeAgo-CLxEA7lv.js.br +0 -0
- package/dist/assets/{Tools-mFNA0YPA.js → Tools-BId-rvzb.js} +1 -1
- package/dist/assets/Tools-BId-rvzb.js.br +0 -0
- package/dist/assets/{TouchlinkPage-Ba9RRWhs.js → TouchlinkPage-FLPyRTXZ.js} +1 -1
- package/dist/assets/TouchlinkPage-FLPyRTXZ.js.br +0 -0
- package/dist/assets/{VendorLink-DXyuv6xn.js → VendorLink-B6MaQn5Z.js} +1 -1
- package/dist/assets/VendorLink-B6MaQn5Z.js.br +0 -0
- package/dist/assets/{_createCompounder-BU-NvoiQ.js → _createCompounder-DUhfPC_B.js} +1 -1
- package/dist/assets/_createCompounder-DUhfPC_B.js.br +0 -0
- package/dist/assets/{floating-ui.react-C2dvgy0e.js → floating-ui.react-SUquiuNj.js} +1 -1
- package/dist/assets/floating-ui.react-SUquiuNj.js.br +0 -0
- package/dist/assets/index-COCbPj4S.css +1 -0
- package/dist/assets/index-COCbPj4S.css.br +0 -0
- package/dist/assets/index-DiJ--4jy.js +581 -0
- package/dist/assets/index-DiJ--4jy.js.br +0 -0
- package/dist/assets/{index-BX_tTrRu.js → index-Ylx8hT_m.js} +1 -1
- package/dist/assets/index-Ylx8hT_m.js.br +0 -0
- package/dist/assets/{index-BimFFTof.js → index-w9H6LvRA.js} +1 -1
- package/dist/assets/index-w9H6LvRA.js.br +0 -0
- package/dist/assets/{isObjectLike-CPJz4AfA.js → isObjectLike-DD38kuct.js} +1 -1
- package/dist/assets/isObjectLike-DD38kuct.js.br +0 -0
- package/dist/assets/{jszip.min-Oizf8S9N.js → jszip.min-BK4G48pu.js} +1 -1
- package/dist/assets/jszip.min-BK4G48pu.js.br +0 -0
- package/dist/assets/{merge-NoYE3SUn.js → merge-i-jf8qHe.js} +1 -1
- package/dist/assets/merge-i-jf8qHe.js.br +0 -0
- package/dist/assets/{react-select.esm-Cuq_orNm.js → react-select.esm-DWfnJubF.js} +1 -1
- package/dist/assets/react-select.esm-DWfnJubF.js.br +0 -0
- package/dist/assets/snakeCase-BGM3IOtN.js +1 -0
- package/dist/assets/snakeCase-BGM3IOtN.js.br +0 -0
- package/dist/assets/{useColumnCount-CraaGS73.js → useColumnCount-2yLGUSvE.js} +1 -1
- package/dist/assets/useColumnCount-2yLGUSvE.js.br +0 -0
- package/dist/assets/{useSearch-FzHCek2-.js → useSearch-_GwMY3HX.js} +1 -1
- package/dist/assets/useSearch-_GwMY3HX.js.br +0 -0
- package/dist/assets/{useTable-BHTiQzMX.js → useTable-DQ_SXEUl.js} +1 -1
- package/dist/assets/useTable-DQ_SXEUl.js.br +0 -0
- package/dist/index.html +2 -2
- package/dist/index.html.br +0 -0
- package/package.json +13 -13
- package/dist/assets/About-0JhLYcso.js.br +0 -0
- package/dist/assets/ActivityPage-CdjTizOC.js.br +0 -0
- package/dist/assets/Availability-C0Y2p5y5.js.br +0 -0
- package/dist/assets/Bind-BsHnEg5N.js.br +0 -0
- package/dist/assets/BindRow-w2c7dORs.js.br +0 -0
- package/dist/assets/BindingsPage-CsojvWXO.js.br +0 -0
- package/dist/assets/Bridge-BckxrKo8.js +0 -1
- package/dist/assets/Bridge-BckxrKo8.js.br +0 -0
- package/dist/assets/CheckboxField-BajnAXBH.js.br +0 -0
- package/dist/assets/ClusterSinglePicker-DYwW-4KK.js.br +0 -0
- package/dist/assets/Clusters-Cb2V5JOj.js.br +0 -0
- package/dist/assets/ContributePage-Bk7jCRoh.js.br +0 -0
- package/dist/assets/Dashboard-gqQdaDQW.js.br +0 -0
- package/dist/assets/DashboardFeatureWrapper-DcNRF4Ns.js.br +0 -0
- package/dist/assets/DebouncedInput-D4UGfbPH.js.br +0 -0
- package/dist/assets/DevConsole-BJvvnpYc.js.br +0 -0
- package/dist/assets/DevConsole-Cvc83WAN.js.br +0 -0
- package/dist/assets/DeviceCard-DdiWYGMo.js.br +0 -0
- package/dist/assets/DeviceImage-DswPXDM9.js +0 -1
- package/dist/assets/DeviceImage-DswPXDM9.js.br +0 -0
- package/dist/assets/DeviceInfo-DKG0lBq7.js.br +0 -0
- package/dist/assets/DevicePage-BjK-kGuL.js.br +0 -0
- package/dist/assets/DevicePicker-C3RVTPDq.js.br +0 -0
- package/dist/assets/DeviceSettings-DW3ZG1wM.js.br +0 -0
- package/dist/assets/DeviceSpecificSettings-GsJG2-ES.js.br +0 -0
- package/dist/assets/Devices-DQEI3oHI.js.br +0 -0
- package/dist/assets/DevicesPage-BOhNAwrw.js.br +0 -0
- package/dist/assets/DisplayValue-D99M7yUO.js.br +0 -0
- package/dist/assets/Duration-CDV4rYXE.js.br +0 -0
- package/dist/assets/EndpointPicker-dJfXG_xO.js.br +0 -0
- package/dist/assets/Exposes-D8X0Hc9b.js.br +0 -0
- package/dist/assets/Feature-DEZSyIxh.js +0 -1
- package/dist/assets/Feature-DEZSyIxh.js.br +0 -0
- package/dist/assets/FrontendSettingsPage-Dgb_oie6.js.br +0 -0
- package/dist/assets/GroupPage-Cptx9yjL.js.br +0 -0
- package/dist/assets/GroupSettings-Prxd7Qlt.js.br +0 -0
- package/dist/assets/Groups-COEbGPHG.js.br +0 -0
- package/dist/assets/GroupsPage-DSzMPn-Z.js.br +0 -0
- package/dist/assets/Health-CqF8Y4Z5.js.br +0 -0
- package/dist/assets/HomePage-BmNAarrj.js.br +0 -0
- package/dist/assets/IndeterminateCheckbox-3T9i4WJQ.js.br +0 -0
- package/dist/assets/InfoAlert-BpgSD9yR.js +0 -1
- package/dist/assets/InfoAlert-BpgSD9yR.js.br +0 -0
- package/dist/assets/InputField-D5pYA6K1.js.br +0 -0
- package/dist/assets/Json-CWviVtn9.js.br +0 -0
- package/dist/assets/LastSeen-D-s98gu3.js.br +0 -0
- package/dist/assets/LogsPage-DT_GxSzV.js.br +0 -0
- package/dist/assets/Lqi-5XPUwbpx.js +0 -1
- package/dist/assets/Lqi-5XPUwbpx.js.br +0 -0
- package/dist/assets/NetworkPage-DSSR5mM-.js.br +0 -0
- package/dist/assets/NumberField-nnfJmgIW.js.br +0 -0
- package/dist/assets/OtaPage-z6sX3vSt.js.br +0 -0
- package/dist/assets/PowerSource-DL31isBE.js.br +0 -0
- package/dist/assets/RawNetworkData-DZU6h6Sp.js.br +0 -0
- package/dist/assets/RawNetworkMap-B-llrjOJ.js.br +0 -0
- package/dist/assets/RecallRemove-U3vwtGLP.js.br +0 -0
- package/dist/assets/RemoveDeviceModal-D5ICjHc7.js.br +0 -0
- package/dist/assets/Reporting-Ce7cITwl.js.br +0 -0
- package/dist/assets/ReportingPage-BbaKa1_f.js.br +0 -0
- package/dist/assets/ReportingRow-C9fDMkPu.js.br +0 -0
- package/dist/assets/Scene-DgzthncJ.js.br +0 -4
- package/dist/assets/SelectField-Bpb1ZZPg.js.br +0 -0
- package/dist/assets/Settings-C3XpdT1V.js.br +0 -0
- package/dist/assets/SettingsList-BmzgCeLd.js.br +0 -0
- package/dist/assets/SettingsPage-sjb3rCvJ.js.br +0 -0
- package/dist/assets/State-D-psaurh.js +0 -1
- package/dist/assets/State-D-psaurh.js.br +0 -0
- package/dist/assets/Table-DFVhG_w7.js.br +0 -0
- package/dist/assets/TextareaField-CY5D5vpL.js.br +0 -0
- package/dist/assets/TimeAgo-BkY8w41z.js.br +0 -0
- package/dist/assets/Tools-mFNA0YPA.js.br +0 -0
- package/dist/assets/TouchlinkPage-Ba9RRWhs.js.br +0 -0
- package/dist/assets/VendorLink-DXyuv6xn.js.br +0 -0
- package/dist/assets/_createCompounder-BU-NvoiQ.js.br +0 -0
- package/dist/assets/floating-ui.react-C2dvgy0e.js.br +0 -0
- package/dist/assets/index-BX_tTrRu.js.br +0 -0
- package/dist/assets/index-BimFFTof.js.br +0 -0
- package/dist/assets/index-dx9CQaKd.js +0 -581
- package/dist/assets/index-dx9CQaKd.js.br +0 -0
- package/dist/assets/index-n4T5ecd0.css +0 -1
- package/dist/assets/index-n4T5ecd0.css.br +0 -0
- package/dist/assets/isObjectLike-CPJz4AfA.js.br +0 -0
- package/dist/assets/jszip.min-Oizf8S9N.js.br +0 -0
- package/dist/assets/merge-NoYE3SUn.js.br +0 -0
- package/dist/assets/react-select.esm-Cuq_orNm.js.br +0 -0
- package/dist/assets/snakeCase-C3gccDou.js +0 -1
- package/dist/assets/snakeCase-C3gccDou.js.br +0 -0
- package/dist/assets/useColumnCount-CraaGS73.js.br +0 -0
- package/dist/assets/useSearch-FzHCek2-.js.br +0 -0
- package/dist/assets/useTable-BHTiQzMX.js.br +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b4 as bA,b5 as GU,aQ as mo,b6 as HU,b7 as Ms,r as K,j as he,b8 as VU,u as wg,t as WU,F as Yn,aj as XU,B as Lr,b9 as jU,ba as qU,f as YU,bb as ZU,bc as KU,bd as JU,be as QU,bf as $U,bg as eO,at as iu,bh as tO,bi as nO,bj as iO,Z as rO,bk as kv,a as sO,D as aO,m as qS,aB as YS}from"./index-dx9CQaKd.js";import{m as oO}from"./merge-NoYE3SUn.js";import{_ as Zf}from"./extends-CF3RwP-h.js";import{g as lO,a as cO}from"./index-BX_tTrRu.js";import{E as xl,Z as hi,N as im,c as fh}from"./index-Bs7zcW7e.js";import"./envs-CSqIi4cL.js";import"./isObjectLike-CPJz4AfA.js";import"./isObject--vsEa_js.js";var Gv={exports:{}},$s={};var ZS;function uO(){return ZS||(ZS=1,$s.ConcurrentRoot=1,$s.ContinuousEventPriority=8,$s.DefaultEventPriority=32,$s.DiscreteEventPriority=2,$s.IdleEventPriority=268435456,$s.LegacyRoot=0,$s.NoEventPriority=0),$s}var KS;function hO(){return KS||(KS=1,Gv.exports=uO()),Gv.exports}var rm=hO();const Tg="180",SA={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},fO={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},EA=0,H_=1,MA=2,dO=3,wA=0,Ag=1,nf=2,is=3,_a=0,Fi=1,zn=2,ma=0,bl=1,V_=2,W_=3,X_=4,TA=5,ro=100,AA=101,CA=102,RA=103,DA=104,UA=200,OA=201,LA=202,IA=203,vm=204,ym=205,NA=206,PA=207,zA=208,FA=209,BA=210,kA=211,GA=212,HA=213,VA=214,_m=0,xm=1,bm=2,Tl=3,Sm=4,Em=5,Mm=6,wm=7,Kf=0,WA=1,XA=2,As=0,jA=1,qA=2,YA=3,zx=4,ZA=5,KA=6,JA=7,j_="attached",QA="detached",Cg=300,xa=301,uo=302,_f=303,xf=304,wu=306,bf=1e3,Fr=1001,Sf=1002,vi=1003,Fx=1004,pO=1004,Qc=1005,mO=1005,Fn=1006,rf=1007,gO=1007,ws=1008,vO=1008,Gr=1009,Bx=1010,kx=1011,lu=1012,Rg=1013,ba=1014,Qi=1015,Tu=1016,Dg=1017,Ug=1018,cu=1020,Gx=35902,Hx=35899,Vx=1021,Wx=1022,Di=1023,uu=1026,hu=1027,Og=1028,Jf=1029,Xx=1030,Lg=1031,yO=1032,Ig=1033,sf=33776,af=33777,of=33778,lf=33779,Tm=35840,Am=35841,Cm=35842,Rm=35843,Dm=36196,Um=37492,Om=37496,Lm=37808,Im=37809,Nm=37810,Pm=37811,zm=37812,Fm=37813,Bm=37814,km=37815,Gm=37816,Hm=37817,Vm=37818,Wm=37819,Xm=37820,jm=37821,qm=36492,Ym=36494,Zm=36495,Km=36283,Jm=36284,Qm=36285,$m=36286,$A=2200,e2=2201,t2=2202,Ef=2300,eg=2301,sm=2302,gl=2400,vl=2401,Mf=2402,Ng=2500,jx=2501,_O=0,xO=1,bO=2,n2=3200,qx=3201,SO=3202,EO=3203,go=0,i2=1,fa="",Ri="srgb",ho="srgb-linear",wf="linear",an="srgb",MO=0,fl=7680,wO=7681,TO=7682,AO=7683,CO=34055,RO=34056,DO=5386,UO=512,OO=513,LO=514,IO=515,NO=516,PO=517,zO=518,q_=519,r2=512,s2=513,a2=514,Yx=515,o2=516,l2=517,c2=518,u2=519,Tf=35044,FO=35048,BO=35040,kO=35045,GO=35049,HO=35041,VO=35046,WO=35050,XO=35042,jO="100",Y_="300 es",yr=2e3,fu=2001,qO={COMPUTE:"compute",RENDER:"render"},YO={PERSPECTIVE:"perspective",LINEAR:"linear",FLAT:"flat"},ZO={NORMAL:"normal",CENTROID:"centroid",SAMPLE:"sample",FIRST:"first",EITHER:"either"};let Us=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){const n=this._listeners;return n===void 0?!1:n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){const n=this._listeners;if(n===void 0)return;const r=n[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const n=t[e.type];if(n!==void 0){e.target=this;const r=n.slice(0);for(let s=0,a=r.length;s<a;s++)r[s].call(this,e);e.target=null}}};const Ti=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let JS=1234567;const Sl=Math.PI/180,du=180/Math.PI;function _r(){const i=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(Ti[i&255]+Ti[i>>8&255]+Ti[i>>16&255]+Ti[i>>24&255]+"-"+Ti[e&255]+Ti[e>>8&255]+"-"+Ti[e>>16&15|64]+Ti[e>>24&255]+"-"+Ti[t&63|128]+Ti[t>>8&255]+"-"+Ti[t>>16&255]+Ti[t>>24&255]+Ti[n&255]+Ti[n>>8&255]+Ti[n>>16&255]+Ti[n>>24&255]).toLowerCase()}function St(i,e,t){return Math.max(e,Math.min(t,i))}function Zx(i,e){return(i%e+e)%e}function KO(i,e,t,n,r){return n+(i-e)*(r-n)/(t-e)}function JO(i,e,t){return i!==e?(t-i)/(e-i):0}function cf(i,e,t){return(1-t)*i+t*e}function QO(i,e,t,n){return cf(i,e,1-Math.exp(-t*n))}function $O(i,e=1){return e-Math.abs(Zx(i,e*2)-e)}function eL(i,e,t){return i<=e?0:i>=t?1:(i=(i-e)/(t-e),i*i*(3-2*i))}function tL(i,e,t){return i<=e?0:i>=t?1:(i=(i-e)/(t-e),i*i*i*(i*(i*6-15)+10))}function nL(i,e){return i+Math.floor(Math.random()*(e-i+1))}function iL(i,e){return i+Math.random()*(e-i)}function rL(i){return i*(.5-Math.random())}function sL(i){i!==void 0&&(JS=i);let e=JS+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function aL(i){return i*Sl}function oL(i){return i*du}function lL(i){return(i&i-1)===0&&i!==0}function cL(i){return Math.pow(2,Math.ceil(Math.log(i)/Math.LN2))}function uL(i){return Math.pow(2,Math.floor(Math.log(i)/Math.LN2))}function hL(i,e,t,n,r){const s=Math.cos,a=Math.sin,o=s(t/2),l=a(t/2),c=s((e+n)/2),h=a((e+n)/2),d=s((e-n)/2),p=a((e-n)/2),m=s((n-e)/2),v=a((n-e)/2);switch(r){case"XYX":i.set(o*h,l*d,l*p,o*c);break;case"YZY":i.set(l*p,o*h,l*d,o*c);break;case"ZXZ":i.set(l*d,l*p,o*h,o*c);break;case"XZX":i.set(o*h,l*v,l*m,o*c);break;case"YXY":i.set(l*m,o*h,l*v,o*c);break;case"ZYZ":i.set(l*v,l*m,o*h,o*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function Pi(i,e){switch(e.constructor){case Float32Array:return i;case Uint32Array:return i/4294967295;case Uint16Array:return i/65535;case Uint8Array:return i/255;case Int32Array:return Math.max(i/2147483647,-1);case Int16Array:return Math.max(i/32767,-1);case Int8Array:return Math.max(i/127,-1);default:throw new Error("Invalid component type.")}}function Ot(i,e){switch(e.constructor){case Float32Array:return i;case Uint32Array:return Math.round(i*4294967295);case Uint16Array:return Math.round(i*65535);case Uint8Array:return Math.round(i*255);case Int32Array:return Math.round(i*2147483647);case Int16Array:return Math.round(i*32767);case Int8Array:return Math.round(i*127);default:throw new Error("Invalid component type.")}}const tg={DEG2RAD:Sl,RAD2DEG:du,generateUUID:_r,clamp:St,euclideanModulo:Zx,mapLinear:KO,inverseLerp:JO,lerp:cf,damp:QO,pingpong:$O,smoothstep:eL,smootherstep:tL,randInt:nL,randFloat:iL,randFloatSpread:rL,seededRandom:sL,degToRad:aL,radToDeg:oL,isPowerOfTwo:lL,ceilPowerOfTwo:cL,floorPowerOfTwo:uL,setQuaternionFromProperEuler:hL,normalize:Ot,denormalize:Pi};class ke{constructor(e=0,t=0){ke.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=St(this.x,e.x,t.x),this.y=St(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=St(this.x,e,t),this.y=St(this.y,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(St(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(St(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),r=Math.sin(t),s=this.x-e.x,a=this.y-e.y;return this.x=s*n-a*r+e.x,this.y=s*r+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class yi{constructor(e=0,t=0,n=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}static slerpFlat(e,t,n,r,s,a,o){let l=n[r+0],c=n[r+1],h=n[r+2],d=n[r+3];const p=s[a+0],m=s[a+1],v=s[a+2],x=s[a+3];if(o===0){e[t+0]=l,e[t+1]=c,e[t+2]=h,e[t+3]=d;return}if(o===1){e[t+0]=p,e[t+1]=m,e[t+2]=v,e[t+3]=x;return}if(d!==x||l!==p||c!==m||h!==v){let _=1-o;const g=l*p+c*m+h*v+d*x,b=g>=0?1:-1,E=1-g*g;if(E>Number.EPSILON){const w=Math.sqrt(E),T=Math.atan2(w,g*b);_=Math.sin(_*T)/w,o=Math.sin(o*T)/w}const S=o*b;if(l=l*_+p*S,c=c*_+m*S,h=h*_+v*S,d=d*_+x*S,_===1-o){const w=1/Math.sqrt(l*l+c*c+h*h+d*d);l*=w,c*=w,h*=w,d*=w}}e[t]=l,e[t+1]=c,e[t+2]=h,e[t+3]=d}static multiplyQuaternionsFlat(e,t,n,r,s,a){const o=n[r],l=n[r+1],c=n[r+2],h=n[r+3],d=s[a],p=s[a+1],m=s[a+2],v=s[a+3];return e[t]=o*v+h*d+l*m-c*p,e[t+1]=l*v+h*p+c*d-o*m,e[t+2]=c*v+h*m+o*p-l*d,e[t+3]=h*v-o*d-l*p-c*m,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const n=e._x,r=e._y,s=e._z,a=e._order,o=Math.cos,l=Math.sin,c=o(n/2),h=o(r/2),d=o(s/2),p=l(n/2),m=l(r/2),v=l(s/2);switch(a){case"XYZ":this._x=p*h*d+c*m*v,this._y=c*m*d-p*h*v,this._z=c*h*v+p*m*d,this._w=c*h*d-p*m*v;break;case"YXZ":this._x=p*h*d+c*m*v,this._y=c*m*d-p*h*v,this._z=c*h*v-p*m*d,this._w=c*h*d+p*m*v;break;case"ZXY":this._x=p*h*d-c*m*v,this._y=c*m*d+p*h*v,this._z=c*h*v+p*m*d,this._w=c*h*d-p*m*v;break;case"ZYX":this._x=p*h*d-c*m*v,this._y=c*m*d+p*h*v,this._z=c*h*v-p*m*d,this._w=c*h*d+p*m*v;break;case"YZX":this._x=p*h*d+c*m*v,this._y=c*m*d+p*h*v,this._z=c*h*v-p*m*d,this._w=c*h*d-p*m*v;break;case"XZY":this._x=p*h*d-c*m*v,this._y=c*m*d-p*h*v,this._z=c*h*v+p*m*d,this._w=c*h*d+p*m*v;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],r=t[4],s=t[8],a=t[1],o=t[5],l=t[9],c=t[2],h=t[6],d=t[10],p=n+o+d;if(p>0){const m=.5/Math.sqrt(p+1);this._w=.25/m,this._x=(h-l)*m,this._y=(s-c)*m,this._z=(a-r)*m}else if(n>o&&n>d){const m=2*Math.sqrt(1+n-o-d);this._w=(h-l)/m,this._x=.25*m,this._y=(r+a)/m,this._z=(s+c)/m}else if(o>d){const m=2*Math.sqrt(1+o-n-d);this._w=(s-c)/m,this._x=(r+a)/m,this._y=.25*m,this._z=(l+h)/m}else{const m=2*Math.sqrt(1+d-n-o);this._w=(a-r)/m,this._x=(s+c)/m,this._y=(l+h)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-8?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(St(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const r=Math.min(1,t/n);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,r=e._y,s=e._z,a=e._w,o=t._x,l=t._y,c=t._z,h=t._w;return this._x=n*h+a*o+r*c-s*l,this._y=r*h+a*l+s*o-n*c,this._z=s*h+a*c+n*l-r*o,this._w=a*h-n*o-r*l-s*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const n=this._x,r=this._y,s=this._z,a=this._w;let o=a*e._w+n*e._x+r*e._y+s*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=n,this._y=r,this._z=s,this;const l=1-o*o;if(l<=Number.EPSILON){const m=1-t;return this._w=m*a+t*this._w,this._x=m*n+t*this._x,this._y=m*r+t*this._y,this._z=m*s+t*this._z,this.normalize(),this}const c=Math.sqrt(l),h=Math.atan2(c,o),d=Math.sin((1-t)*h)/c,p=Math.sin(t*h)/c;return this._w=a*d+this._w*p,this._x=n*d+this._x*p,this._y=r*d+this._y*p,this._z=s*d+this._z*p,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),s=Math.sqrt(n);return this.set(r*Math.sin(e),r*Math.cos(e),s*Math.sin(t),s*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class j{constructor(e=0,t=0,n=0){j.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(QS.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(QS.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*r,this.y=s[1]*t+s[4]*n+s[7]*r,this.z=s[2]*t+s[5]*n+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,s=e.elements,a=1/(s[3]*t+s[7]*n+s[11]*r+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*r+s[12])*a,this.y=(s[1]*t+s[5]*n+s[9]*r+s[13])*a,this.z=(s[2]*t+s[6]*n+s[10]*r+s[14])*a,this}applyQuaternion(e){const t=this.x,n=this.y,r=this.z,s=e.x,a=e.y,o=e.z,l=e.w,c=2*(a*r-o*n),h=2*(o*t-s*r),d=2*(s*n-a*t);return this.x=t+l*c+a*d-o*h,this.y=n+l*h+o*c-s*d,this.z=r+l*d+s*h-a*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*r,this.y=s[1]*t+s[5]*n+s[9]*r,this.z=s[2]*t+s[6]*n+s[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=St(this.x,e.x,t.x),this.y=St(this.y,e.y,t.y),this.z=St(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=St(this.x,e,t),this.y=St(this.y,e,t),this.z=St(this.z,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(St(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,r=e.y,s=e.z,a=t.x,o=t.y,l=t.z;return this.x=r*l-s*o,this.y=s*a-n*l,this.z=n*o-r*a,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return Hv.copy(this).projectOnVector(e),this.sub(Hv)}reflect(e){return this.sub(Hv.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(St(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Hv=new j,QS=new yi;class At{constructor(e,t,n,r,s,a,o,l,c){At.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,r,s,a,o,l,c)}set(e,t,n,r,s,a,o,l,c){const h=this.elements;return h[0]=e,h[1]=r,h[2]=o,h[3]=t,h[4]=s,h[5]=l,h[6]=n,h[7]=a,h[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,s=this.elements,a=n[0],o=n[3],l=n[6],c=n[1],h=n[4],d=n[7],p=n[2],m=n[5],v=n[8],x=r[0],_=r[3],g=r[6],b=r[1],E=r[4],S=r[7],w=r[2],T=r[5],R=r[8];return s[0]=a*x+o*b+l*w,s[3]=a*_+o*E+l*T,s[6]=a*g+o*S+l*R,s[1]=c*x+h*b+d*w,s[4]=c*_+h*E+d*T,s[7]=c*g+h*S+d*R,s[2]=p*x+m*b+v*w,s[5]=p*_+m*E+v*T,s[8]=p*g+m*S+v*R,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],r=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8];return t*a*h-t*o*c-n*s*h+n*o*l+r*s*c-r*a*l}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8],d=h*a-o*c,p=o*l-h*s,m=c*s-a*l,v=t*d+n*p+r*m;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);const x=1/v;return e[0]=d*x,e[1]=(r*c-h*n)*x,e[2]=(o*n-r*a)*x,e[3]=p*x,e[4]=(h*t-r*l)*x,e[5]=(r*s-o*t)*x,e[6]=m*x,e[7]=(n*l-c*t)*x,e[8]=(a*t-n*s)*x,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,r,s,a,o){const l=Math.cos(s),c=Math.sin(s);return this.set(n*l,n*c,-n*(l*a+c*o)+a+e,-r*c,r*l,-r*(-c*a+l*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(Vv.makeScale(e,t)),this}rotate(e){return this.premultiply(Vv.makeRotation(-e)),this}translate(e,t){return this.premultiply(Vv.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let r=0;r<9;r++)if(t[r]!==n[r])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const Vv=new At;function h2(i){for(let e=i.length-1;e>=0;--e)if(i[e]>=65535)return!0;return!1}const fL={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function $c(i,e){return new fL[i](e)}function Af(i){return document.createElementNS("http://www.w3.org/1999/xhtml",i)}function f2(){const i=Af("canvas");return i.style.display="block",i}const $S={};function Cf(i){i in $S||($S[i]=!0,console.warn(i))}function dL(i,e,t){return new Promise(function(n,r){function s(){switch(i.clientWaitSync(e,i.SYNC_FLUSH_COMMANDS_BIT,0)){case i.WAIT_FAILED:r();break;case i.TIMEOUT_EXPIRED:setTimeout(s,t);break;default:n()}}setTimeout(s,t)})}const eE=new At().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),tE=new At().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function pL(){const i={enabled:!0,workingColorSpace:ho,spaces:{},convert:function(r,s,a){return this.enabled===!1||s===a||!s||!a||(this.spaces[s].transfer===an&&(r.r=ga(r.r),r.g=ga(r.g),r.b=ga(r.b)),this.spaces[s].primaries!==this.spaces[a].primaries&&(r.applyMatrix3(this.spaces[s].toXYZ),r.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===an&&(r.r=ru(r.r),r.g=ru(r.g),r.b=ru(r.b))),r},workingToColorSpace:function(r,s){return this.convert(r,this.workingColorSpace,s)},colorSpaceToWorking:function(r,s){return this.convert(r,s,this.workingColorSpace)},getPrimaries:function(r){return this.spaces[r].primaries},getTransfer:function(r){return r===fa?wf:this.spaces[r].transfer},getToneMappingMode:function(r){return this.spaces[r].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(r,s=this.workingColorSpace){return r.fromArray(this.spaces[s].luminanceCoefficients)},define:function(r){Object.assign(this.spaces,r)},_getMatrix:function(r,s,a){return r.copy(this.spaces[s].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(r){return this.spaces[r].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(r=this.workingColorSpace){return this.spaces[r].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(r,s){return Cf("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),i.workingToColorSpace(r,s)},toWorkingColorSpace:function(r,s){return Cf("THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),i.colorSpaceToWorking(r,s)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],n=[.3127,.329];return i.define({[ho]:{primaries:e,whitePoint:n,transfer:wf,toXYZ:eE,fromXYZ:tE,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:Ri},outputColorSpaceConfig:{drawingBufferColorSpace:Ri}},[Ri]:{primaries:e,whitePoint:n,transfer:an,toXYZ:eE,fromXYZ:tE,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:Ri}}}),i}const Gt=pL();function ga(i){return i<.04045?i*.0773993808:Math.pow(i*.9478672986+.0521327014,2.4)}function ru(i){return i<.0031308?i*12.92:1.055*Math.pow(i,.41666)-.055}let gc;class d2{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{gc===void 0&&(gc=Af("canvas")),gc.width=e.width,gc.height=e.height;const r=gc.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),n=gc}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=Af("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const r=n.getImageData(0,0,e.width,e.height),s=r.data;for(let a=0;a<s.length;a++)s[a]=ga(s[a]/255)*255;return n.putImageData(r,0,0),t}else if(e.data){const t=e.data.slice(0);for(let n=0;n<t.length;n++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[n]=Math.floor(ga(t[n]/255)*255):t[n]=ga(t[n]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let mL=0;class so{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:mL++}),this.uuid=_r(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const t=this.data;return typeof HTMLVideoElement<"u"&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):t instanceof VideoFrame?e.set(t.displayHeight,t.displayWidth,0):t!==null?e.set(t.width,t.height,t.depth||0):e.set(0,0,0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const n={uuid:this.uuid,url:""},r=this.data;if(r!==null){let s;if(Array.isArray(r)){s=[];for(let a=0,o=r.length;a<o;a++)r[a].isDataTexture?s.push(Wv(r[a].image)):s.push(Wv(r[a]))}else s=Wv(r);n.url=s}return t||(e.images[this.uuid]=n),n}}function Wv(i){return typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&i instanceof ImageBitmap?d2.getDataURL(i):i.data?{data:Array.from(i.data),width:i.width,height:i.height,type:i.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let gL=0;const Xv=new j;class Dn extends Us{constructor(e=Dn.DEFAULT_IMAGE,t=Dn.DEFAULT_MAPPING,n=Fr,r=Fr,s=Fn,a=ws,o=Di,l=Gr,c=Dn.DEFAULT_ANISOTROPY,h=fa){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:gL++}),this.uuid=_r(),this.name="",this.source=new so(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=r,this.magFilter=s,this.minFilter=a,this.anisotropy=c,this.format=o,this.internalFormat=null,this.type=l,this.offset=new ke(0,0),this.repeat=new ke(1,1),this.center=new ke(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new At,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=h,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0}get width(){return this.source.getSize(Xv).x}get height(){return this.source.getSize(Xv).y}get depth(){return this.source.getSize(Xv).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const t in e){const n=e[t];if(n===void 0){console.warn(`THREE.Texture.setValues(): parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){console.warn(`THREE.Texture.setValues(): property '${t}' does not exist.`);continue}r&&n&&r.isVector2&&n.isVector2||r&&n&&r.isVector3&&n.isVector3||r&&n&&r.isMatrix3&&n.isMatrix3?r.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const n={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Cg)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case bf:e.x=e.x-Math.floor(e.x);break;case Fr:e.x=e.x<0?0:1;break;case Sf:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case bf:e.y=e.y-Math.floor(e.y);break;case Fr:e.y=e.y<0?0:1;break;case Sf:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}Dn.DEFAULT_IMAGE=null;Dn.DEFAULT_MAPPING=Cg;Dn.DEFAULT_ANISOTROPY=1;class Bt{constructor(e=0,t=0,n=0,r=1){Bt.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,s=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*s,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*s,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*s,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*s,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,r,s;const l=e.elements,c=l[0],h=l[4],d=l[8],p=l[1],m=l[5],v=l[9],x=l[2],_=l[6],g=l[10];if(Math.abs(h-p)<.01&&Math.abs(d-x)<.01&&Math.abs(v-_)<.01){if(Math.abs(h+p)<.1&&Math.abs(d+x)<.1&&Math.abs(v+_)<.1&&Math.abs(c+m+g-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const E=(c+1)/2,S=(m+1)/2,w=(g+1)/2,T=(h+p)/4,R=(d+x)/4,U=(v+_)/4;return E>S&&E>w?E<.01?(n=0,r=.707106781,s=.707106781):(n=Math.sqrt(E),r=T/n,s=R/n):S>w?S<.01?(n=.707106781,r=0,s=.707106781):(r=Math.sqrt(S),n=T/r,s=U/r):w<.01?(n=.707106781,r=.707106781,s=0):(s=Math.sqrt(w),n=R/s,r=U/s),this.set(n,r,s,t),this}let b=Math.sqrt((_-v)*(_-v)+(d-x)*(d-x)+(p-h)*(p-h));return Math.abs(b)<.001&&(b=1),this.x=(_-v)/b,this.y=(d-x)/b,this.z=(p-h)/b,this.w=Math.acos((c+m+g-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=St(this.x,e.x,t.x),this.y=St(this.y,e.y,t.y),this.z=St(this.z,e.z,t.z),this.w=St(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=St(this.x,e,t),this.y=St(this.y,e,t),this.z=St(this.z,e,t),this.w=St(this.w,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(St(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class Kx extends Us{constructor(e=1,t=1,n={}){super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Fn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},n),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=n.depth,this.scissor=new Bt(0,0,e,t),this.scissorTest=!1,this.viewport=new Bt(0,0,e,t);const r={width:e,height:t,depth:n.depth},s=new Dn(r);this.textures=[];const a=n.count;for(let o=0;o<a;o++)this.textures[o]=s.clone(),this.textures[o].isRenderTargetTexture=!0,this.textures[o].renderTarget=this;this._setTextureOptions(n),this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=n.depthTexture,this.samples=n.samples,this.multiview=n.multiview}_setTextureOptions(e={}){const t={minFilter:Fn,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(t.mapping=e.mapping),e.wrapS!==void 0&&(t.wrapS=e.wrapS),e.wrapT!==void 0&&(t.wrapT=e.wrapT),e.wrapR!==void 0&&(t.wrapR=e.wrapR),e.magFilter!==void 0&&(t.magFilter=e.magFilter),e.minFilter!==void 0&&(t.minFilter=e.minFilter),e.format!==void 0&&(t.format=e.format),e.type!==void 0&&(t.type=e.type),e.anisotropy!==void 0&&(t.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(t.colorSpace=e.colorSpace),e.flipY!==void 0&&(t.flipY=e.flipY),e.generateMipmaps!==void 0&&(t.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(t.internalFormat=e.internalFormat);for(let n=0;n<this.textures.length;n++)this.textures[n].setValues(t)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let r=0,s=this.textures.length;r<s;r++)this.textures[r].image.width=e,this.textures[r].image.height=t,this.textures[r].image.depth=n,this.textures[r].isArrayTexture=this.textures[r].image.depth>1;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,n=e.textures.length;t<n;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;const r=Object.assign({},e.textures[t].image);this.textures[t].source=new so(r)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Ds extends Kx{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class Pg extends Dn{constructor(e=null,t=1,n=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=vi,this.minFilter=vi,this.wrapR=Fr,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class vL extends Ds{constructor(e=1,t=1,n=1,r={}){super(e,t,r),this.isWebGLArrayRenderTarget=!0,this.depth=n,this.texture=new Pg(null,e,t,n),this._setTextureOptions(r),this.texture.isRenderTargetTexture=!0}}class zg extends Dn{constructor(e=null,t=1,n=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=vi,this.minFilter=vi,this.wrapR=Fr,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class yL extends Ds{constructor(e=1,t=1,n=1,r={}){super(e,t,r),this.isWebGL3DRenderTarget=!0,this.depth=n,this.texture=new zg(null,e,t,n),this._setTextureOptions(r),this.texture.isRenderTargetTexture=!0}}class Qn{constructor(e=new j(1/0,1/0,1/0),t=new j(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(Kr.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(Kr.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=Kr.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const n=e.geometry;if(n!==void 0){const s=n.getAttribute("position");if(t===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let a=0,o=s.count;a<o;a++)e.isMesh===!0?e.getVertexPosition(a,Kr):Kr.fromBufferAttribute(s,a),Kr.applyMatrix4(e.matrixWorld),this.expandByPoint(Kr);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),Xd.copy(e.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),Xd.copy(n.boundingBox)),Xd.applyMatrix4(e.matrixWorld),this.union(Xd)}const r=e.children;for(let s=0,a=r.length;s<a;s++)this.expandByObject(r[s],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,Kr),Kr.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(dh),jd.subVectors(this.max,dh),vc.subVectors(e.a,dh),yc.subVectors(e.b,dh),_c.subVectors(e.c,dh),qa.subVectors(yc,vc),Ya.subVectors(_c,yc),qo.subVectors(vc,_c);let t=[0,-qa.z,qa.y,0,-Ya.z,Ya.y,0,-qo.z,qo.y,qa.z,0,-qa.x,Ya.z,0,-Ya.x,qo.z,0,-qo.x,-qa.y,qa.x,0,-Ya.y,Ya.x,0,-qo.y,qo.x,0];return!jv(t,vc,yc,_c,jd)||(t=[1,0,0,0,1,0,0,0,1],!jv(t,vc,yc,_c,jd))?!1:(qd.crossVectors(qa,Ya),t=[qd.x,qd.y,qd.z],jv(t,vc,yc,_c,jd))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Kr).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Kr).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(ea[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),ea[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),ea[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),ea[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),ea[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),ea[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),ea[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),ea[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(ea),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const ea=[new j,new j,new j,new j,new j,new j,new j,new j],Kr=new j,Xd=new Qn,vc=new j,yc=new j,_c=new j,qa=new j,Ya=new j,qo=new j,dh=new j,jd=new j,qd=new j,Yo=new j;function jv(i,e,t,n,r){for(let s=0,a=i.length-3;s<=a;s+=3){Yo.fromArray(i,s);const o=r.x*Math.abs(Yo.x)+r.y*Math.abs(Yo.y)+r.z*Math.abs(Yo.z),l=e.dot(Yo),c=t.dot(Yo),h=n.dot(Yo);if(Math.max(-Math.max(l,c,h),Math.min(l,c,h))>o)return!1}return!0}const _L=new Qn,ph=new j,qv=new j;let ri=class{constructor(e=new j,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;t!==void 0?n.copy(t):_L.setFromPoints(e).getCenter(n);let r=0;for(let s=0,a=e.length;s<a;s++)r=Math.max(r,n.distanceToSquared(e[s]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;ph.subVectors(e,this.center);const t=ph.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),r=(n-this.radius)*.5;this.center.addScaledVector(ph,r/n),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(qv.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(ph.copy(e.center).add(qv)),this.expandByPoint(ph.copy(e.center).sub(qv))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}};const ta=new j,Yv=new j,Yd=new j,Za=new j,Zv=new j,Zd=new j,Kv=new j;class Au{constructor(e=new j,t=new j(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,ta)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=ta.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(ta.copy(this.origin).addScaledVector(this.direction,t),ta.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){Yv.copy(e).add(t).multiplyScalar(.5),Yd.copy(t).sub(e).normalize(),Za.copy(this.origin).sub(Yv);const s=e.distanceTo(t)*.5,a=-this.direction.dot(Yd),o=Za.dot(this.direction),l=-Za.dot(Yd),c=Za.lengthSq(),h=Math.abs(1-a*a);let d,p,m,v;if(h>0)if(d=a*l-o,p=a*o-l,v=s*h,d>=0)if(p>=-v)if(p<=v){const x=1/h;d*=x,p*=x,m=d*(d+a*p+2*o)+p*(a*d+p+2*l)+c}else p=s,d=Math.max(0,-(a*p+o)),m=-d*d+p*(p+2*l)+c;else p=-s,d=Math.max(0,-(a*p+o)),m=-d*d+p*(p+2*l)+c;else p<=-v?(d=Math.max(0,-(-a*s+o)),p=d>0?-s:Math.min(Math.max(-s,-l),s),m=-d*d+p*(p+2*l)+c):p<=v?(d=0,p=Math.min(Math.max(-s,-l),s),m=p*(p+2*l)+c):(d=Math.max(0,-(a*s+o)),p=d>0?s:Math.min(Math.max(-s,-l),s),m=-d*d+p*(p+2*l)+c);else p=a>0?-s:s,d=Math.max(0,-(a*p+o)),m=-d*d+p*(p+2*l)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,d),r&&r.copy(Yv).addScaledVector(Yd,p),m}intersectSphere(e,t){ta.subVectors(e.center,this.origin);const n=ta.dot(this.direction),r=ta.dot(ta)-n*n,s=e.radius*e.radius;if(r>s)return null;const a=Math.sqrt(s-r),o=n-a,l=n+a;return l<0?null:o<0?this.at(l,t):this.at(o,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,s,a,o,l;const c=1/this.direction.x,h=1/this.direction.y,d=1/this.direction.z,p=this.origin;return c>=0?(n=(e.min.x-p.x)*c,r=(e.max.x-p.x)*c):(n=(e.max.x-p.x)*c,r=(e.min.x-p.x)*c),h>=0?(s=(e.min.y-p.y)*h,a=(e.max.y-p.y)*h):(s=(e.max.y-p.y)*h,a=(e.min.y-p.y)*h),n>a||s>r||((s>n||isNaN(n))&&(n=s),(a<r||isNaN(r))&&(r=a),d>=0?(o=(e.min.z-p.z)*d,l=(e.max.z-p.z)*d):(o=(e.max.z-p.z)*d,l=(e.min.z-p.z)*d),n>l||o>r)||((o>n||n!==n)&&(n=o),(l<r||r!==r)&&(r=l),r<0)?null:this.at(n>=0?n:r,t)}intersectsBox(e){return this.intersectBox(e,ta)!==null}intersectTriangle(e,t,n,r,s){Zv.subVectors(t,e),Zd.subVectors(n,e),Kv.crossVectors(Zv,Zd);let a=this.direction.dot(Kv),o;if(a>0){if(r)return null;o=1}else if(a<0)o=-1,a=-a;else return null;Za.subVectors(this.origin,e);const l=o*this.direction.dot(Zd.crossVectors(Za,Zd));if(l<0)return null;const c=o*this.direction.dot(Zv.cross(Za));if(c<0||l+c>a)return null;const h=-o*Za.dot(Kv);return h<0?null:this.at(h/a,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class bt{constructor(e,t,n,r,s,a,o,l,c,h,d,p,m,v,x,_){bt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,r,s,a,o,l,c,h,d,p,m,v,x,_)}set(e,t,n,r,s,a,o,l,c,h,d,p,m,v,x,_){const g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=r,g[1]=s,g[5]=a,g[9]=o,g[13]=l,g[2]=c,g[6]=h,g[10]=d,g[14]=p,g[3]=m,g[7]=v,g[11]=x,g[15]=_,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new bt().fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,r=1/xc.setFromMatrixColumn(e,0).length(),s=1/xc.setFromMatrixColumn(e,1).length(),a=1/xc.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,r=e.y,s=e.z,a=Math.cos(n),o=Math.sin(n),l=Math.cos(r),c=Math.sin(r),h=Math.cos(s),d=Math.sin(s);if(e.order==="XYZ"){const p=a*h,m=a*d,v=o*h,x=o*d;t[0]=l*h,t[4]=-l*d,t[8]=c,t[1]=m+v*c,t[5]=p-x*c,t[9]=-o*l,t[2]=x-p*c,t[6]=v+m*c,t[10]=a*l}else if(e.order==="YXZ"){const p=l*h,m=l*d,v=c*h,x=c*d;t[0]=p+x*o,t[4]=v*o-m,t[8]=a*c,t[1]=a*d,t[5]=a*h,t[9]=-o,t[2]=m*o-v,t[6]=x+p*o,t[10]=a*l}else if(e.order==="ZXY"){const p=l*h,m=l*d,v=c*h,x=c*d;t[0]=p-x*o,t[4]=-a*d,t[8]=v+m*o,t[1]=m+v*o,t[5]=a*h,t[9]=x-p*o,t[2]=-a*c,t[6]=o,t[10]=a*l}else if(e.order==="ZYX"){const p=a*h,m=a*d,v=o*h,x=o*d;t[0]=l*h,t[4]=v*c-m,t[8]=p*c+x,t[1]=l*d,t[5]=x*c+p,t[9]=m*c-v,t[2]=-c,t[6]=o*l,t[10]=a*l}else if(e.order==="YZX"){const p=a*l,m=a*c,v=o*l,x=o*c;t[0]=l*h,t[4]=x-p*d,t[8]=v*d+m,t[1]=d,t[5]=a*h,t[9]=-o*h,t[2]=-c*h,t[6]=m*d+v,t[10]=p-x*d}else if(e.order==="XZY"){const p=a*l,m=a*c,v=o*l,x=o*c;t[0]=l*h,t[4]=-d,t[8]=c*h,t[1]=p*d+x,t[5]=a*h,t[9]=m*d-v,t[2]=v*d-m,t[6]=o*h,t[10]=x*d+p}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(xL,e,bL)}lookAt(e,t,n){const r=this.elements;return mr.subVectors(e,t),mr.lengthSq()===0&&(mr.z=1),mr.normalize(),Ka.crossVectors(n,mr),Ka.lengthSq()===0&&(Math.abs(n.z)===1?mr.x+=1e-4:mr.z+=1e-4,mr.normalize(),Ka.crossVectors(n,mr)),Ka.normalize(),Kd.crossVectors(mr,Ka),r[0]=Ka.x,r[4]=Kd.x,r[8]=mr.x,r[1]=Ka.y,r[5]=Kd.y,r[9]=mr.y,r[2]=Ka.z,r[6]=Kd.z,r[10]=mr.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,s=this.elements,a=n[0],o=n[4],l=n[8],c=n[12],h=n[1],d=n[5],p=n[9],m=n[13],v=n[2],x=n[6],_=n[10],g=n[14],b=n[3],E=n[7],S=n[11],w=n[15],T=r[0],R=r[4],U=r[8],A=r[12],D=r[1],L=r[5],P=r[9],I=r[13],V=r[2],H=r[6],z=r[10],O=r[14],B=r[3],G=r[7],X=r[11],k=r[15];return s[0]=a*T+o*D+l*V+c*B,s[4]=a*R+o*L+l*H+c*G,s[8]=a*U+o*P+l*z+c*X,s[12]=a*A+o*I+l*O+c*k,s[1]=h*T+d*D+p*V+m*B,s[5]=h*R+d*L+p*H+m*G,s[9]=h*U+d*P+p*z+m*X,s[13]=h*A+d*I+p*O+m*k,s[2]=v*T+x*D+_*V+g*B,s[6]=v*R+x*L+_*H+g*G,s[10]=v*U+x*P+_*z+g*X,s[14]=v*A+x*I+_*O+g*k,s[3]=b*T+E*D+S*V+w*B,s[7]=b*R+E*L+S*H+w*G,s[11]=b*U+E*P+S*z+w*X,s[15]=b*A+E*I+S*O+w*k,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],r=e[8],s=e[12],a=e[1],o=e[5],l=e[9],c=e[13],h=e[2],d=e[6],p=e[10],m=e[14],v=e[3],x=e[7],_=e[11],g=e[15];return v*(+s*l*d-r*c*d-s*o*p+n*c*p+r*o*m-n*l*m)+x*(+t*l*m-t*c*p+s*a*p-r*a*m+r*c*h-s*l*h)+_*(+t*c*d-t*o*m-s*a*d+n*a*m+s*o*h-n*c*h)+g*(-r*o*h-t*l*d+t*o*p+r*a*d-n*a*p+n*l*h)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8],d=e[9],p=e[10],m=e[11],v=e[12],x=e[13],_=e[14],g=e[15],b=d*_*c-x*p*c+x*l*m-o*_*m-d*l*g+o*p*g,E=v*p*c-h*_*c-v*l*m+a*_*m+h*l*g-a*p*g,S=h*x*c-v*d*c+v*o*m-a*x*m-h*o*g+a*d*g,w=v*d*l-h*x*l-v*o*p+a*x*p+h*o*_-a*d*_,T=t*b+n*E+r*S+s*w;if(T===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const R=1/T;return e[0]=b*R,e[1]=(x*p*s-d*_*s-x*r*m+n*_*m+d*r*g-n*p*g)*R,e[2]=(o*_*s-x*l*s+x*r*c-n*_*c-o*r*g+n*l*g)*R,e[3]=(d*l*s-o*p*s-d*r*c+n*p*c+o*r*m-n*l*m)*R,e[4]=E*R,e[5]=(h*_*s-v*p*s+v*r*m-t*_*m-h*r*g+t*p*g)*R,e[6]=(v*l*s-a*_*s-v*r*c+t*_*c+a*r*g-t*l*g)*R,e[7]=(a*p*s-h*l*s+h*r*c-t*p*c-a*r*m+t*l*m)*R,e[8]=S*R,e[9]=(v*d*s-h*x*s-v*n*m+t*x*m+h*n*g-t*d*g)*R,e[10]=(a*x*s-v*o*s+v*n*c-t*x*c-a*n*g+t*o*g)*R,e[11]=(h*o*s-a*d*s-h*n*c+t*d*c+a*n*m-t*o*m)*R,e[12]=w*R,e[13]=(h*x*r-v*d*r+v*n*p-t*x*p-h*n*_+t*d*_)*R,e[14]=(v*o*r-a*x*r-v*n*l+t*x*l+a*n*_-t*o*_)*R,e[15]=(a*d*r-h*o*r+h*n*l-t*d*l-a*n*p+t*o*p)*R,this}scale(e){const t=this.elements,n=e.x,r=e.y,s=e.z;return t[0]*=n,t[4]*=r,t[8]*=s,t[1]*=n,t[5]*=r,t[9]*=s,t[2]*=n,t[6]*=r,t[10]*=s,t[3]*=n,t[7]*=r,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),r=Math.sin(t),s=1-n,a=e.x,o=e.y,l=e.z,c=s*a,h=s*o;return this.set(c*a+n,c*o-r*l,c*l+r*o,0,c*o+r*l,h*o+n,h*l-r*a,0,c*l-r*o,h*l+r*a,s*l*l+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,r,s,a){return this.set(1,n,s,0,e,1,a,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){const r=this.elements,s=t._x,a=t._y,o=t._z,l=t._w,c=s+s,h=a+a,d=o+o,p=s*c,m=s*h,v=s*d,x=a*h,_=a*d,g=o*d,b=l*c,E=l*h,S=l*d,w=n.x,T=n.y,R=n.z;return r[0]=(1-(x+g))*w,r[1]=(m+S)*w,r[2]=(v-E)*w,r[3]=0,r[4]=(m-S)*T,r[5]=(1-(p+g))*T,r[6]=(_+b)*T,r[7]=0,r[8]=(v+E)*R,r[9]=(_-b)*R,r[10]=(1-(p+x))*R,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){const r=this.elements;let s=xc.set(r[0],r[1],r[2]).length();const a=xc.set(r[4],r[5],r[6]).length(),o=xc.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),e.x=r[12],e.y=r[13],e.z=r[14],Jr.copy(this);const c=1/s,h=1/a,d=1/o;return Jr.elements[0]*=c,Jr.elements[1]*=c,Jr.elements[2]*=c,Jr.elements[4]*=h,Jr.elements[5]*=h,Jr.elements[6]*=h,Jr.elements[8]*=d,Jr.elements[9]*=d,Jr.elements[10]*=d,t.setFromRotationMatrix(Jr),n.x=s,n.y=a,n.z=o,this}makePerspective(e,t,n,r,s,a,o=yr,l=!1){const c=this.elements,h=2*s/(t-e),d=2*s/(n-r),p=(t+e)/(t-e),m=(n+r)/(n-r);let v,x;if(l)v=s/(a-s),x=a*s/(a-s);else if(o===yr)v=-(a+s)/(a-s),x=-2*a*s/(a-s);else if(o===fu)v=-a/(a-s),x=-a*s/(a-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return c[0]=h,c[4]=0,c[8]=p,c[12]=0,c[1]=0,c[5]=d,c[9]=m,c[13]=0,c[2]=0,c[6]=0,c[10]=v,c[14]=x,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,n,r,s,a,o=yr,l=!1){const c=this.elements,h=2/(t-e),d=2/(n-r),p=-(t+e)/(t-e),m=-(n+r)/(n-r);let v,x;if(l)v=1/(a-s),x=a/(a-s);else if(o===yr)v=-2/(a-s),x=-(a+s)/(a-s);else if(o===fu)v=-1/(a-s),x=-s/(a-s);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return c[0]=h,c[4]=0,c[8]=0,c[12]=p,c[1]=0,c[5]=d,c[9]=0,c[13]=m,c[2]=0,c[6]=0,c[10]=v,c[14]=x,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let r=0;r<16;r++)if(t[r]!==n[r])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const xc=new j,Jr=new bt,xL=new j(0,0,0),bL=new j(1,1,1),Ka=new j,Kd=new j,mr=new j,nE=new bt,iE=new yi;class Bi{constructor(e=0,t=0,n=0,r=Bi.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,r=this._order){return this._x=e,this._y=t,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const r=e.elements,s=r[0],a=r[4],o=r[8],l=r[1],c=r[5],h=r[9],d=r[2],p=r[6],m=r[10];switch(t){case"XYZ":this._y=Math.asin(St(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,m),this._z=Math.atan2(-a,s)):(this._x=Math.atan2(p,c),this._z=0);break;case"YXZ":this._x=Math.asin(-St(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,m),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-d,s),this._z=0);break;case"ZXY":this._x=Math.asin(St(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-d,m),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-St(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(p,m),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(St(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-d,s)):(this._x=0,this._y=Math.atan2(o,m));break;case"XZY":this._z=Math.asin(-St(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(p,c),this._y=Math.atan2(o,s)):(this._x=Math.atan2(-h,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return nE.makeRotationFromQuaternion(e),this.setFromRotationMatrix(nE,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return iE.setFromEuler(this),this.setFromQuaternion(iE,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Bi.DEFAULT_ORDER="XYZ";class pu{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let SL=0;const rE=new j,bc=new yi,na=new bt,Jd=new j,mh=new j,EL=new j,ML=new yi,sE=new j(1,0,0),aE=new j(0,1,0),oE=new j(0,0,1),lE={type:"added"},wL={type:"removed"},Sc={type:"childadded",child:null},Jv={type:"childremoved",child:null};class Xt extends Us{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:SL++}),this.uuid=_r(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Xt.DEFAULT_UP.clone();const e=new j,t=new Bi,n=new yi,r=new j(1,1,1);function s(){n.setFromEuler(t,!1)}function a(){t.setFromQuaternion(n,void 0,!1)}t._onChange(s),n._onChange(a),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new bt},normalMatrix:{value:new At}}),this.matrix=new bt,this.matrixWorld=new bt,this.matrixAutoUpdate=Xt.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Xt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new pu,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return bc.setFromAxisAngle(e,t),this.quaternion.multiply(bc),this}rotateOnWorldAxis(e,t){return bc.setFromAxisAngle(e,t),this.quaternion.premultiply(bc),this}rotateX(e){return this.rotateOnAxis(sE,e)}rotateY(e){return this.rotateOnAxis(aE,e)}rotateZ(e){return this.rotateOnAxis(oE,e)}translateOnAxis(e,t){return rE.copy(e).applyQuaternion(this.quaternion),this.position.add(rE.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(sE,e)}translateY(e){return this.translateOnAxis(aE,e)}translateZ(e){return this.translateOnAxis(oE,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(na.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?Jd.copy(e):Jd.set(e,t,n);const r=this.parent;this.updateWorldMatrix(!0,!1),mh.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?na.lookAt(mh,Jd,this.up):na.lookAt(Jd,mh,this.up),this.quaternion.setFromRotationMatrix(na),r&&(na.extractRotation(r.matrixWorld),bc.setFromRotationMatrix(na),this.quaternion.premultiply(bc.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(lE),Sc.child=e,this.dispatchEvent(Sc),Sc.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(wL),Jv.child=e,this.dispatchEvent(Jv),Jv.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),na.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),na.multiply(e.parent.matrixWorld)),e.applyMatrix4(na),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(lE),Sc.child=e,this.dispatchEvent(Sc),Sc.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,r=this.children.length;n<r;n++){const a=this.children[n].getObjectByProperty(e,t);if(a!==void 0)return a}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);const r=this.children;for(let s=0,a=r.length;s<a;s++)r[s].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(mh,e,EL),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(mh,ML,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t){const n=this.parent;if(e===!0&&n!==null&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){const r=this.children;for(let s=0,a=r.length;s<a;s++)r[s].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const r={};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(o=>({...o,boundingBox:o.boundingBox?o.boundingBox.toJSON():void 0,boundingSphere:o.boundingSphere?o.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(o=>({...o})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function s(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let c=0,h=l.length;c<h;c++){const d=l[c];s(e.shapes,d)}else s(e.shapes,l)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const o=[];for(let l=0,c=this.material.length;l<c;l++)o.push(s(e.materials,this.material[l]));r.material=o}else r.material=s(e.materials,this.material);if(this.children.length>0){r.children=[];for(let o=0;o<this.children.length;o++)r.children.push(this.children[o].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let o=0;o<this.animations.length;o++){const l=this.animations[o];r.animations.push(s(e.animations,l))}}if(t){const o=a(e.geometries),l=a(e.materials),c=a(e.textures),h=a(e.images),d=a(e.shapes),p=a(e.skeletons),m=a(e.animations),v=a(e.nodes);o.length>0&&(n.geometries=o),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),h.length>0&&(n.images=h),d.length>0&&(n.shapes=d),p.length>0&&(n.skeletons=p),m.length>0&&(n.animations=m),v.length>0&&(n.nodes=v)}return n.object=r,n;function a(o){const l=[];for(const c in o){const h=o[c];delete h.metadata,l.push(h)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n<e.children.length;n++){const r=e.children[n];this.add(r.clone())}return this}}Xt.DEFAULT_UP=new j(0,1,0);Xt.DEFAULT_MATRIX_AUTO_UPDATE=!0;Xt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const Qr=new j,ia=new j,Qv=new j,ra=new j,Ec=new j,Mc=new j,cE=new j,$v=new j,ey=new j,ty=new j,ny=new Bt,iy=new Bt,ry=new Bt;class Ji{constructor(e=new j,t=new j,n=new j){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,r){r.subVectors(n,t),Qr.subVectors(e,t),r.cross(Qr);const s=r.lengthSq();return s>0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,t,n,r,s){Qr.subVectors(r,t),ia.subVectors(n,t),Qv.subVectors(e,t);const a=Qr.dot(Qr),o=Qr.dot(ia),l=Qr.dot(Qv),c=ia.dot(ia),h=ia.dot(Qv),d=a*c-o*o;if(d===0)return s.set(0,0,0),null;const p=1/d,m=(c*l-o*h)*p,v=(a*h-o*l)*p;return s.set(1-m-v,v,m)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,ra)===null?!1:ra.x>=0&&ra.y>=0&&ra.x+ra.y<=1}static getInterpolation(e,t,n,r,s,a,o,l){return this.getBarycoord(e,t,n,r,ra)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,ra.x),l.addScaledVector(a,ra.y),l.addScaledVector(o,ra.z),l)}static getInterpolatedAttribute(e,t,n,r,s,a){return ny.setScalar(0),iy.setScalar(0),ry.setScalar(0),ny.fromBufferAttribute(e,t),iy.fromBufferAttribute(e,n),ry.fromBufferAttribute(e,r),a.setScalar(0),a.addScaledVector(ny,s.x),a.addScaledVector(iy,s.y),a.addScaledVector(ry,s.z),a}static isFrontFacing(e,t,n,r){return Qr.subVectors(n,t),ia.subVectors(e,t),Qr.cross(ia).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Qr.subVectors(this.c,this.b),ia.subVectors(this.a,this.b),Qr.cross(ia).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Ji.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Ji.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,r,s){return Ji.getInterpolation(e,this.a,this.b,this.c,t,n,r,s)}containsPoint(e){return Ji.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Ji.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,r=this.b,s=this.c;let a,o;Ec.subVectors(r,n),Mc.subVectors(s,n),$v.subVectors(e,n);const l=Ec.dot($v),c=Mc.dot($v);if(l<=0&&c<=0)return t.copy(n);ey.subVectors(e,r);const h=Ec.dot(ey),d=Mc.dot(ey);if(h>=0&&d<=h)return t.copy(r);const p=l*d-h*c;if(p<=0&&l>=0&&h<=0)return a=l/(l-h),t.copy(n).addScaledVector(Ec,a);ty.subVectors(e,s);const m=Ec.dot(ty),v=Mc.dot(ty);if(v>=0&&m<=v)return t.copy(s);const x=m*c-l*v;if(x<=0&&c>=0&&v<=0)return o=c/(c-v),t.copy(n).addScaledVector(Mc,o);const _=h*v-m*d;if(_<=0&&d-h>=0&&m-v>=0)return cE.subVectors(s,r),o=(d-h)/(d-h+(m-v)),t.copy(r).addScaledVector(cE,o);const g=1/(_+x+p);return a=x*g,o=p*g,t.copy(n).addScaledVector(Ec,a).addScaledVector(Mc,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const p2={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ja={h:0,s:0,l:0},Qd={h:0,s:0,l:0};function sy(i,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?i+(e-i)*6*t:t<1/2?e:t<2/3?i+(e-i)*6*(2/3-t):i}let Ye=class{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Ri){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Gt.colorSpaceToWorking(this,t),this}setRGB(e,t,n,r=Gt.workingColorSpace){return this.r=e,this.g=t,this.b=n,Gt.colorSpaceToWorking(this,r),this}setHSL(e,t,n,r=Gt.workingColorSpace){if(e=Zx(e,1),t=St(t,0,1),n=St(n,0,1),t===0)this.r=this.g=this.b=n;else{const s=n<=.5?n*(1+t):n+t-n*t,a=2*n-s;this.r=sy(a,s,e+1/3),this.g=sy(a,s,e),this.b=sy(a,s,e-1/3)}return Gt.colorSpaceToWorking(this,r),this}setStyle(e,t=Ri){function n(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const a=r[1],o=r[2];switch(a){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=r[1],a=s.length;if(a===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(a===6)return this.setHex(parseInt(s,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Ri){const n=p2[e.toLowerCase()];return n!==void 0?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=ga(e.r),this.g=ga(e.g),this.b=ga(e.b),this}copyLinearToSRGB(e){return this.r=ru(e.r),this.g=ru(e.g),this.b=ru(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Ri){return Gt.workingToColorSpace(Ai.copy(this),e),Math.round(St(Ai.r*255,0,255))*65536+Math.round(St(Ai.g*255,0,255))*256+Math.round(St(Ai.b*255,0,255))}getHexString(e=Ri){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Gt.workingColorSpace){Gt.workingToColorSpace(Ai.copy(this),t);const n=Ai.r,r=Ai.g,s=Ai.b,a=Math.max(n,r,s),o=Math.min(n,r,s);let l,c;const h=(o+a)/2;if(o===a)l=0,c=0;else{const d=a-o;switch(c=h<=.5?d/(a+o):d/(2-a-o),a){case n:l=(r-s)/d+(r<s?6:0);break;case r:l=(s-n)/d+2;break;case s:l=(n-r)/d+4;break}l/=6}return e.h=l,e.s=c,e.l=h,e}getRGB(e,t=Gt.workingColorSpace){return Gt.workingToColorSpace(Ai.copy(this),t),e.r=Ai.r,e.g=Ai.g,e.b=Ai.b,e}getStyle(e=Ri){Gt.workingToColorSpace(Ai.copy(this),e);const t=Ai.r,n=Ai.g,r=Ai.b;return e!==Ri?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(r*255)})`}offsetHSL(e,t,n){return this.getHSL(Ja),this.setHSL(Ja.h+e,Ja.s+t,Ja.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(Ja),e.getHSL(Qd);const n=cf(Ja.h,Qd.h,t),r=cf(Ja.s,Qd.s,t),s=cf(Ja.l,Qd.l,t);return this.setHSL(n,r,s),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,n=this.g,r=this.b,s=e.elements;return this.r=s[0]*t+s[3]*n+s[6]*r,this.g=s[1]*t+s[4]*n+s[7]*r,this.b=s[2]*t+s[5]*n+s[8]*r,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}};const Ai=new Ye;Ye.NAMES=p2;let TL=0;class Ui extends Us{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:TL++}),this.uuid=_r(),this.name="",this.type="Material",this.blending=bl,this.side=_a,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=vm,this.blendDst=ym,this.blendEquation=ro,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Ye(0,0,0),this.blendAlpha=0,this.depthFunc=Tl,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=q_,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=fl,this.stencilZFail=fl,this.stencilZPass=fl,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const n=e[t];if(n===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const n={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(n.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(n.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==bl&&(n.blending=this.blending),this.side!==_a&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==vm&&(n.blendSrc=this.blendSrc),this.blendDst!==ym&&(n.blendDst=this.blendDst),this.blendEquation!==ro&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==Tl&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==q_&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==fl&&(n.stencilFail=this.stencilFail),this.stencilZFail!==fl&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==fl&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function r(s){const a=[];for(const o in s){const l=s[o];delete l.metadata,a.push(l)}return a}if(t){const s=r(e.textures),a=r(e.images);s.length>0&&(n.textures=s),a.length>0&&(n.images=a)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(t!==null){const r=t.length;n=new Array(r);for(let s=0;s!==r;++s)n[s]=t[s].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class Ma extends Ui{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Ye(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Bi,this.combine=Kf,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const da=AL();function AL(){const i=new ArrayBuffer(4),e=new Float32Array(i),t=new Uint32Array(i),n=new Uint32Array(512),r=new Uint32Array(512);for(let l=0;l<256;++l){const c=l-127;c<-27?(n[l]=0,n[l|256]=32768,r[l]=24,r[l|256]=24):c<-14?(n[l]=1024>>-c-14,n[l|256]=1024>>-c-14|32768,r[l]=-c-1,r[l|256]=-c-1):c<=15?(n[l]=c+15<<10,n[l|256]=c+15<<10|32768,r[l]=13,r[l|256]=13):c<128?(n[l]=31744,n[l|256]=64512,r[l]=24,r[l|256]=24):(n[l]=31744,n[l|256]=64512,r[l]=13,r[l|256]=13)}const s=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let l=1;l<1024;++l){let c=l<<13,h=0;for(;(c&8388608)===0;)c<<=1,h-=8388608;c&=-8388609,h+=947912704,s[l]=c|h}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)a[l]=l<<23;a[31]=1199570944,a[32]=2147483648;for(let l=33;l<63;++l)a[l]=2147483648+(l-32<<23);a[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(o[l]=1024);return{floatView:e,uint32View:t,baseTable:n,shiftTable:r,mantissaTable:s,exponentTable:a,offsetTable:o}}function Zi(i){Math.abs(i)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),i=St(i,-65504,65504),da.floatView[0]=i;const e=da.uint32View[0],t=e>>23&511;return da.baseTable[t]+((e&8388607)>>da.shiftTable[t])}function Yh(i){const e=i>>10;return da.uint32View[0]=da.mantissaTable[da.offsetTable[e]+(i&1023)]+da.exponentTable[e],da.floatView[0]}class CL{static toHalfFloat(e){return Zi(e)}static fromHalfFloat(e){return Yh(e)}}const qn=new j,$d=new ke;let RL=0;class $t{constructor(e,t,n=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:RL++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n,this.usage=Tf,this.updateRanges=[],this.gpuType=Qi,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,s=this.itemSize;r<s;r++)this.array[e+r]=t.array[n+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)$d.fromBufferAttribute(this,t),$d.applyMatrix3(e),this.setXY(t,$d.x,$d.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)qn.fromBufferAttribute(this,t),qn.applyMatrix3(e),this.setXYZ(t,qn.x,qn.y,qn.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)qn.fromBufferAttribute(this,t),qn.applyMatrix4(e),this.setXYZ(t,qn.x,qn.y,qn.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)qn.fromBufferAttribute(this,t),qn.applyNormalMatrix(e),this.setXYZ(t,qn.x,qn.y,qn.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)qn.fromBufferAttribute(this,t),qn.transformDirection(e),this.setXYZ(t,qn.x,qn.y,qn.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=Pi(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Ot(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Pi(t,this.array)),t}setX(e,t){return this.normalized&&(t=Ot(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Pi(t,this.array)),t}setY(e,t){return this.normalized&&(t=Ot(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=Pi(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Ot(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=Pi(t,this.array)),t}setW(e,t){return this.normalized&&(t=Ot(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Ot(t,this.array),n=Ot(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=Ot(t,this.array),n=Ot(n,this.array),r=Ot(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this}setXYZW(e,t,n,r,s){return e*=this.itemSize,this.normalized&&(t=Ot(t,this.array),n=Ot(n,this.array),r=Ot(r,this.array),s=Ot(s,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=s,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==Tf&&(e.usage=this.usage),e}}class DL extends $t{constructor(e,t,n){super(new Int8Array(e),t,n)}}class UL extends $t{constructor(e,t,n){super(new Uint8Array(e),t,n)}}class OL extends $t{constructor(e,t,n){super(new Uint8ClampedArray(e),t,n)}}class LL extends $t{constructor(e,t,n){super(new Int16Array(e),t,n)}}class Jx extends $t{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class IL extends $t{constructor(e,t,n){super(new Int32Array(e),t,n)}}class Qx extends $t{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class NL extends $t{constructor(e,t,n){super(new Uint16Array(e),t,n),this.isFloat16BufferAttribute=!0}getX(e){let t=Yh(this.array[e*this.itemSize]);return this.normalized&&(t=Pi(t,this.array)),t}setX(e,t){return this.normalized&&(t=Ot(t,this.array)),this.array[e*this.itemSize]=Zi(t),this}getY(e){let t=Yh(this.array[e*this.itemSize+1]);return this.normalized&&(t=Pi(t,this.array)),t}setY(e,t){return this.normalized&&(t=Ot(t,this.array)),this.array[e*this.itemSize+1]=Zi(t),this}getZ(e){let t=Yh(this.array[e*this.itemSize+2]);return this.normalized&&(t=Pi(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Ot(t,this.array)),this.array[e*this.itemSize+2]=Zi(t),this}getW(e){let t=Yh(this.array[e*this.itemSize+3]);return this.normalized&&(t=Pi(t,this.array)),t}setW(e,t){return this.normalized&&(t=Ot(t,this.array)),this.array[e*this.itemSize+3]=Zi(t),this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Ot(t,this.array),n=Ot(n,this.array)),this.array[e+0]=Zi(t),this.array[e+1]=Zi(n),this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=Ot(t,this.array),n=Ot(n,this.array),r=Ot(r,this.array)),this.array[e+0]=Zi(t),this.array[e+1]=Zi(n),this.array[e+2]=Zi(r),this}setXYZW(e,t,n,r,s){return e*=this.itemSize,this.normalized&&(t=Ot(t,this.array),n=Ot(n,this.array),r=Ot(r,this.array),s=Ot(s,this.array)),this.array[e+0]=Zi(t),this.array[e+1]=Zi(n),this.array[e+2]=Zi(r),this.array[e+3]=Zi(s),this}}class ft extends $t{constructor(e,t,n){super(new Float32Array(e),t,n)}}let PL=0;const Ur=new bt,ay=new Xt,wc=new j,gr=new Qn,gh=new Qn,ui=new j;class Rt extends Us{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:PL++}),this.uuid=_r(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(h2(e)?Qx:Jx)(e,1):this.index=e,this}setIndirect(e){return this.indirect=e,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(n!==void 0){const s=new At().getNormalMatrix(e);n.applyNormalMatrix(s),n.needsUpdate=!0}const r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return Ur.makeRotationFromQuaternion(e),this.applyMatrix4(Ur),this}rotateX(e){return Ur.makeRotationX(e),this.applyMatrix4(Ur),this}rotateY(e){return Ur.makeRotationY(e),this.applyMatrix4(Ur),this}rotateZ(e){return Ur.makeRotationZ(e),this.applyMatrix4(Ur),this}translate(e,t,n){return Ur.makeTranslation(e,t,n),this.applyMatrix4(Ur),this}scale(e,t,n){return Ur.makeScale(e,t,n),this.applyMatrix4(Ur),this}lookAt(e){return ay.lookAt(e),ay.updateMatrix(),this.applyMatrix4(ay.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(wc).negate(),this.translate(wc.x,wc.y,wc.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const n=[];for(let r=0,s=e.length;r<s;r++){const a=e[r];n.push(a.x,a.y,a.z||0)}this.setAttribute("position",new ft(n,3))}else{const n=Math.min(e.length,t.count);for(let r=0;r<n;r++){const s=e[r];t.setXYZ(r,s.x,s.y,s.z||0)}e.length>t.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Qn);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new j(-1/0,-1/0,-1/0),new j(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,r=t.length;n<r;n++){const s=t[n];gr.setFromBufferAttribute(s),this.morphTargetsRelative?(ui.addVectors(this.boundingBox.min,gr.min),this.boundingBox.expandByPoint(ui),ui.addVectors(this.boundingBox.max,gr.max),this.boundingBox.expandByPoint(ui)):(this.boundingBox.expandByPoint(gr.min),this.boundingBox.expandByPoint(gr.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new ri);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new j,1/0);return}if(e){const n=this.boundingSphere.center;if(gr.setFromBufferAttribute(e),t)for(let s=0,a=t.length;s<a;s++){const o=t[s];gh.setFromBufferAttribute(o),this.morphTargetsRelative?(ui.addVectors(gr.min,gh.min),gr.expandByPoint(ui),ui.addVectors(gr.max,gh.max),gr.expandByPoint(ui)):(gr.expandByPoint(gh.min),gr.expandByPoint(gh.max))}gr.getCenter(n);let r=0;for(let s=0,a=e.count;s<a;s++)ui.fromBufferAttribute(e,s),r=Math.max(r,n.distanceToSquared(ui));if(t)for(let s=0,a=t.length;s<a;s++){const o=t[s],l=this.morphTargetsRelative;for(let c=0,h=o.count;c<h;c++)ui.fromBufferAttribute(o,c),l&&(wc.fromBufferAttribute(e,c),ui.add(wc)),r=Math.max(r,n.distanceToSquared(ui))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const n=t.position,r=t.normal,s=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new $t(new Float32Array(4*n.count),4));const a=this.getAttribute("tangent"),o=[],l=[];for(let U=0;U<n.count;U++)o[U]=new j,l[U]=new j;const c=new j,h=new j,d=new j,p=new ke,m=new ke,v=new ke,x=new j,_=new j;function g(U,A,D){c.fromBufferAttribute(n,U),h.fromBufferAttribute(n,A),d.fromBufferAttribute(n,D),p.fromBufferAttribute(s,U),m.fromBufferAttribute(s,A),v.fromBufferAttribute(s,D),h.sub(c),d.sub(c),m.sub(p),v.sub(p);const L=1/(m.x*v.y-v.x*m.y);isFinite(L)&&(x.copy(h).multiplyScalar(v.y).addScaledVector(d,-m.y).multiplyScalar(L),_.copy(d).multiplyScalar(m.x).addScaledVector(h,-v.x).multiplyScalar(L),o[U].add(x),o[A].add(x),o[D].add(x),l[U].add(_),l[A].add(_),l[D].add(_))}let b=this.groups;b.length===0&&(b=[{start:0,count:e.count}]);for(let U=0,A=b.length;U<A;++U){const D=b[U],L=D.start,P=D.count;for(let I=L,V=L+P;I<V;I+=3)g(e.getX(I+0),e.getX(I+1),e.getX(I+2))}const E=new j,S=new j,w=new j,T=new j;function R(U){w.fromBufferAttribute(r,U),T.copy(w);const A=o[U];E.copy(A),E.sub(w.multiplyScalar(w.dot(A))).normalize(),S.crossVectors(T,A);const L=S.dot(l[U])<0?-1:1;a.setXYZW(U,E.x,E.y,E.z,L)}for(let U=0,A=b.length;U<A;++U){const D=b[U],L=D.start,P=D.count;for(let I=L,V=L+P;I<V;I+=3)R(e.getX(I+0)),R(e.getX(I+1)),R(e.getX(I+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new $t(new Float32Array(t.count*3),3),this.setAttribute("normal",n);else for(let p=0,m=n.count;p<m;p++)n.setXYZ(p,0,0,0);const r=new j,s=new j,a=new j,o=new j,l=new j,c=new j,h=new j,d=new j;if(e)for(let p=0,m=e.count;p<m;p+=3){const v=e.getX(p+0),x=e.getX(p+1),_=e.getX(p+2);r.fromBufferAttribute(t,v),s.fromBufferAttribute(t,x),a.fromBufferAttribute(t,_),h.subVectors(a,s),d.subVectors(r,s),h.cross(d),o.fromBufferAttribute(n,v),l.fromBufferAttribute(n,x),c.fromBufferAttribute(n,_),o.add(h),l.add(h),c.add(h),n.setXYZ(v,o.x,o.y,o.z),n.setXYZ(x,l.x,l.y,l.z),n.setXYZ(_,c.x,c.y,c.z)}else for(let p=0,m=t.count;p<m;p+=3)r.fromBufferAttribute(t,p+0),s.fromBufferAttribute(t,p+1),a.fromBufferAttribute(t,p+2),h.subVectors(a,s),d.subVectors(r,s),h.cross(d),n.setXYZ(p+0,h.x,h.y,h.z),n.setXYZ(p+1,h.x,h.y,h.z),n.setXYZ(p+2,h.x,h.y,h.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)ui.fromBufferAttribute(e,t),ui.normalize(),e.setXYZ(t,ui.x,ui.y,ui.z)}toNonIndexed(){function e(o,l){const c=o.array,h=o.itemSize,d=o.normalized,p=new c.constructor(l.length*h);let m=0,v=0;for(let x=0,_=l.length;x<_;x++){o.isInterleavedBufferAttribute?m=l[x]*o.data.stride+o.offset:m=l[x]*h;for(let g=0;g<h;g++)p[v++]=c[m++]}return new $t(p,h,d)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new Rt,n=this.index.array,r=this.attributes;for(const o in r){const l=r[o],c=e(l,n);t.setAttribute(o,c)}const s=this.morphAttributes;for(const o in s){const l=[],c=s[o];for(let h=0,d=c.length;h<d;h++){const p=c[h],m=e(p,n);l.push(m)}t.morphAttributes[o]=l}t.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let o=0,l=a.length;o<l;o++){const c=a[o];t.addGroup(c.start,c.count,c.materialIndex)}return t}toJSON(){const e={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const l in n){const c=n[l];e.data.attributes[l]=c.toJSON(e.data)}const r={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],h=[];for(let d=0,p=c.length;d<p;d++){const m=c[d];h.push(m.toJSON(e.data))}h.length>0&&(r[l]=h,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return o!==null&&(e.data.boundingSphere=o.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;n!==null&&this.setIndex(n.clone());const r=e.attributes;for(const c in r){const h=r[c];this.setAttribute(c,h.clone(t))}const s=e.morphAttributes;for(const c in s){const h=[],d=s[c];for(let p=0,m=d.length;p<m;p++)h.push(d[p].clone(t));this.morphAttributes[c]=h}this.morphTargetsRelative=e.morphTargetsRelative;const a=e.groups;for(let c=0,h=a.length;c<h;c++){const d=a[c];this.addGroup(d.start,d.count,d.materialIndex)}const o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());const l=e.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const uE=new bt,Zo=new Au,ep=new ri,hE=new j,tp=new j,np=new j,ip=new j,oy=new j,rp=new j,fE=new j,sp=new j;class mn extends Xt{constructor(e=new Rt,t=new Ma){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const r=t[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=r.length;s<a;s++){const o=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}getVertexPosition(e,t){const n=this.geometry,r=n.attributes.position,s=n.morphAttributes.position,a=n.morphTargetsRelative;t.fromBufferAttribute(r,e);const o=this.morphTargetInfluences;if(s&&o){rp.set(0,0,0);for(let l=0,c=s.length;l<c;l++){const h=o[l],d=s[l];h!==0&&(oy.fromBufferAttribute(d,e),a?rp.addScaledVector(oy,h):rp.addScaledVector(oy.sub(t),h))}t.add(rp)}return t}raycast(e,t){const n=this.geometry,r=this.material,s=this.matrixWorld;r!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),ep.copy(n.boundingSphere),ep.applyMatrix4(s),Zo.copy(e.ray).recast(e.near),!(ep.containsPoint(Zo.origin)===!1&&(Zo.intersectSphere(ep,hE)===null||Zo.origin.distanceToSquared(hE)>(e.far-e.near)**2))&&(uE.copy(s).invert(),Zo.copy(e.ray).applyMatrix4(uE),!(n.boundingBox!==null&&Zo.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,Zo)))}_computeIntersections(e,t,n){let r;const s=this.geometry,a=this.material,o=s.index,l=s.attributes.position,c=s.attributes.uv,h=s.attributes.uv1,d=s.attributes.normal,p=s.groups,m=s.drawRange;if(o!==null)if(Array.isArray(a))for(let v=0,x=p.length;v<x;v++){const _=p[v],g=a[_.materialIndex],b=Math.max(_.start,m.start),E=Math.min(o.count,Math.min(_.start+_.count,m.start+m.count));for(let S=b,w=E;S<w;S+=3){const T=o.getX(S),R=o.getX(S+1),U=o.getX(S+2);r=ap(this,g,e,n,c,h,d,T,R,U),r&&(r.faceIndex=Math.floor(S/3),r.face.materialIndex=_.materialIndex,t.push(r))}}else{const v=Math.max(0,m.start),x=Math.min(o.count,m.start+m.count);for(let _=v,g=x;_<g;_+=3){const b=o.getX(_),E=o.getX(_+1),S=o.getX(_+2);r=ap(this,a,e,n,c,h,d,b,E,S),r&&(r.faceIndex=Math.floor(_/3),t.push(r))}}else if(l!==void 0)if(Array.isArray(a))for(let v=0,x=p.length;v<x;v++){const _=p[v],g=a[_.materialIndex],b=Math.max(_.start,m.start),E=Math.min(l.count,Math.min(_.start+_.count,m.start+m.count));for(let S=b,w=E;S<w;S+=3){const T=S,R=S+1,U=S+2;r=ap(this,g,e,n,c,h,d,T,R,U),r&&(r.faceIndex=Math.floor(S/3),r.face.materialIndex=_.materialIndex,t.push(r))}}else{const v=Math.max(0,m.start),x=Math.min(l.count,m.start+m.count);for(let _=v,g=x;_<g;_+=3){const b=_,E=_+1,S=_+2;r=ap(this,a,e,n,c,h,d,b,E,S),r&&(r.faceIndex=Math.floor(_/3),t.push(r))}}}}function zL(i,e,t,n,r,s,a,o){let l;if(e.side===Fi?l=n.intersectTriangle(a,s,r,!0,o):l=n.intersectTriangle(r,s,a,e.side===_a,o),l===null)return null;sp.copy(o),sp.applyMatrix4(i.matrixWorld);const c=t.ray.origin.distanceTo(sp);return c<t.near||c>t.far?null:{distance:c,point:sp.clone(),object:i}}function ap(i,e,t,n,r,s,a,o,l,c){i.getVertexPosition(o,tp),i.getVertexPosition(l,np),i.getVertexPosition(c,ip);const h=zL(i,e,t,n,tp,np,ip,fE);if(h){const d=new j;Ji.getBarycoord(fE,tp,np,ip,d),r&&(h.uv=Ji.getInterpolatedAttribute(r,o,l,c,d,new ke)),s&&(h.uv1=Ji.getInterpolatedAttribute(s,o,l,c,d,new ke)),a&&(h.normal=Ji.getInterpolatedAttribute(a,o,l,c,d,new j),h.normal.dot(n.direction)>0&&h.normal.multiplyScalar(-1));const p={a:o,b:l,c,normal:new j,materialIndex:0};Ji.getNormal(tp,np,ip,p.normal),h.face=p,h.barycoord=d}return h}class vo extends Rt{constructor(e=1,t=1,n=1,r=1,s=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:s,depthSegments:a};const o=this;r=Math.floor(r),s=Math.floor(s),a=Math.floor(a);const l=[],c=[],h=[],d=[];let p=0,m=0;v("z","y","x",-1,-1,n,t,e,a,s,0),v("z","y","x",1,-1,n,t,-e,a,s,1),v("x","z","y",1,1,e,n,t,r,a,2),v("x","z","y",1,-1,e,n,-t,r,a,3),v("x","y","z",1,-1,e,t,n,r,s,4),v("x","y","z",-1,-1,e,t,-n,r,s,5),this.setIndex(l),this.setAttribute("position",new ft(c,3)),this.setAttribute("normal",new ft(h,3)),this.setAttribute("uv",new ft(d,2));function v(x,_,g,b,E,S,w,T,R,U,A){const D=S/R,L=w/U,P=S/2,I=w/2,V=T/2,H=R+1,z=U+1;let O=0,B=0;const G=new j;for(let X=0;X<z;X++){const k=X*L-I;for(let Y=0;Y<H;Y++){const Q=Y*D-P;G[x]=Q*b,G[_]=k*E,G[g]=V,c.push(G.x,G.y,G.z),G[x]=0,G[_]=0,G[g]=T>0?1:-1,h.push(G.x,G.y,G.z),d.push(Y/R),d.push(1-X/U),O+=1}}for(let X=0;X<U;X++)for(let k=0;k<R;k++){const Y=p+k+H*X,Q=p+k+H*(X+1),te=p+(k+1)+H*(X+1),ee=p+(k+1)+H*X;l.push(Y,Q,ee),l.push(Q,te,ee),B+=6}o.addGroup(m,B,A),m+=B,p+=O}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new vo(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function mu(i){const e={};for(const t in i){e[t]={};for(const n in i[t]){const r=i[t][n];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][n]=null):e[t][n]=r.clone():Array.isArray(r)?e[t][n]=r.slice():e[t][n]=r}}return e}function Ni(i){const e={};for(let t=0;t<i.length;t++){const n=mu(i[t]);for(const r in n)e[r]=n[r]}return e}function FL(i){const e=[];for(let t=0;t<i.length;t++)e.push(i[t].clone());return e}function m2(i){const e=i.getRenderTarget();return e===null?i.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:Gt.workingColorSpace}const $x={clone:mu,merge:Ni};var BL=`void main() {
|
|
1
|
+
import{b4 as bA,b5 as GU,aQ as mo,b6 as HU,b7 as Ms,r as K,j as he,b8 as VU,u as wg,t as WU,F as Yn,aj as XU,B as Lr,b9 as jU,ba as qU,f as YU,bb as ZU,bc as KU,bd as JU,be as QU,bf as $U,bg as eO,at as iu,bh as tO,bi as nO,bj as iO,Z as rO,bk as kv,a as sO,D as aO,m as qS,aB as YS}from"./index-DiJ--4jy.js";import{m as oO}from"./merge-i-jf8qHe.js";import{_ as Zf}from"./extends-CF3RwP-h.js";import{g as lO,a as cO}from"./index-Ylx8hT_m.js";import{E as xl,Z as hi,N as im,c as fh}from"./index-Bs7zcW7e.js";import"./envs-CSqIi4cL.js";import"./isObjectLike-DD38kuct.js";import"./isObject--vsEa_js.js";var Gv={exports:{}},$s={};var ZS;function uO(){return ZS||(ZS=1,$s.ConcurrentRoot=1,$s.ContinuousEventPriority=8,$s.DefaultEventPriority=32,$s.DiscreteEventPriority=2,$s.IdleEventPriority=268435456,$s.LegacyRoot=0,$s.NoEventPriority=0),$s}var KS;function hO(){return KS||(KS=1,Gv.exports=uO()),Gv.exports}var rm=hO();const Tg="180",SA={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},fO={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},EA=0,H_=1,MA=2,dO=3,wA=0,Ag=1,nf=2,is=3,_a=0,Fi=1,zn=2,ma=0,bl=1,V_=2,W_=3,X_=4,TA=5,ro=100,AA=101,CA=102,RA=103,DA=104,UA=200,OA=201,LA=202,IA=203,vm=204,ym=205,NA=206,PA=207,zA=208,FA=209,BA=210,kA=211,GA=212,HA=213,VA=214,_m=0,xm=1,bm=2,Tl=3,Sm=4,Em=5,Mm=6,wm=7,Kf=0,WA=1,XA=2,As=0,jA=1,qA=2,YA=3,zx=4,ZA=5,KA=6,JA=7,j_="attached",QA="detached",Cg=300,xa=301,uo=302,_f=303,xf=304,wu=306,bf=1e3,Fr=1001,Sf=1002,vi=1003,Fx=1004,pO=1004,Qc=1005,mO=1005,Fn=1006,rf=1007,gO=1007,ws=1008,vO=1008,Gr=1009,Bx=1010,kx=1011,lu=1012,Rg=1013,ba=1014,Qi=1015,Tu=1016,Dg=1017,Ug=1018,cu=1020,Gx=35902,Hx=35899,Vx=1021,Wx=1022,Di=1023,uu=1026,hu=1027,Og=1028,Jf=1029,Xx=1030,Lg=1031,yO=1032,Ig=1033,sf=33776,af=33777,of=33778,lf=33779,Tm=35840,Am=35841,Cm=35842,Rm=35843,Dm=36196,Um=37492,Om=37496,Lm=37808,Im=37809,Nm=37810,Pm=37811,zm=37812,Fm=37813,Bm=37814,km=37815,Gm=37816,Hm=37817,Vm=37818,Wm=37819,Xm=37820,jm=37821,qm=36492,Ym=36494,Zm=36495,Km=36283,Jm=36284,Qm=36285,$m=36286,$A=2200,e2=2201,t2=2202,Ef=2300,eg=2301,sm=2302,gl=2400,vl=2401,Mf=2402,Ng=2500,jx=2501,_O=0,xO=1,bO=2,n2=3200,qx=3201,SO=3202,EO=3203,go=0,i2=1,fa="",Ri="srgb",ho="srgb-linear",wf="linear",an="srgb",MO=0,fl=7680,wO=7681,TO=7682,AO=7683,CO=34055,RO=34056,DO=5386,UO=512,OO=513,LO=514,IO=515,NO=516,PO=517,zO=518,q_=519,r2=512,s2=513,a2=514,Yx=515,o2=516,l2=517,c2=518,u2=519,Tf=35044,FO=35048,BO=35040,kO=35045,GO=35049,HO=35041,VO=35046,WO=35050,XO=35042,jO="100",Y_="300 es",yr=2e3,fu=2001,qO={COMPUTE:"compute",RENDER:"render"},YO={PERSPECTIVE:"perspective",LINEAR:"linear",FLAT:"flat"},ZO={NORMAL:"normal",CENTROID:"centroid",SAMPLE:"sample",FIRST:"first",EITHER:"either"};let Us=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){const n=this._listeners;return n===void 0?!1:n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){const n=this._listeners;if(n===void 0)return;const r=n[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const n=t[e.type];if(n!==void 0){e.target=this;const r=n.slice(0);for(let s=0,a=r.length;s<a;s++)r[s].call(this,e);e.target=null}}};const Ti=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let JS=1234567;const Sl=Math.PI/180,du=180/Math.PI;function _r(){const i=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(Ti[i&255]+Ti[i>>8&255]+Ti[i>>16&255]+Ti[i>>24&255]+"-"+Ti[e&255]+Ti[e>>8&255]+"-"+Ti[e>>16&15|64]+Ti[e>>24&255]+"-"+Ti[t&63|128]+Ti[t>>8&255]+"-"+Ti[t>>16&255]+Ti[t>>24&255]+Ti[n&255]+Ti[n>>8&255]+Ti[n>>16&255]+Ti[n>>24&255]).toLowerCase()}function St(i,e,t){return Math.max(e,Math.min(t,i))}function Zx(i,e){return(i%e+e)%e}function KO(i,e,t,n,r){return n+(i-e)*(r-n)/(t-e)}function JO(i,e,t){return i!==e?(t-i)/(e-i):0}function cf(i,e,t){return(1-t)*i+t*e}function QO(i,e,t,n){return cf(i,e,1-Math.exp(-t*n))}function $O(i,e=1){return e-Math.abs(Zx(i,e*2)-e)}function eL(i,e,t){return i<=e?0:i>=t?1:(i=(i-e)/(t-e),i*i*(3-2*i))}function tL(i,e,t){return i<=e?0:i>=t?1:(i=(i-e)/(t-e),i*i*i*(i*(i*6-15)+10))}function nL(i,e){return i+Math.floor(Math.random()*(e-i+1))}function iL(i,e){return i+Math.random()*(e-i)}function rL(i){return i*(.5-Math.random())}function sL(i){i!==void 0&&(JS=i);let e=JS+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function aL(i){return i*Sl}function oL(i){return i*du}function lL(i){return(i&i-1)===0&&i!==0}function cL(i){return Math.pow(2,Math.ceil(Math.log(i)/Math.LN2))}function uL(i){return Math.pow(2,Math.floor(Math.log(i)/Math.LN2))}function hL(i,e,t,n,r){const s=Math.cos,a=Math.sin,o=s(t/2),l=a(t/2),c=s((e+n)/2),h=a((e+n)/2),d=s((e-n)/2),p=a((e-n)/2),m=s((n-e)/2),v=a((n-e)/2);switch(r){case"XYX":i.set(o*h,l*d,l*p,o*c);break;case"YZY":i.set(l*p,o*h,l*d,o*c);break;case"ZXZ":i.set(l*d,l*p,o*h,o*c);break;case"XZX":i.set(o*h,l*v,l*m,o*c);break;case"YXY":i.set(l*m,o*h,l*v,o*c);break;case"ZYZ":i.set(l*v,l*m,o*h,o*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function Pi(i,e){switch(e.constructor){case Float32Array:return i;case Uint32Array:return i/4294967295;case Uint16Array:return i/65535;case Uint8Array:return i/255;case Int32Array:return Math.max(i/2147483647,-1);case Int16Array:return Math.max(i/32767,-1);case Int8Array:return Math.max(i/127,-1);default:throw new Error("Invalid component type.")}}function Ot(i,e){switch(e.constructor){case Float32Array:return i;case Uint32Array:return Math.round(i*4294967295);case Uint16Array:return Math.round(i*65535);case Uint8Array:return Math.round(i*255);case Int32Array:return Math.round(i*2147483647);case Int16Array:return Math.round(i*32767);case Int8Array:return Math.round(i*127);default:throw new Error("Invalid component type.")}}const tg={DEG2RAD:Sl,RAD2DEG:du,generateUUID:_r,clamp:St,euclideanModulo:Zx,mapLinear:KO,inverseLerp:JO,lerp:cf,damp:QO,pingpong:$O,smoothstep:eL,smootherstep:tL,randInt:nL,randFloat:iL,randFloatSpread:rL,seededRandom:sL,degToRad:aL,radToDeg:oL,isPowerOfTwo:lL,ceilPowerOfTwo:cL,floorPowerOfTwo:uL,setQuaternionFromProperEuler:hL,normalize:Ot,denormalize:Pi};class ke{constructor(e=0,t=0){ke.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=St(this.x,e.x,t.x),this.y=St(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=St(this.x,e,t),this.y=St(this.y,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(St(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(St(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),r=Math.sin(t),s=this.x-e.x,a=this.y-e.y;return this.x=s*n-a*r+e.x,this.y=s*r+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class yi{constructor(e=0,t=0,n=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}static slerpFlat(e,t,n,r,s,a,o){let l=n[r+0],c=n[r+1],h=n[r+2],d=n[r+3];const p=s[a+0],m=s[a+1],v=s[a+2],x=s[a+3];if(o===0){e[t+0]=l,e[t+1]=c,e[t+2]=h,e[t+3]=d;return}if(o===1){e[t+0]=p,e[t+1]=m,e[t+2]=v,e[t+3]=x;return}if(d!==x||l!==p||c!==m||h!==v){let _=1-o;const g=l*p+c*m+h*v+d*x,b=g>=0?1:-1,E=1-g*g;if(E>Number.EPSILON){const w=Math.sqrt(E),T=Math.atan2(w,g*b);_=Math.sin(_*T)/w,o=Math.sin(o*T)/w}const S=o*b;if(l=l*_+p*S,c=c*_+m*S,h=h*_+v*S,d=d*_+x*S,_===1-o){const w=1/Math.sqrt(l*l+c*c+h*h+d*d);l*=w,c*=w,h*=w,d*=w}}e[t]=l,e[t+1]=c,e[t+2]=h,e[t+3]=d}static multiplyQuaternionsFlat(e,t,n,r,s,a){const o=n[r],l=n[r+1],c=n[r+2],h=n[r+3],d=s[a],p=s[a+1],m=s[a+2],v=s[a+3];return e[t]=o*v+h*d+l*m-c*p,e[t+1]=l*v+h*p+c*d-o*m,e[t+2]=c*v+h*m+o*p-l*d,e[t+3]=h*v-o*d-l*p-c*m,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const n=e._x,r=e._y,s=e._z,a=e._order,o=Math.cos,l=Math.sin,c=o(n/2),h=o(r/2),d=o(s/2),p=l(n/2),m=l(r/2),v=l(s/2);switch(a){case"XYZ":this._x=p*h*d+c*m*v,this._y=c*m*d-p*h*v,this._z=c*h*v+p*m*d,this._w=c*h*d-p*m*v;break;case"YXZ":this._x=p*h*d+c*m*v,this._y=c*m*d-p*h*v,this._z=c*h*v-p*m*d,this._w=c*h*d+p*m*v;break;case"ZXY":this._x=p*h*d-c*m*v,this._y=c*m*d+p*h*v,this._z=c*h*v+p*m*d,this._w=c*h*d-p*m*v;break;case"ZYX":this._x=p*h*d-c*m*v,this._y=c*m*d+p*h*v,this._z=c*h*v-p*m*d,this._w=c*h*d+p*m*v;break;case"YZX":this._x=p*h*d+c*m*v,this._y=c*m*d+p*h*v,this._z=c*h*v-p*m*d,this._w=c*h*d-p*m*v;break;case"XZY":this._x=p*h*d-c*m*v,this._y=c*m*d-p*h*v,this._z=c*h*v+p*m*d,this._w=c*h*d+p*m*v;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],r=t[4],s=t[8],a=t[1],o=t[5],l=t[9],c=t[2],h=t[6],d=t[10],p=n+o+d;if(p>0){const m=.5/Math.sqrt(p+1);this._w=.25/m,this._x=(h-l)*m,this._y=(s-c)*m,this._z=(a-r)*m}else if(n>o&&n>d){const m=2*Math.sqrt(1+n-o-d);this._w=(h-l)/m,this._x=.25*m,this._y=(r+a)/m,this._z=(s+c)/m}else if(o>d){const m=2*Math.sqrt(1+o-n-d);this._w=(s-c)/m,this._x=(r+a)/m,this._y=.25*m,this._z=(l+h)/m}else{const m=2*Math.sqrt(1+d-n-o);this._w=(a-r)/m,this._x=(s+c)/m,this._y=(l+h)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-8?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(St(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const r=Math.min(1,t/n);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,r=e._y,s=e._z,a=e._w,o=t._x,l=t._y,c=t._z,h=t._w;return this._x=n*h+a*o+r*c-s*l,this._y=r*h+a*l+s*o-n*c,this._z=s*h+a*c+n*l-r*o,this._w=a*h-n*o-r*l-s*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const n=this._x,r=this._y,s=this._z,a=this._w;let o=a*e._w+n*e._x+r*e._y+s*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=n,this._y=r,this._z=s,this;const l=1-o*o;if(l<=Number.EPSILON){const m=1-t;return this._w=m*a+t*this._w,this._x=m*n+t*this._x,this._y=m*r+t*this._y,this._z=m*s+t*this._z,this.normalize(),this}const c=Math.sqrt(l),h=Math.atan2(c,o),d=Math.sin((1-t)*h)/c,p=Math.sin(t*h)/c;return this._w=a*d+this._w*p,this._x=n*d+this._x*p,this._y=r*d+this._y*p,this._z=s*d+this._z*p,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),s=Math.sqrt(n);return this.set(r*Math.sin(e),r*Math.cos(e),s*Math.sin(t),s*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class j{constructor(e=0,t=0,n=0){j.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(QS.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(QS.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*r,this.y=s[1]*t+s[4]*n+s[7]*r,this.z=s[2]*t+s[5]*n+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,s=e.elements,a=1/(s[3]*t+s[7]*n+s[11]*r+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*r+s[12])*a,this.y=(s[1]*t+s[5]*n+s[9]*r+s[13])*a,this.z=(s[2]*t+s[6]*n+s[10]*r+s[14])*a,this}applyQuaternion(e){const t=this.x,n=this.y,r=this.z,s=e.x,a=e.y,o=e.z,l=e.w,c=2*(a*r-o*n),h=2*(o*t-s*r),d=2*(s*n-a*t);return this.x=t+l*c+a*d-o*h,this.y=n+l*h+o*c-s*d,this.z=r+l*d+s*h-a*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*r,this.y=s[1]*t+s[5]*n+s[9]*r,this.z=s[2]*t+s[6]*n+s[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=St(this.x,e.x,t.x),this.y=St(this.y,e.y,t.y),this.z=St(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=St(this.x,e,t),this.y=St(this.y,e,t),this.z=St(this.z,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(St(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,r=e.y,s=e.z,a=t.x,o=t.y,l=t.z;return this.x=r*l-s*o,this.y=s*a-n*l,this.z=n*o-r*a,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return Hv.copy(this).projectOnVector(e),this.sub(Hv)}reflect(e){return this.sub(Hv.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(St(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Hv=new j,QS=new yi;class At{constructor(e,t,n,r,s,a,o,l,c){At.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,r,s,a,o,l,c)}set(e,t,n,r,s,a,o,l,c){const h=this.elements;return h[0]=e,h[1]=r,h[2]=o,h[3]=t,h[4]=s,h[5]=l,h[6]=n,h[7]=a,h[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,s=this.elements,a=n[0],o=n[3],l=n[6],c=n[1],h=n[4],d=n[7],p=n[2],m=n[5],v=n[8],x=r[0],_=r[3],g=r[6],b=r[1],E=r[4],S=r[7],w=r[2],T=r[5],R=r[8];return s[0]=a*x+o*b+l*w,s[3]=a*_+o*E+l*T,s[6]=a*g+o*S+l*R,s[1]=c*x+h*b+d*w,s[4]=c*_+h*E+d*T,s[7]=c*g+h*S+d*R,s[2]=p*x+m*b+v*w,s[5]=p*_+m*E+v*T,s[8]=p*g+m*S+v*R,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],r=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8];return t*a*h-t*o*c-n*s*h+n*o*l+r*s*c-r*a*l}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8],d=h*a-o*c,p=o*l-h*s,m=c*s-a*l,v=t*d+n*p+r*m;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);const x=1/v;return e[0]=d*x,e[1]=(r*c-h*n)*x,e[2]=(o*n-r*a)*x,e[3]=p*x,e[4]=(h*t-r*l)*x,e[5]=(r*s-o*t)*x,e[6]=m*x,e[7]=(n*l-c*t)*x,e[8]=(a*t-n*s)*x,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,r,s,a,o){const l=Math.cos(s),c=Math.sin(s);return this.set(n*l,n*c,-n*(l*a+c*o)+a+e,-r*c,r*l,-r*(-c*a+l*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(Vv.makeScale(e,t)),this}rotate(e){return this.premultiply(Vv.makeRotation(-e)),this}translate(e,t){return this.premultiply(Vv.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let r=0;r<9;r++)if(t[r]!==n[r])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const Vv=new At;function h2(i){for(let e=i.length-1;e>=0;--e)if(i[e]>=65535)return!0;return!1}const fL={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function $c(i,e){return new fL[i](e)}function Af(i){return document.createElementNS("http://www.w3.org/1999/xhtml",i)}function f2(){const i=Af("canvas");return i.style.display="block",i}const $S={};function Cf(i){i in $S||($S[i]=!0,console.warn(i))}function dL(i,e,t){return new Promise(function(n,r){function s(){switch(i.clientWaitSync(e,i.SYNC_FLUSH_COMMANDS_BIT,0)){case i.WAIT_FAILED:r();break;case i.TIMEOUT_EXPIRED:setTimeout(s,t);break;default:n()}}setTimeout(s,t)})}const eE=new At().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),tE=new At().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function pL(){const i={enabled:!0,workingColorSpace:ho,spaces:{},convert:function(r,s,a){return this.enabled===!1||s===a||!s||!a||(this.spaces[s].transfer===an&&(r.r=ga(r.r),r.g=ga(r.g),r.b=ga(r.b)),this.spaces[s].primaries!==this.spaces[a].primaries&&(r.applyMatrix3(this.spaces[s].toXYZ),r.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===an&&(r.r=ru(r.r),r.g=ru(r.g),r.b=ru(r.b))),r},workingToColorSpace:function(r,s){return this.convert(r,this.workingColorSpace,s)},colorSpaceToWorking:function(r,s){return this.convert(r,s,this.workingColorSpace)},getPrimaries:function(r){return this.spaces[r].primaries},getTransfer:function(r){return r===fa?wf:this.spaces[r].transfer},getToneMappingMode:function(r){return this.spaces[r].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(r,s=this.workingColorSpace){return r.fromArray(this.spaces[s].luminanceCoefficients)},define:function(r){Object.assign(this.spaces,r)},_getMatrix:function(r,s,a){return r.copy(this.spaces[s].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(r){return this.spaces[r].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(r=this.workingColorSpace){return this.spaces[r].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(r,s){return Cf("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),i.workingToColorSpace(r,s)},toWorkingColorSpace:function(r,s){return Cf("THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),i.colorSpaceToWorking(r,s)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],n=[.3127,.329];return i.define({[ho]:{primaries:e,whitePoint:n,transfer:wf,toXYZ:eE,fromXYZ:tE,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:Ri},outputColorSpaceConfig:{drawingBufferColorSpace:Ri}},[Ri]:{primaries:e,whitePoint:n,transfer:an,toXYZ:eE,fromXYZ:tE,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:Ri}}}),i}const Gt=pL();function ga(i){return i<.04045?i*.0773993808:Math.pow(i*.9478672986+.0521327014,2.4)}function ru(i){return i<.0031308?i*12.92:1.055*Math.pow(i,.41666)-.055}let gc;class d2{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{gc===void 0&&(gc=Af("canvas")),gc.width=e.width,gc.height=e.height;const r=gc.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),n=gc}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=Af("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const r=n.getImageData(0,0,e.width,e.height),s=r.data;for(let a=0;a<s.length;a++)s[a]=ga(s[a]/255)*255;return n.putImageData(r,0,0),t}else if(e.data){const t=e.data.slice(0);for(let n=0;n<t.length;n++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[n]=Math.floor(ga(t[n]/255)*255):t[n]=ga(t[n]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let mL=0;class so{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:mL++}),this.uuid=_r(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const t=this.data;return typeof HTMLVideoElement<"u"&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):t instanceof VideoFrame?e.set(t.displayHeight,t.displayWidth,0):t!==null?e.set(t.width,t.height,t.depth||0):e.set(0,0,0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const n={uuid:this.uuid,url:""},r=this.data;if(r!==null){let s;if(Array.isArray(r)){s=[];for(let a=0,o=r.length;a<o;a++)r[a].isDataTexture?s.push(Wv(r[a].image)):s.push(Wv(r[a]))}else s=Wv(r);n.url=s}return t||(e.images[this.uuid]=n),n}}function Wv(i){return typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&i instanceof ImageBitmap?d2.getDataURL(i):i.data?{data:Array.from(i.data),width:i.width,height:i.height,type:i.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let gL=0;const Xv=new j;class Dn extends Us{constructor(e=Dn.DEFAULT_IMAGE,t=Dn.DEFAULT_MAPPING,n=Fr,r=Fr,s=Fn,a=ws,o=Di,l=Gr,c=Dn.DEFAULT_ANISOTROPY,h=fa){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:gL++}),this.uuid=_r(),this.name="",this.source=new so(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=r,this.magFilter=s,this.minFilter=a,this.anisotropy=c,this.format=o,this.internalFormat=null,this.type=l,this.offset=new ke(0,0),this.repeat=new ke(1,1),this.center=new ke(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new At,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=h,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0}get width(){return this.source.getSize(Xv).x}get height(){return this.source.getSize(Xv).y}get depth(){return this.source.getSize(Xv).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const t in e){const n=e[t];if(n===void 0){console.warn(`THREE.Texture.setValues(): parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){console.warn(`THREE.Texture.setValues(): property '${t}' does not exist.`);continue}r&&n&&r.isVector2&&n.isVector2||r&&n&&r.isVector3&&n.isVector3||r&&n&&r.isMatrix3&&n.isMatrix3?r.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const n={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Cg)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case bf:e.x=e.x-Math.floor(e.x);break;case Fr:e.x=e.x<0?0:1;break;case Sf:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case bf:e.y=e.y-Math.floor(e.y);break;case Fr:e.y=e.y<0?0:1;break;case Sf:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}Dn.DEFAULT_IMAGE=null;Dn.DEFAULT_MAPPING=Cg;Dn.DEFAULT_ANISOTROPY=1;class Bt{constructor(e=0,t=0,n=0,r=1){Bt.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,s=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*s,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*s,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*s,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*s,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,r,s;const l=e.elements,c=l[0],h=l[4],d=l[8],p=l[1],m=l[5],v=l[9],x=l[2],_=l[6],g=l[10];if(Math.abs(h-p)<.01&&Math.abs(d-x)<.01&&Math.abs(v-_)<.01){if(Math.abs(h+p)<.1&&Math.abs(d+x)<.1&&Math.abs(v+_)<.1&&Math.abs(c+m+g-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const E=(c+1)/2,S=(m+1)/2,w=(g+1)/2,T=(h+p)/4,R=(d+x)/4,U=(v+_)/4;return E>S&&E>w?E<.01?(n=0,r=.707106781,s=.707106781):(n=Math.sqrt(E),r=T/n,s=R/n):S>w?S<.01?(n=.707106781,r=0,s=.707106781):(r=Math.sqrt(S),n=T/r,s=U/r):w<.01?(n=.707106781,r=.707106781,s=0):(s=Math.sqrt(w),n=R/s,r=U/s),this.set(n,r,s,t),this}let b=Math.sqrt((_-v)*(_-v)+(d-x)*(d-x)+(p-h)*(p-h));return Math.abs(b)<.001&&(b=1),this.x=(_-v)/b,this.y=(d-x)/b,this.z=(p-h)/b,this.w=Math.acos((c+m+g-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=St(this.x,e.x,t.x),this.y=St(this.y,e.y,t.y),this.z=St(this.z,e.z,t.z),this.w=St(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=St(this.x,e,t),this.y=St(this.y,e,t),this.z=St(this.z,e,t),this.w=St(this.w,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(St(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class Kx extends Us{constructor(e=1,t=1,n={}){super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Fn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},n),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=n.depth,this.scissor=new Bt(0,0,e,t),this.scissorTest=!1,this.viewport=new Bt(0,0,e,t);const r={width:e,height:t,depth:n.depth},s=new Dn(r);this.textures=[];const a=n.count;for(let o=0;o<a;o++)this.textures[o]=s.clone(),this.textures[o].isRenderTargetTexture=!0,this.textures[o].renderTarget=this;this._setTextureOptions(n),this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=n.depthTexture,this.samples=n.samples,this.multiview=n.multiview}_setTextureOptions(e={}){const t={minFilter:Fn,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(t.mapping=e.mapping),e.wrapS!==void 0&&(t.wrapS=e.wrapS),e.wrapT!==void 0&&(t.wrapT=e.wrapT),e.wrapR!==void 0&&(t.wrapR=e.wrapR),e.magFilter!==void 0&&(t.magFilter=e.magFilter),e.minFilter!==void 0&&(t.minFilter=e.minFilter),e.format!==void 0&&(t.format=e.format),e.type!==void 0&&(t.type=e.type),e.anisotropy!==void 0&&(t.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(t.colorSpace=e.colorSpace),e.flipY!==void 0&&(t.flipY=e.flipY),e.generateMipmaps!==void 0&&(t.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(t.internalFormat=e.internalFormat);for(let n=0;n<this.textures.length;n++)this.textures[n].setValues(t)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let r=0,s=this.textures.length;r<s;r++)this.textures[r].image.width=e,this.textures[r].image.height=t,this.textures[r].image.depth=n,this.textures[r].isArrayTexture=this.textures[r].image.depth>1;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,n=e.textures.length;t<n;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;const r=Object.assign({},e.textures[t].image);this.textures[t].source=new so(r)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Ds extends Kx{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class Pg extends Dn{constructor(e=null,t=1,n=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=vi,this.minFilter=vi,this.wrapR=Fr,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class vL extends Ds{constructor(e=1,t=1,n=1,r={}){super(e,t,r),this.isWebGLArrayRenderTarget=!0,this.depth=n,this.texture=new Pg(null,e,t,n),this._setTextureOptions(r),this.texture.isRenderTargetTexture=!0}}class zg extends Dn{constructor(e=null,t=1,n=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=vi,this.minFilter=vi,this.wrapR=Fr,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class yL extends Ds{constructor(e=1,t=1,n=1,r={}){super(e,t,r),this.isWebGL3DRenderTarget=!0,this.depth=n,this.texture=new zg(null,e,t,n),this._setTextureOptions(r),this.texture.isRenderTargetTexture=!0}}class Qn{constructor(e=new j(1/0,1/0,1/0),t=new j(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(Kr.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(Kr.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=Kr.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const n=e.geometry;if(n!==void 0){const s=n.getAttribute("position");if(t===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let a=0,o=s.count;a<o;a++)e.isMesh===!0?e.getVertexPosition(a,Kr):Kr.fromBufferAttribute(s,a),Kr.applyMatrix4(e.matrixWorld),this.expandByPoint(Kr);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),Xd.copy(e.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),Xd.copy(n.boundingBox)),Xd.applyMatrix4(e.matrixWorld),this.union(Xd)}const r=e.children;for(let s=0,a=r.length;s<a;s++)this.expandByObject(r[s],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,Kr),Kr.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(dh),jd.subVectors(this.max,dh),vc.subVectors(e.a,dh),yc.subVectors(e.b,dh),_c.subVectors(e.c,dh),qa.subVectors(yc,vc),Ya.subVectors(_c,yc),qo.subVectors(vc,_c);let t=[0,-qa.z,qa.y,0,-Ya.z,Ya.y,0,-qo.z,qo.y,qa.z,0,-qa.x,Ya.z,0,-Ya.x,qo.z,0,-qo.x,-qa.y,qa.x,0,-Ya.y,Ya.x,0,-qo.y,qo.x,0];return!jv(t,vc,yc,_c,jd)||(t=[1,0,0,0,1,0,0,0,1],!jv(t,vc,yc,_c,jd))?!1:(qd.crossVectors(qa,Ya),t=[qd.x,qd.y,qd.z],jv(t,vc,yc,_c,jd))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Kr).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Kr).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(ea[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),ea[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),ea[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),ea[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),ea[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),ea[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),ea[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),ea[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(ea),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const ea=[new j,new j,new j,new j,new j,new j,new j,new j],Kr=new j,Xd=new Qn,vc=new j,yc=new j,_c=new j,qa=new j,Ya=new j,qo=new j,dh=new j,jd=new j,qd=new j,Yo=new j;function jv(i,e,t,n,r){for(let s=0,a=i.length-3;s<=a;s+=3){Yo.fromArray(i,s);const o=r.x*Math.abs(Yo.x)+r.y*Math.abs(Yo.y)+r.z*Math.abs(Yo.z),l=e.dot(Yo),c=t.dot(Yo),h=n.dot(Yo);if(Math.max(-Math.max(l,c,h),Math.min(l,c,h))>o)return!1}return!0}const _L=new Qn,ph=new j,qv=new j;let ri=class{constructor(e=new j,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;t!==void 0?n.copy(t):_L.setFromPoints(e).getCenter(n);let r=0;for(let s=0,a=e.length;s<a;s++)r=Math.max(r,n.distanceToSquared(e[s]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;ph.subVectors(e,this.center);const t=ph.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),r=(n-this.radius)*.5;this.center.addScaledVector(ph,r/n),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(qv.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(ph.copy(e.center).add(qv)),this.expandByPoint(ph.copy(e.center).sub(qv))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}};const ta=new j,Yv=new j,Yd=new j,Za=new j,Zv=new j,Zd=new j,Kv=new j;class Au{constructor(e=new j,t=new j(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,ta)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=ta.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(ta.copy(this.origin).addScaledVector(this.direction,t),ta.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){Yv.copy(e).add(t).multiplyScalar(.5),Yd.copy(t).sub(e).normalize(),Za.copy(this.origin).sub(Yv);const s=e.distanceTo(t)*.5,a=-this.direction.dot(Yd),o=Za.dot(this.direction),l=-Za.dot(Yd),c=Za.lengthSq(),h=Math.abs(1-a*a);let d,p,m,v;if(h>0)if(d=a*l-o,p=a*o-l,v=s*h,d>=0)if(p>=-v)if(p<=v){const x=1/h;d*=x,p*=x,m=d*(d+a*p+2*o)+p*(a*d+p+2*l)+c}else p=s,d=Math.max(0,-(a*p+o)),m=-d*d+p*(p+2*l)+c;else p=-s,d=Math.max(0,-(a*p+o)),m=-d*d+p*(p+2*l)+c;else p<=-v?(d=Math.max(0,-(-a*s+o)),p=d>0?-s:Math.min(Math.max(-s,-l),s),m=-d*d+p*(p+2*l)+c):p<=v?(d=0,p=Math.min(Math.max(-s,-l),s),m=p*(p+2*l)+c):(d=Math.max(0,-(a*s+o)),p=d>0?s:Math.min(Math.max(-s,-l),s),m=-d*d+p*(p+2*l)+c);else p=a>0?-s:s,d=Math.max(0,-(a*p+o)),m=-d*d+p*(p+2*l)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,d),r&&r.copy(Yv).addScaledVector(Yd,p),m}intersectSphere(e,t){ta.subVectors(e.center,this.origin);const n=ta.dot(this.direction),r=ta.dot(ta)-n*n,s=e.radius*e.radius;if(r>s)return null;const a=Math.sqrt(s-r),o=n-a,l=n+a;return l<0?null:o<0?this.at(l,t):this.at(o,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,s,a,o,l;const c=1/this.direction.x,h=1/this.direction.y,d=1/this.direction.z,p=this.origin;return c>=0?(n=(e.min.x-p.x)*c,r=(e.max.x-p.x)*c):(n=(e.max.x-p.x)*c,r=(e.min.x-p.x)*c),h>=0?(s=(e.min.y-p.y)*h,a=(e.max.y-p.y)*h):(s=(e.max.y-p.y)*h,a=(e.min.y-p.y)*h),n>a||s>r||((s>n||isNaN(n))&&(n=s),(a<r||isNaN(r))&&(r=a),d>=0?(o=(e.min.z-p.z)*d,l=(e.max.z-p.z)*d):(o=(e.max.z-p.z)*d,l=(e.min.z-p.z)*d),n>l||o>r)||((o>n||n!==n)&&(n=o),(l<r||r!==r)&&(r=l),r<0)?null:this.at(n>=0?n:r,t)}intersectsBox(e){return this.intersectBox(e,ta)!==null}intersectTriangle(e,t,n,r,s){Zv.subVectors(t,e),Zd.subVectors(n,e),Kv.crossVectors(Zv,Zd);let a=this.direction.dot(Kv),o;if(a>0){if(r)return null;o=1}else if(a<0)o=-1,a=-a;else return null;Za.subVectors(this.origin,e);const l=o*this.direction.dot(Zd.crossVectors(Za,Zd));if(l<0)return null;const c=o*this.direction.dot(Zv.cross(Za));if(c<0||l+c>a)return null;const h=-o*Za.dot(Kv);return h<0?null:this.at(h/a,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class bt{constructor(e,t,n,r,s,a,o,l,c,h,d,p,m,v,x,_){bt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,r,s,a,o,l,c,h,d,p,m,v,x,_)}set(e,t,n,r,s,a,o,l,c,h,d,p,m,v,x,_){const g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=r,g[1]=s,g[5]=a,g[9]=o,g[13]=l,g[2]=c,g[6]=h,g[10]=d,g[14]=p,g[3]=m,g[7]=v,g[11]=x,g[15]=_,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new bt().fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,r=1/xc.setFromMatrixColumn(e,0).length(),s=1/xc.setFromMatrixColumn(e,1).length(),a=1/xc.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,r=e.y,s=e.z,a=Math.cos(n),o=Math.sin(n),l=Math.cos(r),c=Math.sin(r),h=Math.cos(s),d=Math.sin(s);if(e.order==="XYZ"){const p=a*h,m=a*d,v=o*h,x=o*d;t[0]=l*h,t[4]=-l*d,t[8]=c,t[1]=m+v*c,t[5]=p-x*c,t[9]=-o*l,t[2]=x-p*c,t[6]=v+m*c,t[10]=a*l}else if(e.order==="YXZ"){const p=l*h,m=l*d,v=c*h,x=c*d;t[0]=p+x*o,t[4]=v*o-m,t[8]=a*c,t[1]=a*d,t[5]=a*h,t[9]=-o,t[2]=m*o-v,t[6]=x+p*o,t[10]=a*l}else if(e.order==="ZXY"){const p=l*h,m=l*d,v=c*h,x=c*d;t[0]=p-x*o,t[4]=-a*d,t[8]=v+m*o,t[1]=m+v*o,t[5]=a*h,t[9]=x-p*o,t[2]=-a*c,t[6]=o,t[10]=a*l}else if(e.order==="ZYX"){const p=a*h,m=a*d,v=o*h,x=o*d;t[0]=l*h,t[4]=v*c-m,t[8]=p*c+x,t[1]=l*d,t[5]=x*c+p,t[9]=m*c-v,t[2]=-c,t[6]=o*l,t[10]=a*l}else if(e.order==="YZX"){const p=a*l,m=a*c,v=o*l,x=o*c;t[0]=l*h,t[4]=x-p*d,t[8]=v*d+m,t[1]=d,t[5]=a*h,t[9]=-o*h,t[2]=-c*h,t[6]=m*d+v,t[10]=p-x*d}else if(e.order==="XZY"){const p=a*l,m=a*c,v=o*l,x=o*c;t[0]=l*h,t[4]=-d,t[8]=c*h,t[1]=p*d+x,t[5]=a*h,t[9]=m*d-v,t[2]=v*d-m,t[6]=o*h,t[10]=x*d+p}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(xL,e,bL)}lookAt(e,t,n){const r=this.elements;return mr.subVectors(e,t),mr.lengthSq()===0&&(mr.z=1),mr.normalize(),Ka.crossVectors(n,mr),Ka.lengthSq()===0&&(Math.abs(n.z)===1?mr.x+=1e-4:mr.z+=1e-4,mr.normalize(),Ka.crossVectors(n,mr)),Ka.normalize(),Kd.crossVectors(mr,Ka),r[0]=Ka.x,r[4]=Kd.x,r[8]=mr.x,r[1]=Ka.y,r[5]=Kd.y,r[9]=mr.y,r[2]=Ka.z,r[6]=Kd.z,r[10]=mr.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,s=this.elements,a=n[0],o=n[4],l=n[8],c=n[12],h=n[1],d=n[5],p=n[9],m=n[13],v=n[2],x=n[6],_=n[10],g=n[14],b=n[3],E=n[7],S=n[11],w=n[15],T=r[0],R=r[4],U=r[8],A=r[12],D=r[1],L=r[5],P=r[9],I=r[13],V=r[2],H=r[6],z=r[10],O=r[14],B=r[3],G=r[7],X=r[11],k=r[15];return s[0]=a*T+o*D+l*V+c*B,s[4]=a*R+o*L+l*H+c*G,s[8]=a*U+o*P+l*z+c*X,s[12]=a*A+o*I+l*O+c*k,s[1]=h*T+d*D+p*V+m*B,s[5]=h*R+d*L+p*H+m*G,s[9]=h*U+d*P+p*z+m*X,s[13]=h*A+d*I+p*O+m*k,s[2]=v*T+x*D+_*V+g*B,s[6]=v*R+x*L+_*H+g*G,s[10]=v*U+x*P+_*z+g*X,s[14]=v*A+x*I+_*O+g*k,s[3]=b*T+E*D+S*V+w*B,s[7]=b*R+E*L+S*H+w*G,s[11]=b*U+E*P+S*z+w*X,s[15]=b*A+E*I+S*O+w*k,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],r=e[8],s=e[12],a=e[1],o=e[5],l=e[9],c=e[13],h=e[2],d=e[6],p=e[10],m=e[14],v=e[3],x=e[7],_=e[11],g=e[15];return v*(+s*l*d-r*c*d-s*o*p+n*c*p+r*o*m-n*l*m)+x*(+t*l*m-t*c*p+s*a*p-r*a*m+r*c*h-s*l*h)+_*(+t*c*d-t*o*m-s*a*d+n*a*m+s*o*h-n*c*h)+g*(-r*o*h-t*l*d+t*o*p+r*a*d-n*a*p+n*l*h)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8],d=e[9],p=e[10],m=e[11],v=e[12],x=e[13],_=e[14],g=e[15],b=d*_*c-x*p*c+x*l*m-o*_*m-d*l*g+o*p*g,E=v*p*c-h*_*c-v*l*m+a*_*m+h*l*g-a*p*g,S=h*x*c-v*d*c+v*o*m-a*x*m-h*o*g+a*d*g,w=v*d*l-h*x*l-v*o*p+a*x*p+h*o*_-a*d*_,T=t*b+n*E+r*S+s*w;if(T===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const R=1/T;return e[0]=b*R,e[1]=(x*p*s-d*_*s-x*r*m+n*_*m+d*r*g-n*p*g)*R,e[2]=(o*_*s-x*l*s+x*r*c-n*_*c-o*r*g+n*l*g)*R,e[3]=(d*l*s-o*p*s-d*r*c+n*p*c+o*r*m-n*l*m)*R,e[4]=E*R,e[5]=(h*_*s-v*p*s+v*r*m-t*_*m-h*r*g+t*p*g)*R,e[6]=(v*l*s-a*_*s-v*r*c+t*_*c+a*r*g-t*l*g)*R,e[7]=(a*p*s-h*l*s+h*r*c-t*p*c-a*r*m+t*l*m)*R,e[8]=S*R,e[9]=(v*d*s-h*x*s-v*n*m+t*x*m+h*n*g-t*d*g)*R,e[10]=(a*x*s-v*o*s+v*n*c-t*x*c-a*n*g+t*o*g)*R,e[11]=(h*o*s-a*d*s-h*n*c+t*d*c+a*n*m-t*o*m)*R,e[12]=w*R,e[13]=(h*x*r-v*d*r+v*n*p-t*x*p-h*n*_+t*d*_)*R,e[14]=(v*o*r-a*x*r-v*n*l+t*x*l+a*n*_-t*o*_)*R,e[15]=(a*d*r-h*o*r+h*n*l-t*d*l-a*n*p+t*o*p)*R,this}scale(e){const t=this.elements,n=e.x,r=e.y,s=e.z;return t[0]*=n,t[4]*=r,t[8]*=s,t[1]*=n,t[5]*=r,t[9]*=s,t[2]*=n,t[6]*=r,t[10]*=s,t[3]*=n,t[7]*=r,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),r=Math.sin(t),s=1-n,a=e.x,o=e.y,l=e.z,c=s*a,h=s*o;return this.set(c*a+n,c*o-r*l,c*l+r*o,0,c*o+r*l,h*o+n,h*l-r*a,0,c*l-r*o,h*l+r*a,s*l*l+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,r,s,a){return this.set(1,n,s,0,e,1,a,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){const r=this.elements,s=t._x,a=t._y,o=t._z,l=t._w,c=s+s,h=a+a,d=o+o,p=s*c,m=s*h,v=s*d,x=a*h,_=a*d,g=o*d,b=l*c,E=l*h,S=l*d,w=n.x,T=n.y,R=n.z;return r[0]=(1-(x+g))*w,r[1]=(m+S)*w,r[2]=(v-E)*w,r[3]=0,r[4]=(m-S)*T,r[5]=(1-(p+g))*T,r[6]=(_+b)*T,r[7]=0,r[8]=(v+E)*R,r[9]=(_-b)*R,r[10]=(1-(p+x))*R,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){const r=this.elements;let s=xc.set(r[0],r[1],r[2]).length();const a=xc.set(r[4],r[5],r[6]).length(),o=xc.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),e.x=r[12],e.y=r[13],e.z=r[14],Jr.copy(this);const c=1/s,h=1/a,d=1/o;return Jr.elements[0]*=c,Jr.elements[1]*=c,Jr.elements[2]*=c,Jr.elements[4]*=h,Jr.elements[5]*=h,Jr.elements[6]*=h,Jr.elements[8]*=d,Jr.elements[9]*=d,Jr.elements[10]*=d,t.setFromRotationMatrix(Jr),n.x=s,n.y=a,n.z=o,this}makePerspective(e,t,n,r,s,a,o=yr,l=!1){const c=this.elements,h=2*s/(t-e),d=2*s/(n-r),p=(t+e)/(t-e),m=(n+r)/(n-r);let v,x;if(l)v=s/(a-s),x=a*s/(a-s);else if(o===yr)v=-(a+s)/(a-s),x=-2*a*s/(a-s);else if(o===fu)v=-a/(a-s),x=-a*s/(a-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return c[0]=h,c[4]=0,c[8]=p,c[12]=0,c[1]=0,c[5]=d,c[9]=m,c[13]=0,c[2]=0,c[6]=0,c[10]=v,c[14]=x,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,n,r,s,a,o=yr,l=!1){const c=this.elements,h=2/(t-e),d=2/(n-r),p=-(t+e)/(t-e),m=-(n+r)/(n-r);let v,x;if(l)v=1/(a-s),x=a/(a-s);else if(o===yr)v=-2/(a-s),x=-(a+s)/(a-s);else if(o===fu)v=-1/(a-s),x=-s/(a-s);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return c[0]=h,c[4]=0,c[8]=0,c[12]=p,c[1]=0,c[5]=d,c[9]=0,c[13]=m,c[2]=0,c[6]=0,c[10]=v,c[14]=x,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let r=0;r<16;r++)if(t[r]!==n[r])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const xc=new j,Jr=new bt,xL=new j(0,0,0),bL=new j(1,1,1),Ka=new j,Kd=new j,mr=new j,nE=new bt,iE=new yi;class Bi{constructor(e=0,t=0,n=0,r=Bi.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,r=this._order){return this._x=e,this._y=t,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const r=e.elements,s=r[0],a=r[4],o=r[8],l=r[1],c=r[5],h=r[9],d=r[2],p=r[6],m=r[10];switch(t){case"XYZ":this._y=Math.asin(St(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,m),this._z=Math.atan2(-a,s)):(this._x=Math.atan2(p,c),this._z=0);break;case"YXZ":this._x=Math.asin(-St(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,m),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-d,s),this._z=0);break;case"ZXY":this._x=Math.asin(St(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-d,m),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-St(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(p,m),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(St(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-d,s)):(this._x=0,this._y=Math.atan2(o,m));break;case"XZY":this._z=Math.asin(-St(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(p,c),this._y=Math.atan2(o,s)):(this._x=Math.atan2(-h,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return nE.makeRotationFromQuaternion(e),this.setFromRotationMatrix(nE,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return iE.setFromEuler(this),this.setFromQuaternion(iE,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Bi.DEFAULT_ORDER="XYZ";class pu{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let SL=0;const rE=new j,bc=new yi,na=new bt,Jd=new j,mh=new j,EL=new j,ML=new yi,sE=new j(1,0,0),aE=new j(0,1,0),oE=new j(0,0,1),lE={type:"added"},wL={type:"removed"},Sc={type:"childadded",child:null},Jv={type:"childremoved",child:null};class Xt extends Us{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:SL++}),this.uuid=_r(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Xt.DEFAULT_UP.clone();const e=new j,t=new Bi,n=new yi,r=new j(1,1,1);function s(){n.setFromEuler(t,!1)}function a(){t.setFromQuaternion(n,void 0,!1)}t._onChange(s),n._onChange(a),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new bt},normalMatrix:{value:new At}}),this.matrix=new bt,this.matrixWorld=new bt,this.matrixAutoUpdate=Xt.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Xt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new pu,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return bc.setFromAxisAngle(e,t),this.quaternion.multiply(bc),this}rotateOnWorldAxis(e,t){return bc.setFromAxisAngle(e,t),this.quaternion.premultiply(bc),this}rotateX(e){return this.rotateOnAxis(sE,e)}rotateY(e){return this.rotateOnAxis(aE,e)}rotateZ(e){return this.rotateOnAxis(oE,e)}translateOnAxis(e,t){return rE.copy(e).applyQuaternion(this.quaternion),this.position.add(rE.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(sE,e)}translateY(e){return this.translateOnAxis(aE,e)}translateZ(e){return this.translateOnAxis(oE,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(na.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?Jd.copy(e):Jd.set(e,t,n);const r=this.parent;this.updateWorldMatrix(!0,!1),mh.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?na.lookAt(mh,Jd,this.up):na.lookAt(Jd,mh,this.up),this.quaternion.setFromRotationMatrix(na),r&&(na.extractRotation(r.matrixWorld),bc.setFromRotationMatrix(na),this.quaternion.premultiply(bc.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(lE),Sc.child=e,this.dispatchEvent(Sc),Sc.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(wL),Jv.child=e,this.dispatchEvent(Jv),Jv.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),na.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),na.multiply(e.parent.matrixWorld)),e.applyMatrix4(na),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(lE),Sc.child=e,this.dispatchEvent(Sc),Sc.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,r=this.children.length;n<r;n++){const a=this.children[n].getObjectByProperty(e,t);if(a!==void 0)return a}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);const r=this.children;for(let s=0,a=r.length;s<a;s++)r[s].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(mh,e,EL),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(mh,ML,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t){const n=this.parent;if(e===!0&&n!==null&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){const r=this.children;for(let s=0,a=r.length;s<a;s++)r[s].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const r={};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(o=>({...o,boundingBox:o.boundingBox?o.boundingBox.toJSON():void 0,boundingSphere:o.boundingSphere?o.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(o=>({...o})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function s(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let c=0,h=l.length;c<h;c++){const d=l[c];s(e.shapes,d)}else s(e.shapes,l)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const o=[];for(let l=0,c=this.material.length;l<c;l++)o.push(s(e.materials,this.material[l]));r.material=o}else r.material=s(e.materials,this.material);if(this.children.length>0){r.children=[];for(let o=0;o<this.children.length;o++)r.children.push(this.children[o].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let o=0;o<this.animations.length;o++){const l=this.animations[o];r.animations.push(s(e.animations,l))}}if(t){const o=a(e.geometries),l=a(e.materials),c=a(e.textures),h=a(e.images),d=a(e.shapes),p=a(e.skeletons),m=a(e.animations),v=a(e.nodes);o.length>0&&(n.geometries=o),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),h.length>0&&(n.images=h),d.length>0&&(n.shapes=d),p.length>0&&(n.skeletons=p),m.length>0&&(n.animations=m),v.length>0&&(n.nodes=v)}return n.object=r,n;function a(o){const l=[];for(const c in o){const h=o[c];delete h.metadata,l.push(h)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n<e.children.length;n++){const r=e.children[n];this.add(r.clone())}return this}}Xt.DEFAULT_UP=new j(0,1,0);Xt.DEFAULT_MATRIX_AUTO_UPDATE=!0;Xt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const Qr=new j,ia=new j,Qv=new j,ra=new j,Ec=new j,Mc=new j,cE=new j,$v=new j,ey=new j,ty=new j,ny=new Bt,iy=new Bt,ry=new Bt;class Ji{constructor(e=new j,t=new j,n=new j){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,r){r.subVectors(n,t),Qr.subVectors(e,t),r.cross(Qr);const s=r.lengthSq();return s>0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,t,n,r,s){Qr.subVectors(r,t),ia.subVectors(n,t),Qv.subVectors(e,t);const a=Qr.dot(Qr),o=Qr.dot(ia),l=Qr.dot(Qv),c=ia.dot(ia),h=ia.dot(Qv),d=a*c-o*o;if(d===0)return s.set(0,0,0),null;const p=1/d,m=(c*l-o*h)*p,v=(a*h-o*l)*p;return s.set(1-m-v,v,m)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,ra)===null?!1:ra.x>=0&&ra.y>=0&&ra.x+ra.y<=1}static getInterpolation(e,t,n,r,s,a,o,l){return this.getBarycoord(e,t,n,r,ra)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,ra.x),l.addScaledVector(a,ra.y),l.addScaledVector(o,ra.z),l)}static getInterpolatedAttribute(e,t,n,r,s,a){return ny.setScalar(0),iy.setScalar(0),ry.setScalar(0),ny.fromBufferAttribute(e,t),iy.fromBufferAttribute(e,n),ry.fromBufferAttribute(e,r),a.setScalar(0),a.addScaledVector(ny,s.x),a.addScaledVector(iy,s.y),a.addScaledVector(ry,s.z),a}static isFrontFacing(e,t,n,r){return Qr.subVectors(n,t),ia.subVectors(e,t),Qr.cross(ia).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Qr.subVectors(this.c,this.b),ia.subVectors(this.a,this.b),Qr.cross(ia).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Ji.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Ji.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,r,s){return Ji.getInterpolation(e,this.a,this.b,this.c,t,n,r,s)}containsPoint(e){return Ji.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Ji.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,r=this.b,s=this.c;let a,o;Ec.subVectors(r,n),Mc.subVectors(s,n),$v.subVectors(e,n);const l=Ec.dot($v),c=Mc.dot($v);if(l<=0&&c<=0)return t.copy(n);ey.subVectors(e,r);const h=Ec.dot(ey),d=Mc.dot(ey);if(h>=0&&d<=h)return t.copy(r);const p=l*d-h*c;if(p<=0&&l>=0&&h<=0)return a=l/(l-h),t.copy(n).addScaledVector(Ec,a);ty.subVectors(e,s);const m=Ec.dot(ty),v=Mc.dot(ty);if(v>=0&&m<=v)return t.copy(s);const x=m*c-l*v;if(x<=0&&c>=0&&v<=0)return o=c/(c-v),t.copy(n).addScaledVector(Mc,o);const _=h*v-m*d;if(_<=0&&d-h>=0&&m-v>=0)return cE.subVectors(s,r),o=(d-h)/(d-h+(m-v)),t.copy(r).addScaledVector(cE,o);const g=1/(_+x+p);return a=x*g,o=p*g,t.copy(n).addScaledVector(Ec,a).addScaledVector(Mc,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const p2={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ja={h:0,s:0,l:0},Qd={h:0,s:0,l:0};function sy(i,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?i+(e-i)*6*t:t<1/2?e:t<2/3?i+(e-i)*6*(2/3-t):i}let Ye=class{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Ri){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Gt.colorSpaceToWorking(this,t),this}setRGB(e,t,n,r=Gt.workingColorSpace){return this.r=e,this.g=t,this.b=n,Gt.colorSpaceToWorking(this,r),this}setHSL(e,t,n,r=Gt.workingColorSpace){if(e=Zx(e,1),t=St(t,0,1),n=St(n,0,1),t===0)this.r=this.g=this.b=n;else{const s=n<=.5?n*(1+t):n+t-n*t,a=2*n-s;this.r=sy(a,s,e+1/3),this.g=sy(a,s,e),this.b=sy(a,s,e-1/3)}return Gt.colorSpaceToWorking(this,r),this}setStyle(e,t=Ri){function n(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const a=r[1],o=r[2];switch(a){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=r[1],a=s.length;if(a===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(a===6)return this.setHex(parseInt(s,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Ri){const n=p2[e.toLowerCase()];return n!==void 0?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=ga(e.r),this.g=ga(e.g),this.b=ga(e.b),this}copyLinearToSRGB(e){return this.r=ru(e.r),this.g=ru(e.g),this.b=ru(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Ri){return Gt.workingToColorSpace(Ai.copy(this),e),Math.round(St(Ai.r*255,0,255))*65536+Math.round(St(Ai.g*255,0,255))*256+Math.round(St(Ai.b*255,0,255))}getHexString(e=Ri){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Gt.workingColorSpace){Gt.workingToColorSpace(Ai.copy(this),t);const n=Ai.r,r=Ai.g,s=Ai.b,a=Math.max(n,r,s),o=Math.min(n,r,s);let l,c;const h=(o+a)/2;if(o===a)l=0,c=0;else{const d=a-o;switch(c=h<=.5?d/(a+o):d/(2-a-o),a){case n:l=(r-s)/d+(r<s?6:0);break;case r:l=(s-n)/d+2;break;case s:l=(n-r)/d+4;break}l/=6}return e.h=l,e.s=c,e.l=h,e}getRGB(e,t=Gt.workingColorSpace){return Gt.workingToColorSpace(Ai.copy(this),t),e.r=Ai.r,e.g=Ai.g,e.b=Ai.b,e}getStyle(e=Ri){Gt.workingToColorSpace(Ai.copy(this),e);const t=Ai.r,n=Ai.g,r=Ai.b;return e!==Ri?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(r*255)})`}offsetHSL(e,t,n){return this.getHSL(Ja),this.setHSL(Ja.h+e,Ja.s+t,Ja.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(Ja),e.getHSL(Qd);const n=cf(Ja.h,Qd.h,t),r=cf(Ja.s,Qd.s,t),s=cf(Ja.l,Qd.l,t);return this.setHSL(n,r,s),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,n=this.g,r=this.b,s=e.elements;return this.r=s[0]*t+s[3]*n+s[6]*r,this.g=s[1]*t+s[4]*n+s[7]*r,this.b=s[2]*t+s[5]*n+s[8]*r,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}};const Ai=new Ye;Ye.NAMES=p2;let TL=0;class Ui extends Us{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:TL++}),this.uuid=_r(),this.name="",this.type="Material",this.blending=bl,this.side=_a,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=vm,this.blendDst=ym,this.blendEquation=ro,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Ye(0,0,0),this.blendAlpha=0,this.depthFunc=Tl,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=q_,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=fl,this.stencilZFail=fl,this.stencilZPass=fl,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const n=e[t];if(n===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const n={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(n.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(n.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==bl&&(n.blending=this.blending),this.side!==_a&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==vm&&(n.blendSrc=this.blendSrc),this.blendDst!==ym&&(n.blendDst=this.blendDst),this.blendEquation!==ro&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==Tl&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==q_&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==fl&&(n.stencilFail=this.stencilFail),this.stencilZFail!==fl&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==fl&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function r(s){const a=[];for(const o in s){const l=s[o];delete l.metadata,a.push(l)}return a}if(t){const s=r(e.textures),a=r(e.images);s.length>0&&(n.textures=s),a.length>0&&(n.images=a)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(t!==null){const r=t.length;n=new Array(r);for(let s=0;s!==r;++s)n[s]=t[s].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class Ma extends Ui{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Ye(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Bi,this.combine=Kf,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const da=AL();function AL(){const i=new ArrayBuffer(4),e=new Float32Array(i),t=new Uint32Array(i),n=new Uint32Array(512),r=new Uint32Array(512);for(let l=0;l<256;++l){const c=l-127;c<-27?(n[l]=0,n[l|256]=32768,r[l]=24,r[l|256]=24):c<-14?(n[l]=1024>>-c-14,n[l|256]=1024>>-c-14|32768,r[l]=-c-1,r[l|256]=-c-1):c<=15?(n[l]=c+15<<10,n[l|256]=c+15<<10|32768,r[l]=13,r[l|256]=13):c<128?(n[l]=31744,n[l|256]=64512,r[l]=24,r[l|256]=24):(n[l]=31744,n[l|256]=64512,r[l]=13,r[l|256]=13)}const s=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let l=1;l<1024;++l){let c=l<<13,h=0;for(;(c&8388608)===0;)c<<=1,h-=8388608;c&=-8388609,h+=947912704,s[l]=c|h}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)a[l]=l<<23;a[31]=1199570944,a[32]=2147483648;for(let l=33;l<63;++l)a[l]=2147483648+(l-32<<23);a[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(o[l]=1024);return{floatView:e,uint32View:t,baseTable:n,shiftTable:r,mantissaTable:s,exponentTable:a,offsetTable:o}}function Zi(i){Math.abs(i)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),i=St(i,-65504,65504),da.floatView[0]=i;const e=da.uint32View[0],t=e>>23&511;return da.baseTable[t]+((e&8388607)>>da.shiftTable[t])}function Yh(i){const e=i>>10;return da.uint32View[0]=da.mantissaTable[da.offsetTable[e]+(i&1023)]+da.exponentTable[e],da.floatView[0]}class CL{static toHalfFloat(e){return Zi(e)}static fromHalfFloat(e){return Yh(e)}}const qn=new j,$d=new ke;let RL=0;class $t{constructor(e,t,n=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:RL++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n,this.usage=Tf,this.updateRanges=[],this.gpuType=Qi,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,s=this.itemSize;r<s;r++)this.array[e+r]=t.array[n+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)$d.fromBufferAttribute(this,t),$d.applyMatrix3(e),this.setXY(t,$d.x,$d.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)qn.fromBufferAttribute(this,t),qn.applyMatrix3(e),this.setXYZ(t,qn.x,qn.y,qn.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)qn.fromBufferAttribute(this,t),qn.applyMatrix4(e),this.setXYZ(t,qn.x,qn.y,qn.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)qn.fromBufferAttribute(this,t),qn.applyNormalMatrix(e),this.setXYZ(t,qn.x,qn.y,qn.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)qn.fromBufferAttribute(this,t),qn.transformDirection(e),this.setXYZ(t,qn.x,qn.y,qn.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=Pi(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Ot(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Pi(t,this.array)),t}setX(e,t){return this.normalized&&(t=Ot(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Pi(t,this.array)),t}setY(e,t){return this.normalized&&(t=Ot(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=Pi(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Ot(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=Pi(t,this.array)),t}setW(e,t){return this.normalized&&(t=Ot(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Ot(t,this.array),n=Ot(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=Ot(t,this.array),n=Ot(n,this.array),r=Ot(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this}setXYZW(e,t,n,r,s){return e*=this.itemSize,this.normalized&&(t=Ot(t,this.array),n=Ot(n,this.array),r=Ot(r,this.array),s=Ot(s,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=s,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==Tf&&(e.usage=this.usage),e}}class DL extends $t{constructor(e,t,n){super(new Int8Array(e),t,n)}}class UL extends $t{constructor(e,t,n){super(new Uint8Array(e),t,n)}}class OL extends $t{constructor(e,t,n){super(new Uint8ClampedArray(e),t,n)}}class LL extends $t{constructor(e,t,n){super(new Int16Array(e),t,n)}}class Jx extends $t{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class IL extends $t{constructor(e,t,n){super(new Int32Array(e),t,n)}}class Qx extends $t{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class NL extends $t{constructor(e,t,n){super(new Uint16Array(e),t,n),this.isFloat16BufferAttribute=!0}getX(e){let t=Yh(this.array[e*this.itemSize]);return this.normalized&&(t=Pi(t,this.array)),t}setX(e,t){return this.normalized&&(t=Ot(t,this.array)),this.array[e*this.itemSize]=Zi(t),this}getY(e){let t=Yh(this.array[e*this.itemSize+1]);return this.normalized&&(t=Pi(t,this.array)),t}setY(e,t){return this.normalized&&(t=Ot(t,this.array)),this.array[e*this.itemSize+1]=Zi(t),this}getZ(e){let t=Yh(this.array[e*this.itemSize+2]);return this.normalized&&(t=Pi(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Ot(t,this.array)),this.array[e*this.itemSize+2]=Zi(t),this}getW(e){let t=Yh(this.array[e*this.itemSize+3]);return this.normalized&&(t=Pi(t,this.array)),t}setW(e,t){return this.normalized&&(t=Ot(t,this.array)),this.array[e*this.itemSize+3]=Zi(t),this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Ot(t,this.array),n=Ot(n,this.array)),this.array[e+0]=Zi(t),this.array[e+1]=Zi(n),this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=Ot(t,this.array),n=Ot(n,this.array),r=Ot(r,this.array)),this.array[e+0]=Zi(t),this.array[e+1]=Zi(n),this.array[e+2]=Zi(r),this}setXYZW(e,t,n,r,s){return e*=this.itemSize,this.normalized&&(t=Ot(t,this.array),n=Ot(n,this.array),r=Ot(r,this.array),s=Ot(s,this.array)),this.array[e+0]=Zi(t),this.array[e+1]=Zi(n),this.array[e+2]=Zi(r),this.array[e+3]=Zi(s),this}}class ft extends $t{constructor(e,t,n){super(new Float32Array(e),t,n)}}let PL=0;const Ur=new bt,ay=new Xt,wc=new j,gr=new Qn,gh=new Qn,ui=new j;class Rt extends Us{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:PL++}),this.uuid=_r(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(h2(e)?Qx:Jx)(e,1):this.index=e,this}setIndirect(e){return this.indirect=e,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(n!==void 0){const s=new At().getNormalMatrix(e);n.applyNormalMatrix(s),n.needsUpdate=!0}const r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return Ur.makeRotationFromQuaternion(e),this.applyMatrix4(Ur),this}rotateX(e){return Ur.makeRotationX(e),this.applyMatrix4(Ur),this}rotateY(e){return Ur.makeRotationY(e),this.applyMatrix4(Ur),this}rotateZ(e){return Ur.makeRotationZ(e),this.applyMatrix4(Ur),this}translate(e,t,n){return Ur.makeTranslation(e,t,n),this.applyMatrix4(Ur),this}scale(e,t,n){return Ur.makeScale(e,t,n),this.applyMatrix4(Ur),this}lookAt(e){return ay.lookAt(e),ay.updateMatrix(),this.applyMatrix4(ay.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(wc).negate(),this.translate(wc.x,wc.y,wc.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const n=[];for(let r=0,s=e.length;r<s;r++){const a=e[r];n.push(a.x,a.y,a.z||0)}this.setAttribute("position",new ft(n,3))}else{const n=Math.min(e.length,t.count);for(let r=0;r<n;r++){const s=e[r];t.setXYZ(r,s.x,s.y,s.z||0)}e.length>t.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Qn);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new j(-1/0,-1/0,-1/0),new j(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,r=t.length;n<r;n++){const s=t[n];gr.setFromBufferAttribute(s),this.morphTargetsRelative?(ui.addVectors(this.boundingBox.min,gr.min),this.boundingBox.expandByPoint(ui),ui.addVectors(this.boundingBox.max,gr.max),this.boundingBox.expandByPoint(ui)):(this.boundingBox.expandByPoint(gr.min),this.boundingBox.expandByPoint(gr.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new ri);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new j,1/0);return}if(e){const n=this.boundingSphere.center;if(gr.setFromBufferAttribute(e),t)for(let s=0,a=t.length;s<a;s++){const o=t[s];gh.setFromBufferAttribute(o),this.morphTargetsRelative?(ui.addVectors(gr.min,gh.min),gr.expandByPoint(ui),ui.addVectors(gr.max,gh.max),gr.expandByPoint(ui)):(gr.expandByPoint(gh.min),gr.expandByPoint(gh.max))}gr.getCenter(n);let r=0;for(let s=0,a=e.count;s<a;s++)ui.fromBufferAttribute(e,s),r=Math.max(r,n.distanceToSquared(ui));if(t)for(let s=0,a=t.length;s<a;s++){const o=t[s],l=this.morphTargetsRelative;for(let c=0,h=o.count;c<h;c++)ui.fromBufferAttribute(o,c),l&&(wc.fromBufferAttribute(e,c),ui.add(wc)),r=Math.max(r,n.distanceToSquared(ui))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const n=t.position,r=t.normal,s=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new $t(new Float32Array(4*n.count),4));const a=this.getAttribute("tangent"),o=[],l=[];for(let U=0;U<n.count;U++)o[U]=new j,l[U]=new j;const c=new j,h=new j,d=new j,p=new ke,m=new ke,v=new ke,x=new j,_=new j;function g(U,A,D){c.fromBufferAttribute(n,U),h.fromBufferAttribute(n,A),d.fromBufferAttribute(n,D),p.fromBufferAttribute(s,U),m.fromBufferAttribute(s,A),v.fromBufferAttribute(s,D),h.sub(c),d.sub(c),m.sub(p),v.sub(p);const L=1/(m.x*v.y-v.x*m.y);isFinite(L)&&(x.copy(h).multiplyScalar(v.y).addScaledVector(d,-m.y).multiplyScalar(L),_.copy(d).multiplyScalar(m.x).addScaledVector(h,-v.x).multiplyScalar(L),o[U].add(x),o[A].add(x),o[D].add(x),l[U].add(_),l[A].add(_),l[D].add(_))}let b=this.groups;b.length===0&&(b=[{start:0,count:e.count}]);for(let U=0,A=b.length;U<A;++U){const D=b[U],L=D.start,P=D.count;for(let I=L,V=L+P;I<V;I+=3)g(e.getX(I+0),e.getX(I+1),e.getX(I+2))}const E=new j,S=new j,w=new j,T=new j;function R(U){w.fromBufferAttribute(r,U),T.copy(w);const A=o[U];E.copy(A),E.sub(w.multiplyScalar(w.dot(A))).normalize(),S.crossVectors(T,A);const L=S.dot(l[U])<0?-1:1;a.setXYZW(U,E.x,E.y,E.z,L)}for(let U=0,A=b.length;U<A;++U){const D=b[U],L=D.start,P=D.count;for(let I=L,V=L+P;I<V;I+=3)R(e.getX(I+0)),R(e.getX(I+1)),R(e.getX(I+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new $t(new Float32Array(t.count*3),3),this.setAttribute("normal",n);else for(let p=0,m=n.count;p<m;p++)n.setXYZ(p,0,0,0);const r=new j,s=new j,a=new j,o=new j,l=new j,c=new j,h=new j,d=new j;if(e)for(let p=0,m=e.count;p<m;p+=3){const v=e.getX(p+0),x=e.getX(p+1),_=e.getX(p+2);r.fromBufferAttribute(t,v),s.fromBufferAttribute(t,x),a.fromBufferAttribute(t,_),h.subVectors(a,s),d.subVectors(r,s),h.cross(d),o.fromBufferAttribute(n,v),l.fromBufferAttribute(n,x),c.fromBufferAttribute(n,_),o.add(h),l.add(h),c.add(h),n.setXYZ(v,o.x,o.y,o.z),n.setXYZ(x,l.x,l.y,l.z),n.setXYZ(_,c.x,c.y,c.z)}else for(let p=0,m=t.count;p<m;p+=3)r.fromBufferAttribute(t,p+0),s.fromBufferAttribute(t,p+1),a.fromBufferAttribute(t,p+2),h.subVectors(a,s),d.subVectors(r,s),h.cross(d),n.setXYZ(p+0,h.x,h.y,h.z),n.setXYZ(p+1,h.x,h.y,h.z),n.setXYZ(p+2,h.x,h.y,h.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)ui.fromBufferAttribute(e,t),ui.normalize(),e.setXYZ(t,ui.x,ui.y,ui.z)}toNonIndexed(){function e(o,l){const c=o.array,h=o.itemSize,d=o.normalized,p=new c.constructor(l.length*h);let m=0,v=0;for(let x=0,_=l.length;x<_;x++){o.isInterleavedBufferAttribute?m=l[x]*o.data.stride+o.offset:m=l[x]*h;for(let g=0;g<h;g++)p[v++]=c[m++]}return new $t(p,h,d)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new Rt,n=this.index.array,r=this.attributes;for(const o in r){const l=r[o],c=e(l,n);t.setAttribute(o,c)}const s=this.morphAttributes;for(const o in s){const l=[],c=s[o];for(let h=0,d=c.length;h<d;h++){const p=c[h],m=e(p,n);l.push(m)}t.morphAttributes[o]=l}t.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let o=0,l=a.length;o<l;o++){const c=a[o];t.addGroup(c.start,c.count,c.materialIndex)}return t}toJSON(){const e={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const l in n){const c=n[l];e.data.attributes[l]=c.toJSON(e.data)}const r={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],h=[];for(let d=0,p=c.length;d<p;d++){const m=c[d];h.push(m.toJSON(e.data))}h.length>0&&(r[l]=h,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return o!==null&&(e.data.boundingSphere=o.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;n!==null&&this.setIndex(n.clone());const r=e.attributes;for(const c in r){const h=r[c];this.setAttribute(c,h.clone(t))}const s=e.morphAttributes;for(const c in s){const h=[],d=s[c];for(let p=0,m=d.length;p<m;p++)h.push(d[p].clone(t));this.morphAttributes[c]=h}this.morphTargetsRelative=e.morphTargetsRelative;const a=e.groups;for(let c=0,h=a.length;c<h;c++){const d=a[c];this.addGroup(d.start,d.count,d.materialIndex)}const o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());const l=e.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const uE=new bt,Zo=new Au,ep=new ri,hE=new j,tp=new j,np=new j,ip=new j,oy=new j,rp=new j,fE=new j,sp=new j;class mn extends Xt{constructor(e=new Rt,t=new Ma){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const r=t[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=r.length;s<a;s++){const o=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}getVertexPosition(e,t){const n=this.geometry,r=n.attributes.position,s=n.morphAttributes.position,a=n.morphTargetsRelative;t.fromBufferAttribute(r,e);const o=this.morphTargetInfluences;if(s&&o){rp.set(0,0,0);for(let l=0,c=s.length;l<c;l++){const h=o[l],d=s[l];h!==0&&(oy.fromBufferAttribute(d,e),a?rp.addScaledVector(oy,h):rp.addScaledVector(oy.sub(t),h))}t.add(rp)}return t}raycast(e,t){const n=this.geometry,r=this.material,s=this.matrixWorld;r!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),ep.copy(n.boundingSphere),ep.applyMatrix4(s),Zo.copy(e.ray).recast(e.near),!(ep.containsPoint(Zo.origin)===!1&&(Zo.intersectSphere(ep,hE)===null||Zo.origin.distanceToSquared(hE)>(e.far-e.near)**2))&&(uE.copy(s).invert(),Zo.copy(e.ray).applyMatrix4(uE),!(n.boundingBox!==null&&Zo.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,Zo)))}_computeIntersections(e,t,n){let r;const s=this.geometry,a=this.material,o=s.index,l=s.attributes.position,c=s.attributes.uv,h=s.attributes.uv1,d=s.attributes.normal,p=s.groups,m=s.drawRange;if(o!==null)if(Array.isArray(a))for(let v=0,x=p.length;v<x;v++){const _=p[v],g=a[_.materialIndex],b=Math.max(_.start,m.start),E=Math.min(o.count,Math.min(_.start+_.count,m.start+m.count));for(let S=b,w=E;S<w;S+=3){const T=o.getX(S),R=o.getX(S+1),U=o.getX(S+2);r=ap(this,g,e,n,c,h,d,T,R,U),r&&(r.faceIndex=Math.floor(S/3),r.face.materialIndex=_.materialIndex,t.push(r))}}else{const v=Math.max(0,m.start),x=Math.min(o.count,m.start+m.count);for(let _=v,g=x;_<g;_+=3){const b=o.getX(_),E=o.getX(_+1),S=o.getX(_+2);r=ap(this,a,e,n,c,h,d,b,E,S),r&&(r.faceIndex=Math.floor(_/3),t.push(r))}}else if(l!==void 0)if(Array.isArray(a))for(let v=0,x=p.length;v<x;v++){const _=p[v],g=a[_.materialIndex],b=Math.max(_.start,m.start),E=Math.min(l.count,Math.min(_.start+_.count,m.start+m.count));for(let S=b,w=E;S<w;S+=3){const T=S,R=S+1,U=S+2;r=ap(this,g,e,n,c,h,d,T,R,U),r&&(r.faceIndex=Math.floor(S/3),r.face.materialIndex=_.materialIndex,t.push(r))}}else{const v=Math.max(0,m.start),x=Math.min(l.count,m.start+m.count);for(let _=v,g=x;_<g;_+=3){const b=_,E=_+1,S=_+2;r=ap(this,a,e,n,c,h,d,b,E,S),r&&(r.faceIndex=Math.floor(_/3),t.push(r))}}}}function zL(i,e,t,n,r,s,a,o){let l;if(e.side===Fi?l=n.intersectTriangle(a,s,r,!0,o):l=n.intersectTriangle(r,s,a,e.side===_a,o),l===null)return null;sp.copy(o),sp.applyMatrix4(i.matrixWorld);const c=t.ray.origin.distanceTo(sp);return c<t.near||c>t.far?null:{distance:c,point:sp.clone(),object:i}}function ap(i,e,t,n,r,s,a,o,l,c){i.getVertexPosition(o,tp),i.getVertexPosition(l,np),i.getVertexPosition(c,ip);const h=zL(i,e,t,n,tp,np,ip,fE);if(h){const d=new j;Ji.getBarycoord(fE,tp,np,ip,d),r&&(h.uv=Ji.getInterpolatedAttribute(r,o,l,c,d,new ke)),s&&(h.uv1=Ji.getInterpolatedAttribute(s,o,l,c,d,new ke)),a&&(h.normal=Ji.getInterpolatedAttribute(a,o,l,c,d,new j),h.normal.dot(n.direction)>0&&h.normal.multiplyScalar(-1));const p={a:o,b:l,c,normal:new j,materialIndex:0};Ji.getNormal(tp,np,ip,p.normal),h.face=p,h.barycoord=d}return h}class vo extends Rt{constructor(e=1,t=1,n=1,r=1,s=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:s,depthSegments:a};const o=this;r=Math.floor(r),s=Math.floor(s),a=Math.floor(a);const l=[],c=[],h=[],d=[];let p=0,m=0;v("z","y","x",-1,-1,n,t,e,a,s,0),v("z","y","x",1,-1,n,t,-e,a,s,1),v("x","z","y",1,1,e,n,t,r,a,2),v("x","z","y",1,-1,e,n,-t,r,a,3),v("x","y","z",1,-1,e,t,n,r,s,4),v("x","y","z",-1,-1,e,t,-n,r,s,5),this.setIndex(l),this.setAttribute("position",new ft(c,3)),this.setAttribute("normal",new ft(h,3)),this.setAttribute("uv",new ft(d,2));function v(x,_,g,b,E,S,w,T,R,U,A){const D=S/R,L=w/U,P=S/2,I=w/2,V=T/2,H=R+1,z=U+1;let O=0,B=0;const G=new j;for(let X=0;X<z;X++){const k=X*L-I;for(let Y=0;Y<H;Y++){const Q=Y*D-P;G[x]=Q*b,G[_]=k*E,G[g]=V,c.push(G.x,G.y,G.z),G[x]=0,G[_]=0,G[g]=T>0?1:-1,h.push(G.x,G.y,G.z),d.push(Y/R),d.push(1-X/U),O+=1}}for(let X=0;X<U;X++)for(let k=0;k<R;k++){const Y=p+k+H*X,Q=p+k+H*(X+1),te=p+(k+1)+H*(X+1),ee=p+(k+1)+H*X;l.push(Y,Q,ee),l.push(Q,te,ee),B+=6}o.addGroup(m,B,A),m+=B,p+=O}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new vo(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function mu(i){const e={};for(const t in i){e[t]={};for(const n in i[t]){const r=i[t][n];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][n]=null):e[t][n]=r.clone():Array.isArray(r)?e[t][n]=r.slice():e[t][n]=r}}return e}function Ni(i){const e={};for(let t=0;t<i.length;t++){const n=mu(i[t]);for(const r in n)e[r]=n[r]}return e}function FL(i){const e=[];for(let t=0;t<i.length;t++)e.push(i[t].clone());return e}function m2(i){const e=i.getRenderTarget();return e===null?i.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:Gt.workingColorSpace}const $x={clone:mu,merge:Ni};var BL=`void main() {
|
|
2
2
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
3
3
|
}`,kL=`void main() {
|
|
4
4
|
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
|
|
@@ -3836,11 +3836,11 @@ void main() {
|
|
|
3836
3836
|
`);for(C=M=0;M<we.length&&!we[M].includes("DetermineComponentFrameRoot");)M++;for(;C<Fe.length&&!Fe[C].includes("DetermineComponentFrameRoot");)C++;if(M===we.length||C===Fe.length)for(M=we.length-1,C=Fe.length-1;1<=M&&0<=C&&we[M]!==Fe[C];)C--;for(;1<=M&&0<=C;M--,C--)if(we[M]!==Fe[C]){if(M!==1||C!==1)do if(M--,C--,0>C||we[M]!==Fe[C]){var Ke=`
|
|
3837
3837
|
`+we[M].replace(" at new "," at ");return u.displayName&&Ke.includes("<anonymous>")&&(Ke=Ke.replace("<anonymous>",u.displayName)),Ke}while(1<=M&&0<=C);break}}}finally{dv=!1,Error.prepareStackTrace=y}return(y=u?u.displayName||u.name:"")?o(y):""}function c(u){switch(u.tag){case 26:case 27:case 5:return o(u.type);case 16:return o("Lazy");case 13:return o("Suspense");case 19:return o("SuspenseList");case 0:case 15:return u=l(u.type,!1),u;case 11:return u=l(u.type.render,!1),u;case 1:return u=l(u.type,!0),u;default:return""}}function h(u){try{var f="";do f+=c(u),u=u.return;while(u);return f}catch(y){return`
|
|
3838
3838
|
Error generating stack: `+y.message+`
|
|
3839
|
-
`+y.stack}}function d(u){var f=u,y=u;if(u.alternate)for(;f.return;)f=f.return;else{u=f;do f=u,(f.flags&4098)!==0&&(y=f.return),u=f.return;while(u)}return f.tag===3?y:null}function p(u){if(d(u)!==u)throw Error(r(188))}function m(u){var f=u.alternate;if(!f){if(f=d(u),f===null)throw Error(r(188));return f!==u?null:u}for(var y=u,M=f;;){var C=y.return;if(C===null)break;var N=C.alternate;if(N===null){if(M=C.return,M!==null){y=M;continue}break}if(C.child===N.child){for(N=C.child;N;){if(N===y)return p(C),u;if(N===M)return p(C),f;N=N.sibling}throw Error(r(188))}if(y.return!==M.return)y=C,M=N;else{for(var Z=!1,le=C.child;le;){if(le===y){Z=!0,y=C,M=N;break}if(le===M){Z=!0,M=C,y=N;break}le=le.sibling}if(!Z){for(le=N.child;le;){if(le===y){Z=!0,y=N,M=C;break}if(le===M){Z=!0,M=N,y=C;break}le=le.sibling}if(!Z)throw Error(r(189))}}if(y.alternate!==M)throw Error(r(190))}if(y.tag!==3)throw Error(r(188));return y.stateNode.current===y?u:f}function v(u){var f=u.tag;if(f===5||f===26||f===27||f===6)return u;for(u=u.child;u!==null;){if(f=v(u),f!==null)return f;u=u.sibling}return null}function x(u){var f=u.tag;if(f===5||f===26||f===27||f===6)return u;for(u=u.child;u!==null;){if(u.tag!==4&&(f=x(u),f!==null))return f;u=u.sibling}return null}function _(u){return{current:u}}function g(u){0>$l||(u.current=_v[$l],_v[$l]=null,$l--)}function b(u,f){$l++,_v[$l]=u.current,u.current=f}function E(u){return u>>>=0,u===0?32:31-(wU(u)/TU|0)|0}function S(u){var f=u&42;if(f!==0)return f;switch(u&-u){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return u&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return u&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return u}}function w(u,f){var y=u.pendingLanes;if(y===0)return 0;var M=0,C=u.suspendedLanes,N=u.pingedLanes,Z=u.warmLanes;u=u.finishedLanes!==0;var le=y&134217727;return le!==0?(y=le&~C,y!==0?M=S(y):(N&=le,N!==0?M=S(N):u||(Z=le&~Z,Z!==0&&(M=S(Z))))):(le=y&~C,le!==0?M=S(le):N!==0?M=S(N):u||(Z=y&~Z,Z!==0&&(M=S(Z)))),M===0?0:f!==0&&f!==M&&(f&C)===0&&(C=M&-M,Z=f&-f,C>=Z||C===32&&(Z&4194176)!==0)?f:M}function T(u,f){return(u.pendingLanes&~(u.suspendedLanes&~u.pingedLanes)&f)===0}function R(u,f){switch(u){case 1:case 2:case 4:case 8:return f+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return f+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function U(){var u=wd;return wd<<=1,(wd&4194176)===0&&(wd=128),u}function A(){var u=Td;return Td<<=1,(Td&62914560)===0&&(Td=4194304),u}function D(u){for(var f=[],y=0;31>y;y++)f.push(u);return f}function L(u,f){u.pendingLanes|=f,f!==268435456&&(u.suspendedLanes=0,u.pingedLanes=0,u.warmLanes=0)}function P(u,f,y,M,C,N){var Z=u.pendingLanes;u.pendingLanes=y,u.suspendedLanes=0,u.pingedLanes=0,u.warmLanes=0,u.expiredLanes&=y,u.entangledLanes&=y,u.errorRecoveryDisabledLanes&=y,u.shellSuspendCounter=0;var le=u.entanglements,we=u.expirationTimes,Fe=u.hiddenUpdates;for(y=Z&~y;0<y;){var Ke=31-ur(y),ct=1<<Ke;le[Ke]=0,we[Ke]=-1;var ht=Fe[Ke];if(ht!==null)for(Fe[Ke]=null,Ke=0;Ke<ht.length;Ke++){var Dt=ht[Ke];Dt!==null&&(Dt.lane&=-536870913)}y&=~ct}M!==0&&I(u,M,0),N!==0&&C===0&&u.tag!==0&&(u.suspendedLanes|=N&~(Z&~f))}function I(u,f,y){u.pendingLanes|=f,u.suspendedLanes&=~f;var M=31-ur(f);u.entangledLanes|=f,u.entanglements[M]=u.entanglements[M]|1073741824|y&4194218}function V(u,f){var y=u.entangledLanes|=f;for(u=u.entanglements;y;){var M=31-ur(y),C=1<<M;C&f|u[M]&f&&(u[M]|=f),y&=~C}}function H(u){return u&=-u,2<u?8<u?(u&134217727)!==0?32:268435456:8:2}function z(u){if(hr&&typeof hr.onCommitFiberRoot=="function")try{hr.onCommitFiberRoot(eh,u,void 0,(u.current.flags&128)===128)}catch{}}function O(u){if(typeof UU=="function"&&OU(u),hr&&typeof hr.setStrictMode=="function")try{hr.setStrictMode(eh,u)}catch{}}function B(u,f){return u===f&&(u!==0||1/u===1/f)||u!==u&&f!==f}function G(u,f){if(typeof u=="object"&&u!==null){var y=kS.get(u);return y!==void 0?y:(f={value:u,source:f,stack:h(f)},kS.set(u,f),f)}return{value:u,source:f,stack:h(f)}}function X(u,f){tc[nc++]=Rd,tc[nc++]=Cd,Cd=u,Rd=f}function k(u,f,y){wr[Tr++]=qs,wr[Tr++]=Ys,wr[Tr++]=zo,zo=u;var M=qs;u=Ys;var C=32-ur(M)-1;M&=~(1<<C),y+=1;var N=32-ur(f)+C;if(30<N){var Z=C-C%5;N=(M&(1<<Z)-1).toString(32),M>>=Z,C-=Z,qs=1<<32-ur(f)+C|y<<C|M,Ys=N+u}else qs=1<<N|y<<C|M,Ys=u}function Y(u){u.return!==null&&(X(u,1),k(u,1,0))}function Q(u){for(;u===Cd;)Cd=tc[--nc],tc[nc]=null,Rd=tc[--nc],tc[nc]=null;for(;u===zo;)zo=wr[--Tr],wr[Tr]=null,Ys=wr[--Tr],wr[Tr]=null,qs=wr[--Tr],wr[Tr]=null}function te(u,f){b(ka,f),b(th,u),b(pi,null),u=d3(f),g(pi),b(pi,u)}function ee(){g(pi),g(th),g(ka)}function ie(u){u.memoizedState!==null&&b(Dd,u);var f=pi.current,y=p3(f,u.type);f!==y&&(b(th,u),b(pi,y))}function re(u){th.current===u&&(g(pi),g(th)),Dd.current===u&&(g(Dd),js?Po._currentValue=Ql:Po._currentValue2=Ql)}function de(u){var f=Error(r(418,""));throw J(G(f,u)),Sv}function Ae(u,f){if(!Er)throw Error(r(175));oU(u.stateNode,u.type,u.memoizedProps,f,u)||de(u)}function Me(u){for(Li=u.return;Li;)switch(Li.tag){case 3:case 27:fs=!0;return;case 5:case 13:fs=!1;return;default:Li=Li.return}}function ve(u){if(!Er||u!==Li)return!1;if(!qt)return Me(u),qt=!0,!1;var f=!1;if(Mi?u.tag!==3&&u.tag!==27&&(u.tag!==5||RS(u.type)&&!Md(u.type,u.memoizedProps))&&(f=!0):u.tag!==3&&(u.tag!==5||RS(u.type)&&!Md(u.type,u.memoizedProps))&&(f=!0),f&&wi&&de(u),Me(u),u.tag===13){if(!Er)throw Error(r(316));if(u=u.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(r(317));wi=uU(u)}else wi=Li?AS(u.stateNode):null;return!0}function fe(){Er&&(wi=Li=null,qt=!1)}function J(u){Yr===null?Yr=[u]:Yr.push(u)}function oe(){for(var u=ic,f=Ev=ic=0;f<u;){var y=Ar[f];Ar[f++]=null;var M=Ar[f];Ar[f++]=null;var C=Ar[f];Ar[f++]=null;var N=Ar[f];if(Ar[f++]=null,M!==null&&C!==null){var Z=M.pending;Z===null?C.next=C:(C.next=Z.next,Z.next=C),M.pending=C}N!==0&&ye(y,C,N)}}function se(u,f,y,M){Ar[ic++]=u,Ar[ic++]=f,Ar[ic++]=y,Ar[ic++]=M,Ev|=M,u.lanes|=M,u=u.alternate,u!==null&&(u.lanes|=M)}function $(u,f,y,M){return se(u,f,y,M),xe(u)}function pe(u,f){return se(u,null,null,f),xe(u)}function ye(u,f,y){u.lanes|=y;var M=u.alternate;M!==null&&(M.lanes|=y);for(var C=!1,N=u.return;N!==null;)N.childLanes|=y,M=N.alternate,M!==null&&(M.childLanes|=y),N.tag===22&&(u=N.stateNode,u===null||u._visibility&1||(C=!0)),u=N,N=N.return;C&&f!==null&&u.tag===3&&(N=u.stateNode,C=31-ur(y),N=N.hiddenUpdates,u=N[C],u===null?N[C]=[f]:u.push(f),f.lane=y|536870912)}function xe(u){if(50<uh)throw uh=0,Bv=null,Error(r(185));for(var f=u.return;f!==null;)u=f,f=u.return;return u.tag===3?u.stateNode:null}function be(u){u!==rc&&u.next===null&&(rc===null?Ud=rc=u:rc=rc.next=u),Od=!0,Mv||(Mv=!0,Se(He))}function ue(u,f){if(!wv&&Od){wv=!0;do for(var y=!1,M=Ud;M!==null;){if(u!==0){var C=M.pendingLanes;if(C===0)var N=0;else{var Z=M.suspendedLanes,le=M.pingedLanes;N=(1<<31-ur(42|u)+1)-1,N&=C&~(Z&~le),N=N&201326677?N&201326677|1:N?N|2:0}N!==0&&(y=!0,ne(M,N))}else N=Vt,N=w(M,M===fn?N:0),(N&3)===0||T(M,N)||(y=!0,ne(M,N));M=M.next}while(y);wv=!1}}function He(){Od=Mv=!1;var u=0;sc!==0&&(S3()&&(u=sc),sc=0);for(var f=qr(),y=null,M=Ud;M!==null;){var C=M.next,N=W(M,f);N===0?(M.next=null,y===null?Ud=C:y.next=C,C===null&&(rc=y)):(y=M,(u!==0||(N&3)!==0)&&(Od=!0)),M=C}ue(u)}function W(u,f){for(var y=u.suspendedLanes,M=u.pingedLanes,C=u.expirationTimes,N=u.pendingLanes&-62914561;0<N;){var Z=31-ur(N),le=1<<Z,we=C[Z];we===-1?((le&y)===0||(le&M)!==0)&&(C[Z]=R(le,f)):we<=f&&(u.expiredLanes|=le),N&=~le}if(f=fn,y=Vt,y=w(u,u===f?y:0),M=u.callbackNode,y===0||u===f&&dn===2||u.cancelPendingCommit!==null)return M!==null&&M!==null&&xv(M),u.callbackNode=null,u.callbackPriority=0;if((y&3)===0||T(u,y)){if(f=y&-y,f===u.callbackPriority)return f;switch(M!==null&&xv(M),H(y)){case 2:case 8:y=RU;break;case 32:y=bv;break;case 268435456:y=DU;break;default:y=bv}return M=F.bind(null,u),y=Ad(y,M),u.callbackPriority=f,u.callbackNode=y,f}return M!==null&&M!==null&&xv(M),u.callbackPriority=2,u.callbackNode=null,2}function F(u,f){var y=u.callbackNode;if(Lo()&&u.callbackNode!==y)return null;var M=Vt;return M=w(u,u===fn?M:0),M===0?null:(Vb(u,M,f),W(u,qr()),u.callbackNode!=null&&u.callbackNode===y?F.bind(null,u):null)}function ne(u,f){if(Lo())return null;Vb(u,f,!0)}function Se(u){C3?R3(function(){(cn&6)!==0?Ad(BS,u):u()}):Ad(BS,u)}function _e(){return sc===0&&(sc=U()),sc}function me(u,f){if(nh===null){var y=nh=[];Tv=0,ac=_e(),oc={status:"pending",value:void 0,then:function(M){y.push(M)}}}return Tv++,f.then(ze,ze),f}function ze(){if(--Tv===0&&nh!==null){oc!==null&&(oc.status="fulfilled");var u=nh;nh=null,ac=0,oc=null;for(var f=0;f<u.length;f++)(0,u[f])()}}function Ne(u,f){var y=[],M={status:"pending",value:null,reason:null,then:function(C){y.push(C)}};return u.then(function(){M.status="fulfilled",M.value=f;for(var C=0;C<y.length;C++)(0,y[C])(f)},function(C){for(M.status="rejected",M.reason=C,C=0;C<y.length;C++)(0,y[C])(void 0)}),M}function je(u){u.updateQueue={baseState:u.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ze(u,f){u=u.updateQueue,f.updateQueue===u&&(f.updateQueue={baseState:u.baseState,firstBaseUpdate:u.firstBaseUpdate,lastBaseUpdate:u.lastBaseUpdate,shared:u.shared,callbacks:null})}function Le(u){return{lane:u,tag:0,payload:null,callback:null,next:null}}function Be(u,f,y){var M=u.updateQueue;if(M===null)return null;if(M=M.shared,(cn&2)!==0){var C=M.pending;return C===null?f.next=f:(f.next=C.next,C.next=f),M.pending=f,f=xe(u),ye(u,null,y),f}return se(u,M,f,y),xe(u)}function Ve(u,f,y){if(f=f.updateQueue,f!==null&&(f=f.shared,(y&4194176)!==0)){var M=f.lanes;M&=u.pendingLanes,y|=M,f.lanes=y,V(u,y)}}function Je(u,f){var y=u.updateQueue,M=u.alternate;if(M!==null&&(M=M.updateQueue,y===M)){var C=null,N=null;if(y=y.firstBaseUpdate,y!==null){do{var Z={lane:y.lane,tag:y.tag,payload:y.payload,callback:null,next:null};N===null?C=N=Z:N=N.next=Z,y=y.next}while(y!==null);N===null?C=N=f:N=N.next=f}else C=N=f;y={baseState:M.baseState,firstBaseUpdate:C,lastBaseUpdate:N,shared:M.shared,callbacks:M.callbacks},u.updateQueue=y;return}u=y.lastBaseUpdate,u===null?y.firstBaseUpdate=f:u.next=f,y.lastBaseUpdate=f}function We(){if(Av){var u=oc;if(u!==null)throw u}}function dt(u,f,y,M){Av=!1;var C=u.updateQueue;Ga=!1;var N=C.firstBaseUpdate,Z=C.lastBaseUpdate,le=C.shared.pending;if(le!==null){C.shared.pending=null;var we=le,Fe=we.next;we.next=null,Z===null?N=Fe:Z.next=Fe,Z=we;var Ke=u.alternate;Ke!==null&&(Ke=Ke.updateQueue,le=Ke.lastBaseUpdate,le!==Z&&(le===null?Ke.firstBaseUpdate=Fe:le.next=Fe,Ke.lastBaseUpdate=we))}if(N!==null){var ct=C.baseState;Z=0,Ke=Fe=we=null,le=N;do{var ht=le.lane&-536870913,Dt=ht!==le.lane;if(Dt?(Vt&ht)===ht:(M&ht)===ht){ht!==0&&ht===ac&&(Av=!0),Ke!==null&&(Ke=Ke.next={lane:0,tag:le.tag,payload:le.payload,callback:null,next:null});e:{var Dr=u,hh=le;ht=f;var jo=y;switch(hh.tag){case 1:if(Dr=hh.payload,typeof Dr=="function"){ct=Dr.call(jo,ct,ht);break e}ct=Dr;break e;case 3:Dr.flags=Dr.flags&-65537|128;case 0:if(Dr=hh.payload,ht=typeof Dr=="function"?Dr.call(jo,ct,ht):Dr,ht==null)break e;ct=av({},ct,ht);break e;case 2:Ga=!0}}ht=le.callback,ht!==null&&(u.flags|=64,Dt&&(u.flags|=8192),Dt=C.callbacks,Dt===null?C.callbacks=[ht]:Dt.push(ht))}else Dt={lane:ht,tag:le.tag,payload:le.payload,callback:le.callback,next:null},Ke===null?(Fe=Ke=Dt,we=ct):Ke=Ke.next=Dt,Z|=ht;if(le=le.next,le===null){if(le=C.shared.pending,le===null)break;Dt=le,le=Dt.next,Dt.next=null,C.lastBaseUpdate=Dt,C.shared.pending=null}}while(!0);Ke===null&&(we=ct),C.baseState=we,C.firstBaseUpdate=Fe,C.lastBaseUpdate=Ke,N===null&&(C.shared.lanes=0),Wa|=Z,u.lanes=Z,u.memoizedState=ct}}function ce(u,f){if(typeof u!="function")throw Error(r(191,u));u.call(f)}function Ie(u,f){var y=u.callbacks;if(y!==null)for(u.callbacks=null,u=0;u<y.length;u++)ce(y[u],f)}function Ge(u,f){if(fr(u,f))return!0;if(typeof u!="object"||u===null||typeof f!="object"||f===null)return!1;var y=Object.keys(u),M=Object.keys(f);if(y.length!==M.length)return!1;for(M=0;M<y.length;M++){var C=y[M];if(!LU.call(f,C)||!fr(u[C],f[C]))return!1}return!0}function rt(u){return u=u.status,u==="fulfilled"||u==="rejected"}function Pe(){}function De(u,f,y){switch(y=u[y],y===void 0?u.push(f):y!==f&&(f.then(Pe,Pe),f=y),f.status){case"fulfilled":return f.value;case"rejected":throw u=f.reason,u===ih?Error(r(483)):u;default:if(typeof f.status=="string")f.then(Pe,Pe);else{if(u=fn,u!==null&&100<u.shellSuspendCounter)throw Error(r(482));u=f,u.status="pending",u.then(function(M){if(f.status==="pending"){var C=f;C.status="fulfilled",C.value=M}},function(M){if(f.status==="pending"){var C=f;C.status="rejected",C.reason=M}})}switch(f.status){case"fulfilled":return f.value;case"rejected":throw u=f.reason,u===ih?Error(r(483)):u}throw lc=f,ih}}function Qe(){if(lc===null)throw Error(r(459));var u=lc;return lc=null,u}function ot(u){var f=rh;return rh+=1,cc===null&&(cc=[]),De(cc,u,f)}function st(u,f){f=f.props.ref,u.ref=f!==void 0?f:null}function mt(u,f){throw f.$$typeof===o3?Error(r(525)):(u=Object.prototype.toString.call(f),Error(r(31,u==="[object Object]"?"object with keys {"+Object.keys(f).join(", ")+"}":u)))}function on(u){var f=u._init;return f(u._payload)}function en(u){function f(Ce,Ee){if(u){var Oe=Ce.deletions;Oe===null?(Ce.deletions=[Ee],Ce.flags|=16):Oe.push(Ee)}}function y(Ce,Ee){if(!u)return null;for(;Ee!==null;)f(Ce,Ee),Ee=Ee.sibling;return null}function M(Ce){for(var Ee=new Map;Ce!==null;)Ce.key!==null?Ee.set(Ce.key,Ce):Ee.set(Ce.index,Ce),Ce=Ce.sibling;return Ee}function C(Ce,Ee){return Ce=Pa(Ce,Ee),Ce.index=0,Ce.sibling=null,Ce}function N(Ce,Ee,Oe){return Ce.index=Oe,u?(Oe=Ce.alternate,Oe!==null?(Oe=Oe.index,Oe<Ee?(Ce.flags|=33554434,Ee):Oe):(Ce.flags|=33554434,Ee)):(Ce.flags|=1048576,Ee)}function Z(Ce){return u&&Ce.alternate===null&&(Ce.flags|=33554434),Ce}function le(Ce,Ee,Oe,qe){return Ee===null||Ee.tag!==6?(Ee=iv(Oe,Ce.mode,qe),Ee.return=Ce,Ee):(Ee=C(Ee,Oe),Ee.return=Ce,Ee)}function we(Ce,Ee,Oe,qe){var yt=Oe.type;return yt===Jl?Ke(Ce,Ee,Oe.props.children,qe,Oe.key):Ee!==null&&(Ee.elementType===yt||typeof yt=="object"&&yt!==null&&yt.$$typeof===Fa&&on(yt)===Ee.type)?(Ee=C(Ee,Oe.props),st(Ee,Oe),Ee.return=Ce,Ee):(Ee=bd(Oe.type,Oe.key,Oe.props,null,Ce.mode,qe),st(Ee,Oe),Ee.return=Ce,Ee)}function Fe(Ce,Ee,Oe,qe){return Ee===null||Ee.tag!==4||Ee.stateNode.containerInfo!==Oe.containerInfo||Ee.stateNode.implementation!==Oe.implementation?(Ee=rv(Oe,Ce.mode,qe),Ee.return=Ce,Ee):(Ee=C(Ee,Oe.children||[]),Ee.return=Ce,Ee)}function Ke(Ce,Ee,Oe,qe,yt){return Ee===null||Ee.tag!==7?(Ee=Io(Oe,Ce.mode,qe,yt),Ee.return=Ce,Ee):(Ee=C(Ee,Oe),Ee.return=Ce,Ee)}function ct(Ce,Ee,Oe){if(typeof Ee=="string"&&Ee!==""||typeof Ee=="number"||typeof Ee=="bigint")return Ee=iv(""+Ee,Ce.mode,Oe),Ee.return=Ce,Ee;if(typeof Ee=="object"&&Ee!==null){switch(Ee.$$typeof){case Sd:return Oe=bd(Ee.type,Ee.key,Ee.props,null,Ce.mode,Oe),st(Oe,Ee),Oe.return=Ce,Oe;case Kl:return Ee=rv(Ee,Ce.mode,Oe),Ee.return=Ce,Ee;case Fa:var qe=Ee._init;return Ee=qe(Ee._payload),ct(Ce,Ee,Oe)}if(Ed(Ee)||s(Ee))return Ee=Io(Ee,Ce.mode,Oe,null),Ee.return=Ce,Ee;if(typeof Ee.then=="function")return ct(Ce,ot(Ee),Oe);if(Ee.$$typeof===za)return ct(Ce,md(Ce,Ee),Oe);mt(Ce,Ee)}return null}function ht(Ce,Ee,Oe,qe){var yt=Ee!==null?Ee.key:null;if(typeof Oe=="string"&&Oe!==""||typeof Oe=="number"||typeof Oe=="bigint")return yt!==null?null:le(Ce,Ee,""+Oe,qe);if(typeof Oe=="object"&&Oe!==null){switch(Oe.$$typeof){case Sd:return Oe.key===yt?we(Ce,Ee,Oe,qe):null;case Kl:return Oe.key===yt?Fe(Ce,Ee,Oe,qe):null;case Fa:return yt=Oe._init,Oe=yt(Oe._payload),ht(Ce,Ee,Oe,qe)}if(Ed(Oe)||s(Oe))return yt!==null?null:Ke(Ce,Ee,Oe,qe,null);if(typeof Oe.then=="function")return ht(Ce,Ee,ot(Oe),qe);if(Oe.$$typeof===za)return ht(Ce,Ee,md(Ce,Oe),qe);mt(Ce,Oe)}return null}function Dt(Ce,Ee,Oe,qe,yt){if(typeof qe=="string"&&qe!==""||typeof qe=="number"||typeof qe=="bigint")return Ce=Ce.get(Oe)||null,le(Ee,Ce,""+qe,yt);if(typeof qe=="object"&&qe!==null){switch(qe.$$typeof){case Sd:return Ce=Ce.get(qe.key===null?Oe:qe.key)||null,we(Ee,Ce,qe,yt);case Kl:return Ce=Ce.get(qe.key===null?Oe:qe.key)||null,Fe(Ee,Ce,qe,yt);case Fa:var yn=qe._init;return qe=yn(qe._payload),Dt(Ce,Ee,Oe,qe,yt)}if(Ed(qe)||s(qe))return Ce=Ce.get(Oe)||null,Ke(Ee,Ce,qe,yt,null);if(typeof qe.then=="function")return Dt(Ce,Ee,Oe,ot(qe),yt);if(qe.$$typeof===za)return Dt(Ce,Ee,Oe,md(Ee,qe),yt);mt(Ee,qe)}return null}function Dr(Ce,Ee,Oe,qe){for(var yt=null,yn=null,Et=Ee,Yt=Ee=0,ci=null;Et!==null&&Yt<Oe.length;Yt++){Et.index>Yt?(ci=Et,Et=null):ci=Et.sibling;var Zt=ht(Ce,Et,Oe[Yt],qe);if(Zt===null){Et===null&&(Et=ci);break}u&&Et&&Zt.alternate===null&&f(Ce,Et),Ee=N(Zt,Ee,Yt),yn===null?yt=Zt:yn.sibling=Zt,yn=Zt,Et=ci}if(Yt===Oe.length)return y(Ce,Et),qt&&X(Ce,Yt),yt;if(Et===null){for(;Yt<Oe.length;Yt++)Et=ct(Ce,Oe[Yt],qe),Et!==null&&(Ee=N(Et,Ee,Yt),yn===null?yt=Et:yn.sibling=Et,yn=Et);return qt&&X(Ce,Yt),yt}for(Et=M(Et);Yt<Oe.length;Yt++)ci=Dt(Et,Ce,Yt,Oe[Yt],qe),ci!==null&&(u&&ci.alternate!==null&&Et.delete(ci.key===null?Yt:ci.key),Ee=N(ci,Ee,Yt),yn===null?yt=ci:yn.sibling=ci,yn=ci);return u&&Et.forEach(function(ja){return f(Ce,ja)}),qt&&X(Ce,Yt),yt}function hh(Ce,Ee,Oe,qe){if(Oe==null)throw Error(r(151));for(var yt=null,yn=null,Et=Ee,Yt=Ee=0,ci=null,Zt=Oe.next();Et!==null&&!Zt.done;Yt++,Zt=Oe.next()){Et.index>Yt?(ci=Et,Et=null):ci=Et.sibling;var ja=ht(Ce,Et,Zt.value,qe);if(ja===null){Et===null&&(Et=ci);break}u&&Et&&ja.alternate===null&&f(Ce,Et),Ee=N(ja,Ee,Yt),yn===null?yt=ja:yn.sibling=ja,yn=ja,Et=ci}if(Zt.done)return y(Ce,Et),qt&&X(Ce,Yt),yt;if(Et===null){for(;!Zt.done;Yt++,Zt=Oe.next())Zt=ct(Ce,Zt.value,qe),Zt!==null&&(Ee=N(Zt,Ee,Yt),yn===null?yt=Zt:yn.sibling=Zt,yn=Zt);return qt&&X(Ce,Yt),yt}for(Et=M(Et);!Zt.done;Yt++,Zt=Oe.next())Zt=Dt(Et,Ce,Yt,Zt.value,qe),Zt!==null&&(u&&Zt.alternate!==null&&Et.delete(Zt.key===null?Yt:Zt.key),Ee=N(Zt,Ee,Yt),yn===null?yt=Zt:yn.sibling=Zt,yn=Zt);return u&&Et.forEach(function(kU){return f(Ce,kU)}),qt&&X(Ce,Yt),yt}function jo(Ce,Ee,Oe,qe){if(typeof Oe=="object"&&Oe!==null&&Oe.type===Jl&&Oe.key===null&&(Oe=Oe.props.children),typeof Oe=="object"&&Oe!==null){switch(Oe.$$typeof){case Sd:e:{for(var yt=Oe.key;Ee!==null;){if(Ee.key===yt){if(yt=Oe.type,yt===Jl){if(Ee.tag===7){y(Ce,Ee.sibling),qe=C(Ee,Oe.props.children),qe.return=Ce,Ce=qe;break e}}else if(Ee.elementType===yt||typeof yt=="object"&&yt!==null&&yt.$$typeof===Fa&&on(yt)===Ee.type){y(Ce,Ee.sibling),qe=C(Ee,Oe.props),st(qe,Oe),qe.return=Ce,Ce=qe;break e}y(Ce,Ee);break}else f(Ce,Ee);Ee=Ee.sibling}Oe.type===Jl?(qe=Io(Oe.props.children,Ce.mode,qe,Oe.key),qe.return=Ce,Ce=qe):(qe=bd(Oe.type,Oe.key,Oe.props,null,Ce.mode,qe),st(qe,Oe),qe.return=Ce,Ce=qe)}return Z(Ce);case Kl:e:{for(yt=Oe.key;Ee!==null;){if(Ee.key===yt)if(Ee.tag===4&&Ee.stateNode.containerInfo===Oe.containerInfo&&Ee.stateNode.implementation===Oe.implementation){y(Ce,Ee.sibling),qe=C(Ee,Oe.children||[]),qe.return=Ce,Ce=qe;break e}else{y(Ce,Ee);break}else f(Ce,Ee);Ee=Ee.sibling}qe=rv(Oe,Ce.mode,qe),qe.return=Ce,Ce=qe}return Z(Ce);case Fa:return yt=Oe._init,Oe=yt(Oe._payload),jo(Ce,Ee,Oe,qe)}if(Ed(Oe))return Dr(Ce,Ee,Oe,qe);if(s(Oe)){if(yt=s(Oe),typeof yt!="function")throw Error(r(150));return Oe=yt.call(Oe),hh(Ce,Ee,Oe,qe)}if(typeof Oe.then=="function")return jo(Ce,Ee,ot(Oe),qe);if(Oe.$$typeof===za)return jo(Ce,Ee,md(Ce,Oe),qe);mt(Ce,Oe)}return typeof Oe=="string"&&Oe!==""||typeof Oe=="number"||typeof Oe=="bigint"?(Oe=""+Oe,Ee!==null&&Ee.tag===6?(y(Ce,Ee.sibling),qe=C(Ee,Oe),qe.return=Ce,Ce=qe):(y(Ce,Ee),qe=iv(Oe,Ce.mode,qe),qe.return=Ce,Ce=qe),Z(Ce)):y(Ce,Ee)}return function(Ce,Ee,Oe,qe){try{rh=0;var yt=jo(Ce,Ee,Oe,qe);return cc=null,yt}catch(Et){if(Et===ih)throw Et;var yn=t(29,Et,null,Ce.mode);return yn.lanes=qe,yn.return=Ce,yn}finally{}}}function gn(u,f){u=Qs,b(Id,u),b(uc,f),Qs=u|f.baseLanes}function bn(){b(Id,Qs),b(uc,uc.current)}function xi(){Qs=Id.current,g(uc),g(Id)}function Bn(u){var f=u.alternate;b(ti,ti.current&1),b(Cr,u),ds===null&&(f===null||uc.current!==null||f.memoizedState!==null)&&(ds=u)}function Hi(u){if(u.tag===22){if(b(ti,ti.current),b(Cr,u),ds===null){var f=u.alternate;f!==null&&f.memoizedState!==null&&(ds=u)}}else kn()}function kn(){b(ti,ti.current),b(Cr,Cr.current)}function Un(u){g(Cr),ds===u&&(ds=null),g(ti)}function vn(u){for(var f=u;f!==null;){if(f.tag===13){var y=f.memoizedState;if(y!==null&&(y=y.dehydrated,y===null||gv(y)||vv(y)))return f}else if(f.tag===19&&f.memoizedProps.revealOrder!==void 0){if((f.flags&128)!==0)return f}else if(f.child!==null){f.child.return=f,f=f.child;continue}if(f===u)break;for(;f.sibling===null;){if(f.return===null||f.return===u)return null;f=f.return}f.sibling.return=f.return,f=f.sibling}return null}function jt(){throw Error(r(321))}function Ls(u,f){if(f===null)return!1;for(var y=0;y<f.length&&y<u.length;y++)if(!fr(u[y],f[y]))return!1;return!0}function Is(u,f,y,M,C,N){return Ha=N,Nt=f,f.memoizedState=null,f.updateQueue=null,f.lanes=0,wt.H=u===null||u.memoizedState===null?ko:Va,Bo=!1,N=y(M,C),Bo=!1,hc&&(N=xo(f,y,M,C)),Bl(u),N}function Bl(u){wt.H=ps;var f=ln!==null&&ln.next!==null;if(Ha=0,Xn=ln=Nt=null,Nd=!1,sh=0,fc=null,f)throw Error(r(300));u===null||oi||(u=u.dependencies,u!==null&&pd(u)&&(oi=!0))}function xo(u,f,y,M){Nt=u;var C=0;do{if(hc&&(fc=null),sh=0,hc=!1,25<=C)throw Error(r(301));if(C+=1,Xn=ln=null,u.updateQueue!=null){var N=u.updateQueue;N.lastEffect=null,N.events=null,N.stores=null,N.memoCache!=null&&(N.memoCache.index=0)}wt.H=Go,N=f(y,M)}while(hc);return N}function Ca(){var u=wt.H,f=u.useState()[0];return f=typeof f.then=="function"?Ue(f):f,u=u.useState()[0],(ln!==null?ln.memoizedState:null)!==u&&(Nt.flags|=1024),f}function Ns(){var u=Pd!==0;return Pd=0,u}function bo(u,f,y){f.updateQueue=u.updateQueue,f.flags&=-2053,u.lanes&=~y}function q(u){if(Nd){for(u=u.memoizedState;u!==null;){var f=u.queue;f!==null&&(f.pending=null),u=u.next}Nd=!1}Ha=0,Xn=ln=Nt=null,hc=!1,sh=Pd=0,fc=null}function ge(){var u={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xn===null?Nt.memoizedState=Xn=u:Xn=Xn.next=u,Xn}function Te(){if(ln===null){var u=Nt.alternate;u=u!==null?u.memoizedState:null}else u=ln.next;var f=Xn===null?Nt.memoizedState:Xn.next;if(f!==null)Xn=f,ln=u;else{if(u===null)throw Nt.alternate===null?Error(r(467)):Error(r(310));ln=u,u={memoizedState:ln.memoizedState,baseState:ln.baseState,baseQueue:ln.baseQueue,queue:ln.queue,next:null},Xn===null?Nt.memoizedState=Xn=u:Xn=Xn.next=u}return Xn}function Ue(u){var f=sh;return sh+=1,fc===null&&(fc=[]),u=De(fc,u,f),f=Nt,(Xn===null?f.memoizedState:Xn.next)===null&&(f=f.alternate,wt.H=f===null||f.memoizedState===null?ko:Va),u}function ae(u){if(u!==null&&typeof u=="object"){if(typeof u.then=="function")return Ue(u);if(u.$$typeof===za)return Si(u)}throw Error(r(438,String(u)))}function Xe(u){var f=null,y=Nt.updateQueue;if(y!==null&&(f=y.memoCache),f==null){var M=Nt.alternate;M!==null&&(M=M.updateQueue,M!==null&&(M=M.memoCache,M!=null&&(f={data:M.data.map(function(C){return C.slice()}),index:0})))}if(f==null&&(f={data:[],index:0}),y===null&&(y=Rv(),Nt.updateQueue=y),y.memoCache=f,y=f.data[f.index],y===void 0)for(y=f.data[f.index]=Array(u),M=0;M<u;M++)y[M]=c3;return f.index++,y}function $e(u,f){return typeof f=="function"?f(u):f}function lt(u){var f=Te();return at(f,ln,u)}function at(u,f,y){var M=u.queue;if(M===null)throw Error(r(311));M.lastRenderedReducer=y;var C=u.baseQueue,N=M.pending;if(N!==null){if(C!==null){var Z=C.next;C.next=N.next,N.next=Z}f.baseQueue=C=N,M.pending=null}if(N=u.baseState,C===null)u.memoizedState=N;else{f=C.next;var le=Z=null,we=null,Fe=f,Ke=!1;do{var ct=Fe.lane&-536870913;if(ct!==Fe.lane?(Vt&ct)===ct:(Ha&ct)===ct){var ht=Fe.revertLane;if(ht===0)we!==null&&(we=we.next={lane:0,revertLane:0,action:Fe.action,hasEagerState:Fe.hasEagerState,eagerState:Fe.eagerState,next:null}),ct===ac&&(Ke=!0);else if((Ha&ht)===ht){Fe=Fe.next,ht===ac&&(Ke=!0);continue}else ct={lane:0,revertLane:Fe.revertLane,action:Fe.action,hasEagerState:Fe.hasEagerState,eagerState:Fe.eagerState,next:null},we===null?(le=we=ct,Z=N):we=we.next=ct,Nt.lanes|=ht,Wa|=ht;ct=Fe.action,Bo&&y(N,ct),N=Fe.hasEagerState?Fe.eagerState:y(N,ct)}else ht={lane:ct,revertLane:Fe.revertLane,action:Fe.action,hasEagerState:Fe.hasEagerState,eagerState:Fe.eagerState,next:null},we===null?(le=we=ht,Z=N):we=we.next=ht,Nt.lanes|=ct,Wa|=ct;Fe=Fe.next}while(Fe!==null&&Fe!==f);if(we===null?Z=N:we.next=le,!fr(N,u.memoizedState)&&(oi=!0,Ke&&(y=oc,y!==null)))throw y;u.memoizedState=N,u.baseState=Z,u.baseQueue=we,M.lastRenderedState=N}return C===null&&(M.lanes=0),[u.memoizedState,M.dispatch]}function vt(u){var f=Te(),y=f.queue;if(y===null)throw Error(r(311));y.lastRenderedReducer=u;var M=y.dispatch,C=y.pending,N=f.memoizedState;if(C!==null){y.pending=null;var Z=C=C.next;do N=u(N,Z.action),Z=Z.next;while(Z!==C);fr(N,f.memoizedState)||(oi=!0),f.memoizedState=N,f.baseQueue===null&&(f.baseState=N),y.lastRenderedState=N}return[N,M]}function _t(u,f,y){var M=Nt,C=Te(),N=qt;if(N){if(y===void 0)throw Error(r(407));y=y()}else y=f();var Z=!fr((ln||C).memoizedState,y);if(Z&&(C.memoizedState=y,oi=!0),C=C.queue,Ps(Ht.bind(null,M,C,u),[u]),C.getSnapshot!==f||Z||Xn!==null&&Xn.memoizedState.tag&1){if(M.flags|=2048,ei(9,Tt.bind(null,M,C,y,f),{destroy:void 0},null),fn===null)throw Error(r(349));N||(Ha&60)!==0||pt(M,f,y)}return y}function pt(u,f,y){u.flags|=16384,u={getSnapshot:f,value:y},f=Nt.updateQueue,f===null?(f=Rv(),Nt.updateQueue=f,f.stores=[u]):(y=f.stores,y===null?f.stores=[u]:y.push(u))}function Tt(u,f,y,M){f.value=y,f.getSnapshot=M,tn(f)&&Jt(u)}function Ht(u,f,y){return y(function(){tn(f)&&Jt(u)})}function tn(u){var f=u.getSnapshot;u=u.value;try{var y=f();return!fr(u,y)}catch{return!0}}function Jt(u){var f=pe(u,2);f!==null&&Oi(f,u,2)}function kt(u){var f=ge();if(typeof u=="function"){var y=u;if(u=y(),Bo){O(!0);try{y()}finally{O(!1)}}}return f.memoizedState=f.baseState=u,f.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$e,lastRenderedState:u},f}function gt(u,f,y,M){return u.baseState=y,at(u,ln,typeof M=="function"?M:$e)}function Qt(u,f,y,M,C){if(Co(u))throw Error(r(485));if(u=f.action,u!==null){var N={payload:C,action:u,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(Z){N.listeners.push(Z)}};wt.T!==null?y(!0):N.isTransition=!1,M(N),y=f.pending,y===null?(N.next=f.pending=N,It(f,N)):(N.next=y.next,f.pending=y.next=N)}}function It(u,f){var y=f.action,M=f.payload,C=u.state;if(f.isTransition){var N=wt.T,Z={};wt.T=Z;try{var le=y(C,M),we=wt.S;we!==null&&we(Z,le),Sn(u,f,le)}catch(Fe){Gn(u,f,Fe)}finally{wt.T=N}}else try{N=y(C,M),Sn(u,f,N)}catch(Fe){Gn(u,f,Fe)}}function Sn(u,f,y){y!==null&&typeof y=="object"&&typeof y.then=="function"?y.then(function(M){rr(u,f,M)},function(M){return Gn(u,f,M)}):rr(u,f,y)}function rr(u,f,y){f.status="fulfilled",f.value=y,xr(f),u.state=y,f=u.pending,f!==null&&(y=f.next,y===f?u.pending=null:(y=y.next,f.next=y,It(u,y)))}function Gn(u,f,y){var M=u.pending;if(u.pending=null,M!==null){M=M.next;do f.status="rejected",f.reason=y,xr(f),f=f.next;while(f!==M)}u.action=null}function xr(u){u=u.listeners;for(var f=0;f<u.length;f++)(0,u[f])()}function Pt(u,f){return f}function fi(u,f){if(qt){var y=fn.formState;if(y!==null){e:{var M=Nt;if(qt){if(wi){var C=eU(wi,fs);if(C){wi=AS(C),M=tU(C);break e}}de(M)}M=!1}M&&(f=y[0])}}y=ge(),y.memoizedState=y.baseState=f,M={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pt,lastRenderedState:f},y.queue=M,y=ku.bind(null,Nt,M),M.dispatch=y,M=kt(!1);var N=Vl.bind(null,Nt,!1,M.queue);return M=ge(),C={state:f,dispatch:null,action:u,pending:null},M.queue=C,y=Qt.bind(null,Nt,C,N,y),C.dispatch=y,M.memoizedState=u,[f,y,!1]}function Vn(u){var f=Te();return xn(f,ln,u)}function xn(u,f,y){f=at(u,f,Pt)[0],u=lt($e)[0],f=typeof f=="object"&&f!==null&&typeof f.then=="function"?Ue(f):f;var M=Te(),C=M.queue,N=C.dispatch;return y!==M.memoizedState&&(Nt.flags|=2048,ei(9,$n.bind(null,C,y),{destroy:void 0},null)),[f,N,u]}function $n(u,f){u.action=f}function Wr(u){var f=Te(),y=ln;if(y!==null)return xn(f,y,u);Te(),f=f.memoizedState,y=Te();var M=y.queue.dispatch;return y.memoizedState=u,[f,M,!1]}function ei(u,f,y,M){return u={tag:u,create:f,inst:y,deps:M,next:null},f=Nt.updateQueue,f===null&&(f=Rv(),Nt.updateQueue=f),y=f.lastEffect,y===null?f.lastEffect=u.next=u:(M=y.next,y.next=u,u.next=M,f.lastEffect=u),u}function kl(){return Te().memoizedState}function So(u,f,y,M){var C=ge();Nt.flags|=u,C.memoizedState=ei(1|f,y,{destroy:void 0},M===void 0?null:M)}function Eo(u,f,y,M){var C=Te();M=M===void 0?null:M;var N=C.memoizedState.inst;ln!==null&&M!==null&&Ls(M,ln.memoizedState.deps)?C.memoizedState=ei(f,y,N,M):(Nt.flags|=u,C.memoizedState=ei(1|f,y,N,M))}function Gl(u,f){So(8390656,8,u,f)}function Ps(u,f){Eo(2048,8,u,f)}function Nu(u,f){return Eo(4,2,u,f)}function Mo(u,f){return Eo(4,4,u,f)}function zs(u,f){if(typeof f=="function"){u=u();var y=f(u);return function(){typeof y=="function"?y():f(null)}}if(f!=null)return u=u(),f.current=u,function(){f.current=null}}function Fs(u,f,y){y=y!=null?y.concat([u]):null,Eo(4,4,zs.bind(null,f,u),y)}function Bs(){}function Pu(u,f){var y=Te();f=f===void 0?null:f;var M=y.memoizedState;return f!==null&&Ls(f,M[1])?M[0]:(y.memoizedState=[u,f],u)}function Ra(u,f){var y=Te();f=f===void 0?null:f;var M=y.memoizedState;if(f!==null&&Ls(f,M[1]))return M[0];if(M=u(),Bo){O(!0);try{u()}finally{O(!1)}}return y.memoizedState=[M,f],M}function wo(u,f,y){return y===void 0||(Ha&1073741824)!==0?u.memoizedState=f:(u.memoizedState=y,u=Hb(),Nt.lanes|=u,Wa|=u,y)}function Hl(u,f,y,M){return fr(y,f)?y:uc.current!==null?(u=wo(u,y,M),fr(u,f)||(oi=!0),u):(Ha&42)===0?(oi=!0,u.memoizedState=y):(u=Hb(),Nt.lanes|=u,Wa|=u,f)}function zu(u,f,y,M,C){var N=No();ji(N!==0&&8>N?N:8);var Z=wt.T,le={};wt.T=le,Vl(u,!1,f,y);try{var we=C(),Fe=wt.S;if(Fe!==null&&Fe(le,we),we!==null&&typeof we=="object"&&typeof we.then=="function"){var Ke=Ne(we,M);ks(u,f,Ke,lr(u))}else ks(u,f,M,lr(u))}catch(ct){ks(u,f,{then:function(){},status:"rejected",reason:ct},lr())}finally{ji(N),wt.T=Z}}function To(u){var f=u.memoizedState;if(f!==null)return f;f={memoizedState:Ql,baseState:Ql,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$e,lastRenderedState:Ql},next:null};var y={};return f.next={memoizedState:y,baseState:y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$e,lastRenderedState:y},next:null},u.memoizedState=f,u=u.alternate,u!==null&&(u.memoizedState=f),f}function Ao(){return Si(Po)}function Fu(){return Te().memoizedState}function Vi(){return Te().memoizedState}function Bu(u){for(var f=u.return;f!==null;){switch(f.tag){case 24:case 3:var y=lr();u=Le(y);var M=Be(f,u,y);M!==null&&(Oi(M,f,y),Ve(M,f,y)),f={cache:P0()},u.payload=f;return}f=f.return}}function fd(u,f,y){var M=lr();y={lane:M,revertLane:0,action:y,hasEagerState:!1,eagerState:null,next:null},Co(u)?Da(f,y):(y=$(u,f,y,M),y!==null&&(Oi(y,u,M),Ua(y,f,M)))}function ku(u,f,y){var M=lr();ks(u,f,y,M)}function ks(u,f,y,M){var C={lane:M,revertLane:0,action:y,hasEagerState:!1,eagerState:null,next:null};if(Co(u))Da(f,C);else{var N=u.alternate;if(u.lanes===0&&(N===null||N.lanes===0)&&(N=f.lastRenderedReducer,N!==null))try{var Z=f.lastRenderedState,le=N(Z,y);if(C.hasEagerState=!0,C.eagerState=le,fr(le,Z))return se(u,f,C,0),fn===null&&oe(),!1}catch{}finally{}if(y=$(u,f,C,M),y!==null)return Oi(y,u,M),Ua(y,f,M),!0}return!1}function Vl(u,f,y,M){if(M={lane:2,revertLane:_e(),action:M,hasEagerState:!1,eagerState:null,next:null},Co(u)){if(f)throw Error(r(479))}else f=$(u,y,M,2),f!==null&&Oi(f,u,2)}function Co(u){var f=u.alternate;return u===Nt||f!==null&&f===Nt}function Da(u,f){hc=Nd=!0;var y=u.pending;y===null?f.next=f:(f.next=y.next,y.next=f),u.pending=f}function Ua(u,f,y){if((y&4194176)!==0){var M=f.lanes;M&=u.pendingLanes,y|=M,f.lanes=y,V(u,y)}}function br(u,f,y,M){f=u.memoizedState,y=y(M,f),y=y==null?f:av({},f,y),u.memoizedState=y,u.lanes===0&&(u.updateQueue.baseState=y)}function Gu(u,f,y,M,C,N,Z){return u=u.stateNode,typeof u.shouldComponentUpdate=="function"?u.shouldComponentUpdate(M,N,Z):f.prototype&&f.prototype.isPureReactComponent?!Ge(y,M)||!Ge(C,N):!0}function Wl(u,f,y,M){u=f.state,typeof f.componentWillReceiveProps=="function"&&f.componentWillReceiveProps(y,M),typeof f.UNSAFE_componentWillReceiveProps=="function"&&f.UNSAFE_componentWillReceiveProps(y,M),f.state!==u&&Dv.enqueueReplaceState(f,f.state,null)}function Xr(u,f){var y=f;if("ref"in f){y={};for(var M in f)M!=="ref"&&(y[M]=f[M])}if(u=u.defaultProps){y===f&&(y=av({},y));for(var C in u)y[C]===void 0&&(y[C]=u[C])}return y}function hs(u,f){try{var y=u.onUncaughtError;y(f.value,{componentStack:f.stack})}catch(M){setTimeout(function(){throw M})}}function Hu(u,f,y){try{var M=u.onCaughtError;M(y.value,{componentStack:y.stack,errorBoundary:f.tag===1?f.stateNode:null})}catch(C){setTimeout(function(){throw C})}}function Gs(u,f,y){return y=Le(y),y.tag=3,y.payload={element:null},y.callback=function(){hs(u,f)},y}function Xl(u){return u=Le(u),u.tag=3,u}function bi(u,f,y,M){var C=y.type.getDerivedStateFromError;if(typeof C=="function"){var N=M.value;u.payload=function(){return C(N)},u.callback=function(){Hu(f,y,M)}}var Z=y.stateNode;Z!==null&&typeof Z.componentDidCatch=="function"&&(u.callback=function(){Hu(f,y,M),typeof C!="function"&&(Xa===null?Xa=new Set([this]):Xa.add(this));var le=M.stack;this.componentDidCatch(M.value,{componentStack:le!==null?le:""})})}function T0(u,f,y,M,C){if(y.flags|=32768,M!==null&&typeof M=="object"&&typeof M.then=="function"){if(f=y.alternate,f!==null&&Xu(f,y,C,!0),y=Cr.current,y!==null){switch(y.tag){case 13:return ds===null?$0():y.alternate===null&&Nn===0&&(Nn=3),y.flags&=-257,y.flags|=65536,y.lanes=C,M===Ld?y.flags|=16384:(f=y.updateQueue,f===null?y.updateQueue=new Set([M]):f.add(M),tv(u,M,C)),!1;case 22:return y.flags|=65536,M===Ld?y.flags|=16384:(f=y.updateQueue,f===null?(f={transitions:null,markerInstances:null,retryQueue:new Set([M])},y.updateQueue=f):(y=f.retryQueue,y===null?f.retryQueue=new Set([M]):y.add(M)),tv(u,M,C)),!1}throw Error(r(435,y.tag))}return tv(u,M,C),$0(),!1}if(qt)return f=Cr.current,f!==null?((f.flags&65536)===0&&(f.flags|=256),f.flags|=65536,f.lanes=C,M!==Sv&&(u=Error(r(422),{cause:M}),J(G(u,y)))):(M!==Sv&&(f=Error(r(423),{cause:M}),J(G(f,y))),u=u.current.alternate,u.flags|=65536,C&=-C,u.lanes|=C,M=G(M,y),C=Gs(u.stateNode,M,C),Je(u,C),Nn!==4&&(Nn=2)),!1;var N=Error(r(520),{cause:M});if(N=G(N,y),oh===null?oh=[N]:oh.push(N),Nn!==4&&(Nn=2),f===null)return!0;M=G(M,y),y=f;do{switch(y.tag){case 3:return y.flags|=65536,u=C&-C,y.lanes|=u,u=Gs(y.stateNode,M,u),Je(y,u),!1;case 1:if(f=y.type,N=y.stateNode,(y.flags&128)===0&&(typeof f.getDerivedStateFromError=="function"||N!==null&&typeof N.componentDidCatch=="function"&&(Xa===null||!Xa.has(N))))return y.flags|=65536,C&=-C,y.lanes|=C,C=Xl(C),bi(C,u,y,M),Je(y,C),!1}y=y.return}while(y!==null);return!1}function On(u,f,y,M){f.child=u===null?GS(f,null,y,M):Fo(f,u.child,y,M)}function Ro(u,f,y,M,C){y=y.render;var N=f.ref;if("ref"in M){var Z={};for(var le in M)le!=="ref"&&(Z[le]=M[le])}else Z=M;return Do(f),M=Is(u,f,y,Z,N,C),le=Ns(),u!==null&&!oi?(bo(u,f,C),Hs(u,f,C)):(qt&&le&&Y(f),f.flags|=1,On(u,f,M,C),f.child)}function Vu(u,f,y,M,C){if(u===null){var N=y.type;return typeof N=="function"&&!nv(N)&&N.defaultProps===void 0&&y.compare===null?(f.tag=15,f.type=N,dd(u,f,N,M,C)):(u=bd(y.type,null,M,f,f.mode,C),u.ref=f.ref,u.return=f,f.child=u)}if(N=u.child,!L0(u,C)){var Z=N.memoizedProps;if(y=y.compare,y=y!==null?y:Ge,y(Z,M)&&u.ref===f.ref)return Hs(u,f,C)}return f.flags|=1,u=Pa(N,M),u.ref=f.ref,u.return=f,f.child=u}function dd(u,f,y,M,C){if(u!==null){var N=u.memoizedProps;if(Ge(N,M)&&u.ref===f.ref)if(oi=!1,f.pendingProps=M=N,L0(u,C))(u.flags&131072)!==0&&(oi=!0);else return f.lanes=u.lanes,Hs(u,f,C)}return Sr(u,f,y,M,C)}function di(u,f,y){var M=f.pendingProps,C=M.children,N=(f.stateNode._pendingVisibility&2)!==0,Z=u!==null?u.memoizedState:null;if(Wn(u,f),M.mode==="hidden"||N){if((f.flags&128)!==0){if(M=Z!==null?Z.baseLanes|y:y,u!==null){for(C=f.child=u.child,N=0;C!==null;)N=N|C.lanes|C.childLanes,C=C.sibling;f.childLanes=N&~M}else f.childLanes=0,f.child=null;return Wi(u,f,M,y)}if((y&536870912)!==0)f.memoizedState={baseLanes:0,cachePool:null},u!==null&&gd(f,Z!==null?Z.cachePool:null),Z!==null?gn(f,Z):bn(),Hi(f);else return f.lanes=f.childLanes=536870912,Wi(u,f,Z!==null?Z.baseLanes|y:y,y)}else Z!==null?(gd(f,Z.cachePool),gn(f,Z),kn(),f.memoizedState=null):(u!==null&&gd(f,null),bn(),kn());return On(u,f,C,y),f.child}function Wi(u,f,y,M){var C=z0();return C=C===null?null:{parent:js?Ln._currentValue:Ln._currentValue2,pool:C},f.memoizedState={baseLanes:y,cachePool:C},u!==null&&gd(f,null),bn(),Hi(f),u!==null&&Xu(u,f,M,!0),null}function Wn(u,f){var y=f.ref;if(y===null)u!==null&&u.ref!==null&&(f.flags|=2097664);else{if(typeof y!="function"&&typeof y!="object")throw Error(r(284));(u===null||u.ref!==y)&&(f.flags|=2097664)}}function Sr(u,f,y,M,C){return Do(f),y=Is(u,f,y,M,void 0,C),M=Ns(),u!==null&&!oi?(bo(u,f,C),Hs(u,f,C)):(qt&&M&&Y(f),f.flags|=1,On(u,f,y,C),f.child)}function Wu(u,f,y,M,C,N){return Do(f),f.updateQueue=null,y=xo(f,M,y,C),Bl(u),M=Ns(),u!==null&&!oi?(bo(u,f,N),Hs(u,f,N)):(qt&&M&&Y(f),f.flags|=1,On(u,f,y,N),f.child)}function fb(u,f,y,M,C){if(Do(f),f.stateNode===null){var N=ec,Z=y.contextType;typeof Z=="object"&&Z!==null&&(N=Si(Z)),N=new y(M,N),f.memoizedState=N.state!==null&&N.state!==void 0?N.state:null,N.updater=Dv,f.stateNode=N,N._reactInternals=f,N=f.stateNode,N.props=M,N.state=f.memoizedState,N.refs={},je(f),Z=y.contextType,N.context=typeof Z=="object"&&Z!==null?Si(Z):ec,N.state=f.memoizedState,Z=y.getDerivedStateFromProps,typeof Z=="function"&&(br(f,y,Z,M),N.state=f.memoizedState),typeof y.getDerivedStateFromProps=="function"||typeof N.getSnapshotBeforeUpdate=="function"||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(Z=N.state,typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount(),Z!==N.state&&Dv.enqueueReplaceState(N,N.state,null),dt(f,M,N,C),We(),N.state=f.memoizedState),typeof N.componentDidMount=="function"&&(f.flags|=4194308),M=!0}else if(u===null){N=f.stateNode;var le=f.memoizedProps,we=Xr(y,le);N.props=we;var Fe=N.context,Ke=y.contextType;Z=ec,typeof Ke=="object"&&Ke!==null&&(Z=Si(Ke));var ct=y.getDerivedStateFromProps;Ke=typeof ct=="function"||typeof N.getSnapshotBeforeUpdate=="function",le=f.pendingProps!==le,Ke||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(le||Fe!==Z)&&Wl(f,N,M,Z),Ga=!1;var ht=f.memoizedState;N.state=ht,dt(f,M,N,C),We(),Fe=f.memoizedState,le||ht!==Fe||Ga?(typeof ct=="function"&&(br(f,y,ct,M),Fe=f.memoizedState),(we=Ga||Gu(f,y,we,M,ht,Fe,Z))?(Ke||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount()),typeof N.componentDidMount=="function"&&(f.flags|=4194308)):(typeof N.componentDidMount=="function"&&(f.flags|=4194308),f.memoizedProps=M,f.memoizedState=Fe),N.props=M,N.state=Fe,N.context=Z,M=we):(typeof N.componentDidMount=="function"&&(f.flags|=4194308),M=!1)}else{N=f.stateNode,Ze(u,f),Z=f.memoizedProps,Ke=Xr(y,Z),N.props=Ke,ct=f.pendingProps,ht=N.context,Fe=y.contextType,we=ec,typeof Fe=="object"&&Fe!==null&&(we=Si(Fe)),le=y.getDerivedStateFromProps,(Fe=typeof le=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(Z!==ct||ht!==we)&&Wl(f,N,M,we),Ga=!1,ht=f.memoizedState,N.state=ht,dt(f,M,N,C),We();var Dt=f.memoizedState;Z!==ct||ht!==Dt||Ga||u!==null&&u.dependencies!==null&&pd(u.dependencies)?(typeof le=="function"&&(br(f,y,le,M),Dt=f.memoizedState),(Ke=Ga||Gu(f,y,Ke,M,ht,Dt,we)||u!==null&&u.dependencies!==null&&pd(u.dependencies))?(Fe||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(M,Dt,we),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(M,Dt,we)),typeof N.componentDidUpdate=="function"&&(f.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(f.flags|=1024)):(typeof N.componentDidUpdate!="function"||Z===u.memoizedProps&&ht===u.memoizedState||(f.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||Z===u.memoizedProps&&ht===u.memoizedState||(f.flags|=1024),f.memoizedProps=M,f.memoizedState=Dt),N.props=M,N.state=Dt,N.context=we,M=Ke):(typeof N.componentDidUpdate!="function"||Z===u.memoizedProps&&ht===u.memoizedState||(f.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||Z===u.memoizedProps&&ht===u.memoizedState||(f.flags|=1024),M=!1)}return N=M,Wn(u,f),M=(f.flags&128)!==0,N||M?(N=f.stateNode,y=M&&typeof y.getDerivedStateFromError!="function"?null:N.render(),f.flags|=1,u!==null&&M?(f.child=Fo(f,u.child,null,C),f.child=Fo(f,null,y,C)):On(u,f,y,C),f.memoizedState=N.state,u=f.child):u=Hs(u,f,C),u}function db(u,f,y,M){return fe(),f.flags|=256,On(u,f,y,M),f.child}function A0(u){return{baseLanes:u,cachePool:_b()}}function C0(u,f,y){return u=u!==null?u.childLanes&~y:0,f&&(u|=Rr),u}function pb(u,f,y){var M=f.pendingProps,C=!1,N=(f.flags&128)!==0,Z;if((Z=N)||(Z=u!==null&&u.memoizedState===null?!1:(ti.current&2)!==0),Z&&(C=!0,f.flags&=-129),Z=(f.flags&32)!==0,f.flags&=-33,u===null){if(qt){if(C?Bn(f):kn(),qt){var le=wi,we;(we=le)&&(le=aU(le,fs),le!==null?(f.memoizedState={dehydrated:le,treeContext:zo!==null?{id:qs,overflow:Ys}:null,retryLane:536870912},we=t(18,null,null,0),we.stateNode=le,we.return=f,f.child=we,Li=f,wi=null,we=!0):we=!1),we||de(f)}if(le=f.memoizedState,le!==null&&(le=le.dehydrated,le!==null))return vv(le)?f.lanes=16:f.lanes=536870912,null;Un(f)}return le=M.children,M=M.fallback,C?(kn(),C=f.mode,le=D0({mode:"hidden",children:le},C),M=Io(M,C,y,null),le.return=f,M.return=f,le.sibling=M,f.child=le,C=f.child,C.memoizedState=A0(y),C.childLanes=C0(u,Z,y),f.memoizedState=Uv,M):(Bn(f),R0(f,le))}if(we=u.memoizedState,we!==null&&(le=we.dehydrated,le!==null)){if(N)f.flags&256?(Bn(f),f.flags&=-257,f=U0(u,f,y)):f.memoizedState!==null?(kn(),f.child=u.child,f.flags|=128,f=null):(kn(),C=M.fallback,le=f.mode,M=D0({mode:"visible",children:M.children},le),C=Io(C,le,y,null),C.flags|=2,M.return=f,C.return=f,M.sibling=C,f.child=M,Fo(f,u.child,null,y),M=f.child,M.memoizedState=A0(y),M.childLanes=C0(u,Z,y),f.memoizedState=Uv,f=C);else if(Bn(f),vv(le))Z=Q3(le).digest,M=Error(r(419)),M.stack="",M.digest=Z,J({value:M,source:null,stack:null}),f=U0(u,f,y);else if(oi||Xu(u,f,y,!1),Z=(y&u.childLanes)!==0,oi||Z){if(Z=fn,Z!==null){if(M=y&-y,(M&42)!==0)M=1;else switch(M){case 2:M=1;break;case 8:M=4;break;case 32:M=16;break;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:M=64;break;case 268435456:M=134217728;break;default:M=0}if(M=(M&(Z.suspendedLanes|y))!==0?0:M,M!==0&&M!==we.retryLane)throw we.retryLane=M,pe(u,M),Oi(Z,u,M),VS}gv(le)||$0(),f=U0(u,f,y)}else gv(le)?(f.flags|=128,f.child=u.child,f=t3.bind(null,u),$3(le,f),f=null):(u=we.treeContext,Er&&(wi=iU(le),Li=f,qt=!0,Yr=null,fs=!1,u!==null&&(wr[Tr++]=qs,wr[Tr++]=Ys,wr[Tr++]=zo,qs=u.id,Ys=u.overflow,zo=f)),f=R0(f,M.children),f.flags|=4096);return f}return C?(kn(),C=M.fallback,le=f.mode,we=u.child,N=we.sibling,M=Pa(we,{mode:"hidden",children:M.children}),M.subtreeFlags=we.subtreeFlags&31457280,N!==null?C=Pa(N,C):(C=Io(C,le,y,null),C.flags|=2),C.return=f,M.return=f,M.sibling=C,f.child=M,M=C,C=f.child,le=u.child.memoizedState,le===null?le=A0(y):(we=le.cachePool,we!==null?(N=js?Ln._currentValue:Ln._currentValue2,we=we.parent!==N?{parent:N,pool:N}:we):we=_b(),le={baseLanes:le.baseLanes|y,cachePool:we}),C.memoizedState=le,C.childLanes=C0(u,Z,y),f.memoizedState=Uv,M):(Bn(f),y=u.child,u=y.sibling,y=Pa(y,{mode:"visible",children:M.children}),y.return=f,y.sibling=null,u!==null&&(Z=f.deletions,Z===null?(f.deletions=[u],f.flags|=16):Z.push(u)),f.child=y,f.memoizedState=null,y)}function R0(u,f){return f=D0({mode:"visible",children:f},u.mode),f.return=u,u.child=f}function D0(u,f){return rS(u,f,0,null)}function U0(u,f,y){return Fo(f,u.child,null,y),u=R0(f,f.pendingProps.children),u.flags|=2,f.memoizedState=null,u}function mb(u,f,y){u.lanes|=f;var M=u.alternate;M!==null&&(M.lanes|=f),I0(u.return,f,y)}function O0(u,f,y,M,C){var N=u.memoizedState;N===null?u.memoizedState={isBackwards:f,rendering:null,renderingStartTime:0,last:M,tail:y,tailMode:C}:(N.isBackwards=f,N.rendering=null,N.renderingStartTime=0,N.last=M,N.tail=y,N.tailMode=C)}function gb(u,f,y){var M=f.pendingProps,C=M.revealOrder,N=M.tail;if(On(u,f,M.children,y),M=ti.current,(M&2)!==0)M=M&1|2,f.flags|=128;else{if(u!==null&&(u.flags&128)!==0)e:for(u=f.child;u!==null;){if(u.tag===13)u.memoizedState!==null&&mb(u,y,f);else if(u.tag===19)mb(u,y,f);else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===f)break e;for(;u.sibling===null;){if(u.return===null||u.return===f)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}M&=1}switch(b(ti,M),C){case"forwards":for(y=f.child,C=null;y!==null;)u=y.alternate,u!==null&&vn(u)===null&&(C=y),y=y.sibling;y=C,y===null?(C=f.child,f.child=null):(C=y.sibling,y.sibling=null),O0(f,!1,C,y,N);break;case"backwards":for(y=null,C=f.child,f.child=null;C!==null;){if(u=C.alternate,u!==null&&vn(u)===null){f.child=C;break}u=C.sibling,C.sibling=y,y=C,C=u}O0(f,!0,y,null,N);break;case"together":O0(f,!1,null,null,void 0);break;default:f.memoizedState=null}return f.child}function Hs(u,f,y){if(u!==null&&(f.dependencies=u.dependencies),Wa|=f.lanes,(y&f.childLanes)===0)if(u!==null){if(Xu(u,f,y,!1),(y&f.childLanes)===0)return null}else return null;if(u!==null&&f.child!==u.child)throw Error(r(153));if(f.child!==null){for(u=f.child,y=Pa(u,u.pendingProps),f.child=y,y.return=f;u.sibling!==null;)u=u.sibling,y=y.sibling=Pa(u,u.pendingProps),y.return=f;y.sibling=null}return f.child}function L0(u,f){return(u.lanes&f)!==0?!0:(u=u.dependencies,!!(u!==null&&pd(u)))}function WD(u,f,y){switch(f.tag){case 3:te(f,f.stateNode.containerInfo),Oa(f,Ln,u.memoizedState.cache),fe();break;case 27:case 5:ie(f);break;case 4:te(f,f.stateNode.containerInfo);break;case 10:Oa(f,f.type,f.memoizedProps.value);break;case 13:var M=f.memoizedState;if(M!==null)return M.dehydrated!==null?(Bn(f),f.flags|=128,null):(y&f.child.childLanes)!==0?pb(u,f,y):(Bn(f),u=Hs(u,f,y),u!==null?u.sibling:null);Bn(f);break;case 19:var C=(u.flags&128)!==0;if(M=(y&f.childLanes)!==0,M||(Xu(u,f,y,!1),M=(y&f.childLanes)!==0),C){if(M)return gb(u,f,y);f.flags|=128}if(C=f.memoizedState,C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),b(ti,ti.current),M)break;return null;case 22:case 23:return f.lanes=0,di(u,f,y);case 24:Oa(f,Ln,u.memoizedState.cache)}return Hs(u,f,y)}function vb(u,f,y){if(u!==null)if(u.memoizedProps!==f.pendingProps)oi=!0;else{if(!L0(u,y)&&(f.flags&128)===0)return oi=!1,WD(u,f,y);oi=(u.flags&131072)!==0}else oi=!1,qt&&(f.flags&1048576)!==0&&k(f,Rd,f.index);switch(f.lanes=0,f.tag){case 16:e:{u=f.pendingProps;var M=f.elementType,C=M._init;if(M=C(M._payload),f.type=M,typeof M=="function")nv(M)?(u=Xr(M,u),f.tag=1,f=fb(null,f,M,u,y)):(f.tag=0,f=Sr(null,f,M,u,y));else{if(M!=null){if(C=M.$$typeof,C===lv){f.tag=11,f=Ro(null,f,M,u,y);break e}else if(C===hv){f.tag=14,f=Vu(null,f,M,u,y);break e}}throw f=a(M)||M,Error(r(306,f,""))}}return f;case 0:return Sr(u,f,f.type,f.pendingProps,y);case 1:return M=f.type,C=Xr(M,f.pendingProps),fb(u,f,M,C,y);case 3:e:{if(te(f,f.stateNode.containerInfo),u===null)throw Error(r(387));var N=f.pendingProps;C=f.memoizedState,M=C.element,Ze(u,f),dt(f,N,null,y);var Z=f.memoizedState;if(N=Z.cache,Oa(f,Ln,N),N!==C.cache&&N0(f,[Ln],y,!0),We(),N=Z.element,Er&&C.isDehydrated)if(C={element:N,isDehydrated:!1,cache:Z.cache},f.updateQueue.baseState=C,f.memoizedState=C,f.flags&256){f=db(u,f,N,y);break e}else if(N!==M){M=G(Error(r(424)),f),J(M),f=db(u,f,N,y);break e}else for(Er&&(wi=nU(f.stateNode.containerInfo),Li=f,qt=!0,Yr=null,fs=!0),y=GS(f,null,N,y),f.child=y;y;)y.flags=y.flags&-3|4096,y=y.sibling;else{if(fe(),N===M){f=Hs(u,f,y);break e}On(u,f,N,y)}f=f.child}return f;case 26:if(Mr)return Wn(u,f),u===null?(y=US(f.type,null,f.pendingProps,null))?f.memoizedState=y:qt||(f.stateNode=yU(f.type,f.pendingProps,ka.current,f)):f.memoizedState=US(f.type,u.memoizedProps,f.pendingProps,u.memoizedState),null;case 27:if(Mi)return ie(f),u===null&&Mi&&qt&&(M=f.stateNode=zS(f.type,f.pendingProps,ka.current,pi.current,!1),Li=f,fs=!0,wi=CS(M)),M=f.pendingProps.children,u!==null||qt?On(u,f,M,y):f.child=Fo(f,null,M,y),Wn(u,f),f.child;case 5:return u===null&&qt&&(mU(f.type,f.pendingProps,pi.current),(C=M=wi)&&(M=rU(M,f.type,f.pendingProps,fs),M!==null?(f.stateNode=M,Li=f,wi=CS(M),fs=!1,C=!0):C=!1),C||de(f)),ie(f),C=f.type,N=f.pendingProps,Z=u!==null?u.memoizedProps:null,M=N.children,Md(C,N)?M=null:Z!==null&&Md(C,Z)&&(f.flags|=32),f.memoizedState!==null&&(C=Is(u,f,Ca,null,null,y),js?Po._currentValue=C:Po._currentValue2=C),Wn(u,f),On(u,f,M,y),f.child;case 6:return u===null&&qt&&(gU(f.pendingProps,pi.current),(u=y=wi)&&(y=sU(y,f.pendingProps,fs),y!==null?(f.stateNode=y,Li=f,wi=null,u=!0):u=!1),u||de(f)),null;case 13:return pb(u,f,y);case 4:return te(f,f.stateNode.containerInfo),M=f.pendingProps,u===null?f.child=Fo(f,null,M,y):On(u,f,M,y),f.child;case 11:return Ro(u,f,f.type,f.pendingProps,y);case 7:return On(u,f,f.pendingProps,y),f.child;case 8:return On(u,f,f.pendingProps.children,y),f.child;case 12:return On(u,f,f.pendingProps.children,y),f.child;case 10:return M=f.pendingProps,Oa(f,f.type,M.value),On(u,f,M.children,y),f.child;case 9:return C=f.type._context,M=f.pendingProps.children,Do(f),C=Si(C),M=M(C),f.flags|=1,On(u,f,M,y),f.child;case 14:return Vu(u,f,f.type,f.pendingProps,y);case 15:return dd(u,f,f.type,f.pendingProps,y);case 19:return gb(u,f,y);case 22:return di(u,f,y);case 24:return Do(f),M=Si(Ln),u===null?(C=z0(),C===null&&(C=fn,N=P0(),C.pooledCache=N,N.refCount++,N!==null&&(C.pooledCacheLanes|=y),C=N),f.memoizedState={parent:M,cache:C},je(f),Oa(f,Ln,C)):((u.lanes&y)!==0&&(Ze(u,f),dt(f,null,null,y),We()),C=u.memoizedState,N=f.memoizedState,C.parent!==M?(C={parent:M,cache:M},f.memoizedState=C,f.lanes===0&&(f.memoizedState=f.updateQueue.baseState=C),Oa(f,Ln,M)):(M=N.cache,Oa(f,Ln,M),M!==C.cache&&N0(f,[Ln],y,!0))),On(u,f,f.pendingProps.children,y),f.child;case 29:throw f.pendingProps}throw Error(r(156,f.tag))}function Oa(u,f,y){js?(b(zd,f._currentValue),f._currentValue=y):(b(zd,f._currentValue2),f._currentValue2=y)}function Vs(u){var f=zd.current;js?u._currentValue=f:u._currentValue2=f,g(zd)}function I0(u,f,y){for(;u!==null;){var M=u.alternate;if((u.childLanes&f)!==f?(u.childLanes|=f,M!==null&&(M.childLanes|=f)):M!==null&&(M.childLanes&f)!==f&&(M.childLanes|=f),u===y)break;u=u.return}}function N0(u,f,y,M){var C=u.child;for(C!==null&&(C.return=u);C!==null;){var N=C.dependencies;if(N!==null){var Z=C.child;N=N.firstContext;e:for(;N!==null;){var le=N;N=C;for(var we=0;we<f.length;we++)if(le.context===f[we]){N.lanes|=y,le=N.alternate,le!==null&&(le.lanes|=y),I0(N.return,y,u),M||(Z=null);break e}N=le.next}}else if(C.tag===18){if(Z=C.return,Z===null)throw Error(r(341));Z.lanes|=y,N=Z.alternate,N!==null&&(N.lanes|=y),I0(Z,y,u),Z=null}else Z=C.child;if(Z!==null)Z.return=C;else for(Z=C;Z!==null;){if(Z===u){Z=null;break}if(C=Z.sibling,C!==null){C.return=Z.return,Z=C;break}Z=Z.return}C=Z}}function Xu(u,f,y,M){u=null;for(var C=f,N=!1;C!==null;){if(!N){if((C.flags&524288)!==0)N=!0;else if((C.flags&262144)!==0)break}if(C.tag===10){var Z=C.alternate;if(Z===null)throw Error(r(387));if(Z=Z.memoizedProps,Z!==null){var le=C.type;fr(C.pendingProps.value,Z.value)||(u!==null?u.push(le):u=[le])}}else if(C===Dd.current){if(Z=C.alternate,Z===null)throw Error(r(387));Z.memoizedState.memoizedState!==C.memoizedState.memoizedState&&(u!==null?u.push(Po):u=[Po])}C=C.return}u!==null&&N0(f,u,y,M),f.flags|=262144}function pd(u){for(u=u.firstContext;u!==null;){var f=u.context;if(!fr(js?f._currentValue:f._currentValue2,u.memoizedValue))return!0;u=u.next}return!1}function Do(u){Ho=u,Zs=null,u=u.dependencies,u!==null&&(u.firstContext=null)}function Si(u){return yb(Ho,u)}function md(u,f){return Ho===null&&Do(u),yb(u,f)}function yb(u,f){var y=js?f._currentValue:f._currentValue2;if(f={context:f,memoizedValue:y,next:null},Zs===null){if(u===null)throw Error(r(308));Zs=f,u.dependencies={lanes:0,firstContext:f},u.flags|=524288}else Zs=Zs.next=f;return y}function P0(){return{controller:new NU,data:new Map,refCount:0}}function ju(u){u.refCount--,u.refCount===0&&PU(zU,function(){u.controller.abort()})}function z0(){var u=Vo.current;return u!==null?u:fn.pooledCache}function gd(u,f){f===null?b(Vo,Vo.current):b(Vo,f.pool)}function _b(){var u=z0();return u===null?null:{parent:js?Ln._currentValue:Ln._currentValue2,pool:u}}function sr(u){u.flags|=4}function xb(u,f){if(u!==null&&u.child===f.child)return!1;if((f.flags&16)!==0)return!0;for(u=f.child;u!==null;){if((u.flags&13878)!==0||(u.subtreeFlags&13878)!==0)return!0;u=u.sibling}return!1}function F0(u,f,y,M){if(Ei)for(y=f.child;y!==null;){if(y.tag===5||y.tag===6)pv(u,y.stateNode);else if(!(y.tag===4||Mi&&y.tag===27)&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===f)break;for(;y.sibling===null;){if(y.return===null||y.return===f)return;y=y.return}y.sibling.return=y.return,y=y.sibling}else if(Ba)for(var C=f.child;C!==null;){if(C.tag===5){var N=C.stateNode;y&&M&&(N=wS(N,C.type,C.memoizedProps)),pv(u,N)}else if(C.tag===6)N=C.stateNode,y&&M&&(N=TS(N,C.memoizedProps)),pv(u,N);else if(C.tag!==4){if(C.tag===22&&C.memoizedState!==null)N=C.child,N!==null&&(N.return=C),F0(u,C,!0,!0);else if(C.child!==null){C.child.return=C,C=C.child;continue}}if(C===f)break;for(;C.sibling===null;){if(C.return===null||C.return===f)return;C=C.return}C.sibling.return=C.return,C=C.sibling}}function bb(u,f,y,M){if(Ba)for(var C=f.child;C!==null;){if(C.tag===5){var N=C.stateNode;y&&M&&(N=wS(N,C.type,C.memoizedProps)),ES(u,N)}else if(C.tag===6)N=C.stateNode,y&&M&&(N=TS(N,C.memoizedProps)),ES(u,N);else if(C.tag!==4){if(C.tag===22&&C.memoizedState!==null)N=C.child,N!==null&&(N.return=C),bb(u,C,!(C.memoizedProps!==null&&C.memoizedProps.mode==="manual"),!0);else if(C.child!==null){C.child.return=C,C=C.child;continue}}if(C===f)break;for(;C.sibling===null;){if(C.return===null||C.return===f)return;C=C.return}C.sibling.return=C.return,C=C.sibling}}function Sb(u,f){if(Ba&&xb(u,f)){u=f.stateNode;var y=u.containerInfo,M=SS();bb(M,f,!1,!1),u.pendingChildren=M,sr(f),J3(y,M)}}function B0(u,f,y,M){if(Ei)u.memoizedProps!==M&&sr(f);else if(Ba){var C=u.stateNode,N=u.memoizedProps;if((u=xb(u,f))||N!==M){var Z=pi.current;N=K3(C,y,N,M,!u,null),N===C?f.stateNode=C:(gS(N,y,M,Z)&&sr(f),f.stateNode=N,u?F0(N,f,!1,!1):sr(f))}else f.stateNode=C}}function k0(u,f,y){if(M3(f,y)){if(u.flags|=16777216,!_S(f,y))if(qb())u.flags|=8192;else throw lc=Ld,Cv}else u.flags&=-16777217}function Eb(u,f){if(xU(f)){if(u.flags|=16777216,!PS(f))if(qb())u.flags|=8192;else throw lc=Ld,Cv}else u.flags&=-16777217}function vd(u,f){f!==null&&(u.flags|=4),u.flags&16384&&(f=u.tag!==22?A():536870912,u.lanes|=f,mc|=f)}function qu(u,f){if(!qt)switch(u.tailMode){case"hidden":f=u.tail;for(var y=null;f!==null;)f.alternate!==null&&(y=f),f=f.sibling;y===null?u.tail=null:y.sibling=null;break;case"collapsed":y=u.tail;for(var M=null;y!==null;)y.alternate!==null&&(M=y),y=y.sibling;M===null?f||u.tail===null?u.tail=null:u.tail.sibling=null:M.sibling=null}}function En(u){var f=u.alternate!==null&&u.alternate.child===u.child,y=0,M=0;if(f)for(var C=u.child;C!==null;)y|=C.lanes|C.childLanes,M|=C.subtreeFlags&31457280,M|=C.flags&31457280,C.return=u,C=C.sibling;else for(C=u.child;C!==null;)y|=C.lanes|C.childLanes,M|=C.subtreeFlags,M|=C.flags,C.return=u,C=C.sibling;return u.subtreeFlags|=M,u.childLanes=y,f}function XD(u,f,y){var M=f.pendingProps;switch(Q(f),f.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return En(f),null;case 1:return En(f),null;case 3:return y=f.stateNode,M=null,u!==null&&(M=u.memoizedState.cache),f.memoizedState.cache!==M&&(f.flags|=2048),Vs(Ln),ee(),y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(u===null||u.child===null)&&(ve(f)?sr(f):u===null||u.memoizedState.isDehydrated&&(f.flags&256)===0||(f.flags|=1024,Yr!==null&&(J0(Yr),Yr=null))),Sb(u,f),En(f),null;case 26:if(Mr){y=f.type;var C=f.memoizedState;return u===null?(sr(f),C!==null?(En(f),Eb(f,C)):(En(f),k0(f,y,M))):C?C!==u.memoizedState?(sr(f),En(f),Eb(f,C)):(En(f),f.flags&=-16777217):(Ei?u.memoizedProps!==M&&sr(f):B0(u,f,y,M),En(f),k0(f,y,M)),null}case 27:if(Mi){if(re(f),y=ka.current,C=f.type,u!==null&&f.stateNode!=null)Ei?u.memoizedProps!==M&&sr(f):B0(u,f,C,M);else{if(!M){if(f.stateNode===null)throw Error(r(166));return En(f),null}u=pi.current,ve(f)?Ae(f,u):(u=zS(C,M,y,u,!0),f.stateNode=u,sr(f))}return En(f),null}case 5:if(re(f),y=f.type,u!==null&&f.stateNode!=null)B0(u,f,y,M);else{if(!M){if(f.stateNode===null)throw Error(r(166));return En(f),null}u=pi.current,ve(f)?Ae(f,u):(C=v3(y,M,ka.current,u,f),F0(C,f,!1,!1),f.stateNode=C,gS(C,y,M,u)&&sr(f))}return En(f),k0(f,f.type,f.pendingProps),null;case 6:if(u&&f.stateNode!=null)y=u.memoizedProps,Ei?y!==M&&sr(f):Ba&&(y!==M?(f.stateNode=vS(M,ka.current,pi.current,f),sr(f)):f.stateNode=u.stateNode);else{if(typeof M!="string"&&f.stateNode===null)throw Error(r(166));if(u=ka.current,y=pi.current,ve(f)){if(!Er)throw Error(r(176));if(u=f.stateNode,y=f.memoizedProps,M=null,C=Li,C!==null)switch(C.tag){case 27:case 5:M=C.memoizedProps}lU(u,y,f,M)||de(f)}else f.stateNode=vS(M,u,y,f)}return En(f),null;case 13:if(M=f.memoizedState,u===null||u.memoizedState!==null&&u.memoizedState.dehydrated!==null){if(C=ve(f),M!==null&&M.dehydrated!==null){if(u===null){if(!C)throw Error(r(318));if(!Er)throw Error(r(344));if(C=f.memoizedState,C=C!==null?C.dehydrated:null,!C)throw Error(r(317));cU(C,f)}else fe(),(f.flags&128)===0&&(f.memoizedState=null),f.flags|=4;En(f),C=!1}else Yr!==null&&(J0(Yr),Yr=null),C=!0;if(!C)return f.flags&256?(Un(f),f):(Un(f),null)}if(Un(f),(f.flags&128)!==0)return f.lanes=y,f;if(y=M!==null,u=u!==null&&u.memoizedState!==null,y){M=f.child,C=null,M.alternate!==null&&M.alternate.memoizedState!==null&&M.alternate.memoizedState.cachePool!==null&&(C=M.alternate.memoizedState.cachePool.pool);var N=null;M.memoizedState!==null&&M.memoizedState.cachePool!==null&&(N=M.memoizedState.cachePool.pool),N!==C&&(M.flags|=2048)}return y!==u&&y&&(f.child.flags|=8192),vd(f,f.updateQueue),En(f),null;case 4:return ee(),Sb(u,f),u===null&&x3(f.stateNode.containerInfo),En(f),null;case 10:return Vs(f.type),En(f),null;case 19:if(g(ti),C=f.memoizedState,C===null)return En(f),null;if(M=(f.flags&128)!==0,N=C.rendering,N===null)if(M)qu(C,!1);else{if(Nn!==0||u!==null&&(u.flags&128)!==0)for(u=f.child;u!==null;){if(N=vn(u),N!==null){for(f.flags|=128,qu(C,!1),u=N.updateQueue,f.updateQueue=u,vd(f,u),f.subtreeFlags=0,u=y,y=f.child;y!==null;)iS(y,u),y=y.sibling;return b(ti,ti.current&1|2),f.child}u=u.sibling}C.tail!==null&&qr()>lh&&(f.flags|=128,M=!0,qu(C,!1),f.lanes=4194304)}else{if(!M)if(u=vn(N),u!==null){if(f.flags|=128,M=!0,u=u.updateQueue,f.updateQueue=u,vd(f,u),qu(C,!0),C.tail===null&&C.tailMode==="hidden"&&!N.alternate&&!qt)return En(f),null}else 2*qr()-C.renderingStartTime>lh&&y!==536870912&&(f.flags|=128,M=!0,qu(C,!1),f.lanes=4194304);C.isBackwards?(N.sibling=f.child,f.child=N):(u=C.last,u!==null?u.sibling=N:f.child=N,C.last=N)}return C.tail!==null?(f=C.tail,C.rendering=f,C.tail=f.sibling,C.renderingStartTime=qr(),f.sibling=null,u=ti.current,b(ti,M?u&1|2:u&1),f):(En(f),null);case 22:case 23:return Un(f),xi(),M=f.memoizedState!==null,u!==null?u.memoizedState!==null!==M&&(f.flags|=8192):M&&(f.flags|=8192),M?(y&536870912)!==0&&(f.flags&128)===0&&(En(f),f.subtreeFlags&6&&(f.flags|=8192)):En(f),y=f.updateQueue,y!==null&&vd(f,y.retryQueue),y=null,u!==null&&u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(y=u.memoizedState.cachePool.pool),M=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(M=f.memoizedState.cachePool.pool),M!==y&&(f.flags|=2048),u!==null&&g(Vo),null;case 24:return y=null,u!==null&&(y=u.memoizedState.cache),f.memoizedState.cache!==y&&(f.flags|=2048),Vs(Ln),En(f),null;case 25:return null}throw Error(r(156,f.tag))}function jD(u,f){switch(Q(f),f.tag){case 1:return u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 3:return Vs(Ln),ee(),u=f.flags,(u&65536)!==0&&(u&128)===0?(f.flags=u&-65537|128,f):null;case 26:case 27:case 5:return re(f),null;case 13:if(Un(f),u=f.memoizedState,u!==null&&u.dehydrated!==null){if(f.alternate===null)throw Error(r(340));fe()}return u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 19:return g(ti),null;case 4:return ee(),null;case 10:return Vs(f.type),null;case 22:case 23:return Un(f),xi(),u!==null&&g(Vo),u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 24:return Vs(Ln),null;case 25:return null;default:return null}}function Mb(u,f){switch(Q(f),f.tag){case 3:Vs(Ln),ee();break;case 26:case 27:case 5:re(f);break;case 4:ee();break;case 13:Un(f);break;case 19:g(ti);break;case 10:Vs(f.type);break;case 22:case 23:Un(f),xi(),u!==null&&g(Vo);break;case 24:Vs(Ln)}}function Yu(u,f){try{var y=f.updateQueue,M=y!==null?y.lastEffect:null;if(M!==null){var C=M.next;y=C;do{if((y.tag&u)===u){M=void 0;var N=y.create,Z=y.inst;M=N(),Z.destroy=M}y=y.next}while(y!==C)}}catch(le){sn(f,f.return,le)}}function La(u,f,y){try{var M=f.updateQueue,C=M!==null?M.lastEffect:null;if(C!==null){var N=C.next;M=N;do{if((M.tag&u)===u){var Z=M.inst,le=Z.destroy;if(le!==void 0){Z.destroy=void 0,C=f;var we=y;try{le()}catch(Fe){sn(C,we,Fe)}}}M=M.next}while(M!==N)}}catch(Fe){sn(f,f.return,Fe)}}function wb(u){var f=u.updateQueue;if(f!==null){var y=u.stateNode;try{Ie(f,y)}catch(M){sn(u,u.return,M)}}}function Tb(u,f,y){y.props=Xr(u.type,u.memoizedProps),y.state=u.memoizedState;try{y.componentWillUnmount()}catch(M){sn(u,f,M)}}function Uo(u,f){try{var y=u.ref;if(y!==null){var M=u.stateNode;switch(u.tag){case 26:case 27:case 5:var C=Ju(M);break;default:C=M}typeof y=="function"?u.refCleanup=y(C):y.current=C}}catch(N){sn(u,f,N)}}function ar(u,f){var y=u.ref,M=u.refCleanup;if(y!==null)if(typeof M=="function")try{M()}catch(C){sn(u,f,C)}finally{u.refCleanup=null,u=u.alternate,u!=null&&(u.refCleanup=null)}else if(typeof y=="function")try{y(null)}catch(C){sn(u,f,C)}else y.current=null}function Ab(u){var f=u.type,y=u.memoizedProps,M=u.stateNode;try{B3(M,f,y,u)}catch(C){sn(u,u.return,C)}}function Cb(u,f,y){try{k3(u.stateNode,u.type,y,f,u)}catch(M){sn(u,u.return,M)}}function Rb(u){return u.tag===5||u.tag===3||(Mr?u.tag===26:!1)||(Mi?u.tag===27:!1)||u.tag===4}function G0(u){e:for(;;){for(;u.sibling===null;){if(u.return===null||Rb(u.return))return null;u=u.return}for(u.sibling.return=u.return,u=u.sibling;u.tag!==5&&u.tag!==6&&(!Mi||u.tag!==27)&&u.tag!==18;){if(u.flags&2||u.child===null||u.tag===4)continue e;u.child.return=u,u=u.child}if(!(u.flags&2))return u.stateNode}}function H0(u,f,y){var M=u.tag;if(M===5||M===6)u=u.stateNode,f?H3(y,u,f):z3(y,u);else if(!(M===4||Mi&&M===27)&&(u=u.child,u!==null))for(H0(u,f,y),u=u.sibling;u!==null;)H0(u,f,y),u=u.sibling}function yd(u,f,y){var M=u.tag;if(M===5||M===6)u=u.stateNode,f?G3(y,u,f):P3(y,u);else if(!(M===4||Mi&&M===27)&&(u=u.child,u!==null))for(yd(u,f,y),u=u.sibling;u!==null;)yd(u,f,y),u=u.sibling}function Db(u,f,y){u=u.containerInfo;try{MS(u,y)}catch(M){sn(f,f.return,M)}}function qD(u,f){for(m3(u.containerInfo),li=f;li!==null;)if(u=li,f=u.child,(u.subtreeFlags&1028)!==0&&f!==null)f.return=u,li=f;else for(;li!==null;){u=li;var y=u.alternate;switch(f=u.flags,u.tag){case 0:break;case 11:case 15:break;case 1:if((f&1024)!==0&&y!==null){f=void 0;var M=u,C=y.memoizedProps;y=y.memoizedState;var N=M.stateNode;try{var Z=Xr(M.type,C,M.elementType===M.type);f=N.getSnapshotBeforeUpdate(Z,y),N.__reactInternalSnapshotBeforeUpdate=f}catch(le){sn(M,M.return,le)}}break;case 3:(f&1024)!==0&&Ei&&Z3(u.stateNode.containerInfo);break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((f&1024)!==0)throw Error(r(163))}if(f=u.sibling,f!==null){f.return=u.return,li=f;break}li=u.return}return Z=jS,jS=!1,Z}function Ub(u,f,y){var M=y.flags;switch(y.tag){case 0:case 11:case 15:Ws(u,y),M&4&&Yu(5,y);break;case 1:if(Ws(u,y),M&4)if(u=y.stateNode,f===null)try{u.componentDidMount()}catch(le){sn(y,y.return,le)}else{var C=Xr(y.type,f.memoizedProps);f=f.memoizedState;try{u.componentDidUpdate(C,f,u.__reactInternalSnapshotBeforeUpdate)}catch(le){sn(y,y.return,le)}}M&64&&wb(y),M&512&&Uo(y,y.return);break;case 3:if(Ws(u,y),M&64&&(M=y.updateQueue,M!==null)){if(u=null,y.child!==null)switch(y.child.tag){case 27:case 5:u=Ju(y.child.stateNode);break;case 1:u=y.child.stateNode}try{Ie(M,u)}catch(le){sn(y,y.return,le)}}break;case 26:if(Mr){Ws(u,y),M&512&&Uo(y,y.return);break}case 27:case 5:Ws(u,y),f===null&&M&4&&Ab(y),M&512&&Uo(y,y.return);break;case 12:Ws(u,y);break;case 13:Ws(u,y),M&4&&Lb(u,y);break;case 22:if(C=y.memoizedState!==null||Ks,!C){f=f!==null&&f.memoizedState!==null||In;var N=Ks,Z=In;Ks=C,(In=f)&&!Z?Ia(u,y,(y.subtreeFlags&8772)!==0):Ws(u,y),Ks=N,In=Z}M&512&&(y.memoizedProps.mode==="manual"?Uo(y,y.return):ar(y,y.return));break;default:Ws(u,y)}}function Ob(u){var f=u.alternate;f!==null&&(u.alternate=null,Ob(f)),u.child=null,u.deletions=null,u.sibling=null,u.tag===5&&(f=u.stateNode,f!==null&&E3(f)),u.stateNode=null,u.return=null,u.dependencies=null,u.memoizedProps=null,u.memoizedState=null,u.pendingProps=null,u.stateNode=null,u.updateQueue=null}function jr(u,f,y){for(y=y.child;y!==null;)V0(u,f,y),y=y.sibling}function V0(u,f,y){if(hr&&typeof hr.onCommitFiberUnmount=="function")try{hr.onCommitFiberUnmount(eh,y)}catch{}switch(y.tag){case 26:if(Mr){In||ar(y,f),jr(u,f,y),y.memoizedState?LS(y.memoizedState):y.stateNode&&NS(y.stateNode);break}case 27:if(Mi){In||ar(y,f);var M=jn,C=dr;jn=y.stateNode,jr(u,f,y),MU(y.stateNode),jn=M,dr=C;break}case 5:In||ar(y,f);case 6:if(Ei){if(M=jn,C=dr,jn=null,jr(u,f,y),jn=M,dr=C,jn!==null)if(dr)try{W3(jn,y.stateNode)}catch(N){sn(y,f,N)}else try{V3(jn,y.stateNode)}catch(N){sn(y,f,N)}}else jr(u,f,y);break;case 18:Ei&&jn!==null&&(dr?pU(jn,y.stateNode):dU(jn,y.stateNode));break;case 4:Ei?(M=jn,C=dr,jn=y.stateNode.containerInfo,dr=!0,jr(u,f,y),jn=M,dr=C):(Ba&&Db(y.stateNode,y,SS()),jr(u,f,y));break;case 0:case 11:case 14:case 15:In||La(2,y,f),In||La(4,y,f),jr(u,f,y);break;case 1:In||(ar(y,f),M=y.stateNode,typeof M.componentWillUnmount=="function"&&Tb(y,f,M)),jr(u,f,y);break;case 21:jr(u,f,y);break;case 22:In||ar(y,f),In=(M=In)||y.memoizedState!==null,jr(u,f,y),In=M;break;default:jr(u,f,y)}}function Lb(u,f){if(Er&&f.memoizedState===null&&(u=f.alternate,u!==null&&(u=u.memoizedState,u!==null&&(u=u.dehydrated,u!==null))))try{fU(u)}catch(y){sn(f,f.return,y)}}function YD(u){switch(u.tag){case 13:case 19:var f=u.stateNode;return f===null&&(f=u.stateNode=new XS),f;case 22:return u=u.stateNode,f=u._retryCache,f===null&&(f=u._retryCache=new XS),f;default:throw Error(r(435,u.tag))}}function W0(u,f){var y=YD(u);f.forEach(function(M){var C=n3.bind(null,u,M);y.has(M)||(y.add(M),M.then(C,C))})}function Xi(u,f){var y=f.deletions;if(y!==null)for(var M=0;M<y.length;M++){var C=y[M],N=u,Z=f;if(Ei){var le=Z;e:for(;le!==null;){switch(le.tag){case 27:case 5:jn=le.stateNode,dr=!1;break e;case 3:jn=le.stateNode.containerInfo,dr=!0;break e;case 4:jn=le.stateNode.containerInfo,dr=!0;break e}le=le.return}if(jn===null)throw Error(r(160));V0(N,Z,C),jn=null,dr=!1}else V0(N,Z,C);N=C.alternate,N!==null&&(N.return=null),C.return=null}if(f.subtreeFlags&13878)for(f=f.child;f!==null;)Ib(f,u),f=f.sibling}function Ib(u,f){var y=u.alternate,M=u.flags;switch(u.tag){case 0:case 11:case 14:case 15:Xi(f,u),or(u),M&4&&(La(3,u,u.return),Yu(3,u),La(5,u,u.return));break;case 1:Xi(f,u),or(u),M&512&&(In||y===null||ar(y,y.return)),M&64&&Ks&&(u=u.updateQueue,u!==null&&(M=u.callbacks,M!==null&&(y=u.shared.hiddenCallbacks,u.shared.hiddenCallbacks=y===null?M:y.concat(M))));break;case 26:if(Mr){var C=Zr;Xi(f,u),or(u),M&512&&(In||y===null||ar(y,y.return)),M&4&&(M=y!==null?y.memoizedState:null,f=u.memoizedState,y===null?f===null?u.stateNode===null?u.stateNode=vU(C,u.type,u.memoizedProps,u):IS(C,u.type,u.stateNode):u.stateNode=OS(C,f,u.memoizedProps):M!==f?(M===null?y.stateNode!==null&&NS(y.stateNode):LS(M),f===null?IS(C,u.type,u.stateNode):OS(C,f,u.memoizedProps)):f===null&&u.stateNode!==null&&Cb(u,u.memoizedProps,y.memoizedProps));break}case 27:if(Mi&&M&4&&u.alternate===null){C=u.stateNode;var N=u.memoizedProps;try{SU(C),EU(u.type,N,C,u)}catch(Ke){sn(u,u.return,Ke)}}case 5:if(Xi(f,u),or(u),M&512&&(In||y===null||ar(y,y.return)),Ei){if(u.flags&32){f=u.stateNode;try{bS(f)}catch(Ke){sn(u,u.return,Ke)}}M&4&&u.stateNode!=null&&(f=u.memoizedProps,Cb(u,f,y!==null?y.memoizedProps:f)),M&1024&&(Ov=!0)}break;case 6:if(Xi(f,u),or(u),M&4&&Ei){if(u.stateNode===null)throw Error(r(162));M=u.memoizedProps,y=y!==null?y.memoizedProps:M,f=u.stateNode;try{F3(f,y,M)}catch(Ke){sn(u,u.return,Ke)}}break;case 3:if(Mr?(_U(),C=Zr,Zr=yv(f.containerInfo),Xi(f,u),Zr=C):Xi(f,u),or(u),M&4){if(Ei&&Er&&y!==null&&y.memoizedState.isDehydrated)try{hU(f.containerInfo)}catch(Ke){sn(u,u.return,Ke)}if(Ba){M=f.containerInfo,y=f.pendingChildren;try{MS(M,y)}catch(Ke){sn(u,u.return,Ke)}}}Ov&&(Ov=!1,Nb(u));break;case 4:Mr?(y=Zr,Zr=yv(u.stateNode.containerInfo),Xi(f,u),or(u),Zr=y):(Xi(f,u),or(u)),M&4&&Ba&&Db(u.stateNode,u,u.stateNode.pendingChildren);break;case 12:Xi(f,u),or(u);break;case 13:Xi(f,u),or(u),u.child.flags&8192&&u.memoizedState!==null!=(y!==null&&y.memoizedState!==null)&&(Pv=qr()),M&4&&(M=u.updateQueue,M!==null&&(u.updateQueue=null,W0(u,M)));break;case 22:M&512&&(In||y===null||ar(y,y.return)),C=u.memoizedState!==null;var Z=y!==null&&y.memoizedState!==null,le=Ks,we=In;if(Ks=le||C,In=we||Z,Xi(f,u),In=we,Ks=le,or(u),f=u.stateNode,f._current=u,f._visibility&=-3,f._visibility|=f._pendingVisibility&2,M&8192&&(f._visibility=C?f._visibility&-2:f._visibility|1,C&&(f=Ks||In,y===null||Z||f||jl(u)),Ei&&(u.memoizedProps===null||u.memoizedProps.mode!=="manual"))){e:if(y=null,Ei)for(f=u;;){if(f.tag===5||Mr&&f.tag===26||Mi&&f.tag===27){if(y===null){Z=y=f;try{N=Z.stateNode,C?X3(N):q3(Z.stateNode,Z.memoizedProps)}catch(Ke){sn(Z,Z.return,Ke)}}}else if(f.tag===6){if(y===null){Z=f;try{var Fe=Z.stateNode;C?j3(Fe):Y3(Fe,Z.memoizedProps)}catch(Ke){sn(Z,Z.return,Ke)}}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===u)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===u)break e;for(;f.sibling===null;){if(f.return===null||f.return===u)break e;y===f&&(y=null),f=f.return}y===f&&(y=null),f.sibling.return=f.return,f=f.sibling}}M&4&&(M=u.updateQueue,M!==null&&(y=M.retryQueue,y!==null&&(M.retryQueue=null,W0(u,y))));break;case 19:Xi(f,u),or(u),M&4&&(M=u.updateQueue,M!==null&&(u.updateQueue=null,W0(u,M)));break;case 21:break;default:Xi(f,u),or(u)}}function or(u){var f=u.flags;if(f&2){try{if(Ei&&(!Mi||u.tag!==27)){e:{for(var y=u.return;y!==null;){if(Rb(y)){var M=y;break e}y=y.return}throw Error(r(160))}switch(M.tag){case 27:if(Mi){var C=M.stateNode,N=G0(u);yd(u,N,C);break}case 5:var Z=M.stateNode;M.flags&32&&(bS(Z),M.flags&=-33);var le=G0(u);yd(u,le,Z);break;case 3:case 4:var we=M.stateNode.containerInfo,Fe=G0(u);H0(u,Fe,we);break;default:throw Error(r(161))}}}catch(Ke){sn(u,u.return,Ke)}u.flags&=-3}f&4096&&(u.flags&=-4097)}function Nb(u){if(u.subtreeFlags&1024)for(u=u.child;u!==null;){var f=u;Nb(f),f.tag===5&&f.flags&1024&&A3(f.stateNode),u=u.sibling}}function Ws(u,f){if(f.subtreeFlags&8772)for(f=f.child;f!==null;)Ub(u,f.alternate,f),f=f.sibling}function jl(u){for(u=u.child;u!==null;){var f=u;switch(f.tag){case 0:case 11:case 14:case 15:La(4,f,f.return),jl(f);break;case 1:ar(f,f.return);var y=f.stateNode;typeof y.componentWillUnmount=="function"&&Tb(f,f.return,y),jl(f);break;case 26:case 27:case 5:ar(f,f.return),jl(f);break;case 22:ar(f,f.return),f.memoizedState===null&&jl(f);break;default:jl(f)}u=u.sibling}}function Ia(u,f,y){for(y=y&&(f.subtreeFlags&8772)!==0,f=f.child;f!==null;){var M=f.alternate,C=u,N=f,Z=N.flags;switch(N.tag){case 0:case 11:case 15:Ia(C,N,y),Yu(4,N);break;case 1:if(Ia(C,N,y),M=N,C=M.stateNode,typeof C.componentDidMount=="function")try{C.componentDidMount()}catch(Fe){sn(M,M.return,Fe)}if(M=N,C=M.updateQueue,C!==null){var le=M.stateNode;try{var we=C.shared.hiddenCallbacks;if(we!==null)for(C.shared.hiddenCallbacks=null,C=0;C<we.length;C++)ce(we[C],le)}catch(Fe){sn(M,M.return,Fe)}}y&&Z&64&&wb(N),Uo(N,N.return);break;case 26:case 27:case 5:Ia(C,N,y),y&&M===null&&Z&4&&Ab(N),Uo(N,N.return);break;case 12:Ia(C,N,y);break;case 13:Ia(C,N,y),y&&Z&4&&Lb(C,N);break;case 22:N.memoizedState===null&&Ia(C,N,y),Uo(N,N.return);break;default:Ia(C,N,y)}f=f.sibling}}function X0(u,f){var y=null;u!==null&&u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(y=u.memoizedState.cachePool.pool),u=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(u=f.memoizedState.cachePool.pool),u!==y&&(u!=null&&u.refCount++,y!=null&&ju(y))}function j0(u,f){u=null,f.alternate!==null&&(u=f.alternate.memoizedState.cache),f=f.memoizedState.cache,f!==u&&(f.refCount++,u!=null&&ju(u))}function Na(u,f,y,M){if(f.subtreeFlags&10256)for(f=f.child;f!==null;)Pb(u,f,y,M),f=f.sibling}function Pb(u,f,y,M){var C=f.flags;switch(f.tag){case 0:case 11:case 15:Na(u,f,y,M),C&2048&&Yu(9,f);break;case 3:Na(u,f,y,M),C&2048&&(u=null,f.alternate!==null&&(u=f.alternate.memoizedState.cache),f=f.memoizedState.cache,f!==u&&(f.refCount++,u!=null&&ju(u)));break;case 12:if(C&2048){Na(u,f,y,M),u=f.stateNode;try{var N=f.memoizedProps,Z=N.id,le=N.onPostCommit;typeof le=="function"&&le(Z,f.alternate===null?"mount":"update",u.passiveEffectDuration,-0)}catch(we){sn(f,f.return,we)}}else Na(u,f,y,M);break;case 23:break;case 22:N=f.stateNode,f.memoizedState!==null?N._visibility&4?Na(u,f,y,M):Zu(u,f):N._visibility&4?Na(u,f,y,M):(N._visibility|=4,ql(u,f,y,M,(f.subtreeFlags&10256)!==0)),C&2048&&X0(f.alternate,f);break;case 24:Na(u,f,y,M),C&2048&&j0(f.alternate,f);break;default:Na(u,f,y,M)}}function ql(u,f,y,M,C){for(C=C&&(f.subtreeFlags&10256)!==0,f=f.child;f!==null;){var N=u,Z=f,le=y,we=M,Fe=Z.flags;switch(Z.tag){case 0:case 11:case 15:ql(N,Z,le,we,C),Yu(8,Z);break;case 23:break;case 22:var Ke=Z.stateNode;Z.memoizedState!==null?Ke._visibility&4?ql(N,Z,le,we,C):Zu(N,Z):(Ke._visibility|=4,ql(N,Z,le,we,C)),C&&Fe&2048&&X0(Z.alternate,Z);break;case 24:ql(N,Z,le,we,C),C&&Fe&2048&&j0(Z.alternate,Z);break;default:ql(N,Z,le,we,C)}f=f.sibling}}function Zu(u,f){if(f.subtreeFlags&10256)for(f=f.child;f!==null;){var y=u,M=f,C=M.flags;switch(M.tag){case 22:Zu(y,M),C&2048&&X0(M.alternate,M);break;case 24:Zu(y,M),C&2048&&j0(M.alternate,M);break;default:Zu(y,M)}f=f.sibling}}function Oo(u){if(u.subtreeFlags&dc)for(u=u.child;u!==null;)zb(u),u=u.sibling}function zb(u){switch(u.tag){case 26:Oo(u),u.flags&dc&&(u.memoizedState!==null?bU(Zr,u.memoizedState,u.memoizedProps):xS(u.type,u.memoizedProps));break;case 5:Oo(u),u.flags&dc&&xS(u.type,u.memoizedProps);break;case 3:case 4:if(Mr){var f=Zr;Zr=yv(u.stateNode.containerInfo),Oo(u),Zr=f}else Oo(u);break;case 22:u.memoizedState===null&&(f=u.alternate,f!==null&&f.memoizedState!==null?(f=dc,dc=16777216,Oo(u),dc=f):Oo(u));break;default:Oo(u)}}function Fb(u){var f=u.alternate;if(f!==null&&(u=f.child,u!==null)){f.child=null;do f=u.sibling,u.sibling=null,u=f;while(u!==null)}}function Ku(u){var f=u.deletions;if((u.flags&16)!==0){if(f!==null)for(var y=0;y<f.length;y++){var M=f[y];li=M,kb(M,u)}Fb(u)}if(u.subtreeFlags&10256)for(u=u.child;u!==null;)Bb(u),u=u.sibling}function Bb(u){switch(u.tag){case 0:case 11:case 15:Ku(u),u.flags&2048&&La(9,u,u.return);break;case 3:Ku(u);break;case 12:Ku(u);break;case 22:var f=u.stateNode;u.memoizedState!==null&&f._visibility&4&&(u.return===null||u.return.tag!==13)?(f._visibility&=-5,_d(u)):Ku(u);break;default:Ku(u)}}function _d(u){var f=u.deletions;if((u.flags&16)!==0){if(f!==null)for(var y=0;y<f.length;y++){var M=f[y];li=M,kb(M,u)}Fb(u)}for(u=u.child;u!==null;){switch(f=u,f.tag){case 0:case 11:case 15:La(8,f,f.return),_d(f);break;case 22:y=f.stateNode,y._visibility&4&&(y._visibility&=-5,_d(f));break;default:_d(f)}u=u.sibling}}function kb(u,f){for(;li!==null;){var y=li;switch(y.tag){case 0:case 11:case 15:La(8,y,f);break;case 23:case 22:if(y.memoizedState!==null&&y.memoizedState.cachePool!==null){var M=y.memoizedState.cachePool.pool;M!=null&&M.refCount++}break;case 24:ju(y.memoizedState.cache)}if(M=y.child,M!==null)M.return=y,li=M;else e:for(y=u;li!==null;){M=li;var C=M.sibling,N=M.return;if(Ob(M),M===y){li=null;break e}if(C!==null){C.return=N,li=C;break e}li=N}}}function q0(u){var f=yS(u);if(f!=null){if(typeof f.memoizedProps["data-testname"]!="string")throw Error(r(364));return f}if(u=D3(u),u===null)throw Error(r(362));return u.stateNode.current}function Y0(u,f){var y=u.tag;switch(f.$$typeof){case Fd:if(u.type===f.value)return!0;break;case Bd:e:{for(f=f.value,u=[u,0],y=0;y<u.length;){var M=u[y++],C=M.tag,N=u[y++],Z=f[N];if(C!==5&&C!==26&&C!==27||!$u(M)){for(;Z!=null&&Y0(M,Z);)N++,Z=f[N];if(N===f.length){f=!0;break e}else for(M=M.child;M!==null;)u.push(M,N),M=M.sibling}}f=!1}return f;case kd:if((y===5||y===26||y===27)&&L3(u.stateNode,f.value))return!0;break;case Hd:if((y===5||y===6||y===26||y===27)&&(u=O3(u),u!==null&&0<=u.indexOf(f.value)))return!0;break;case Gd:if((y===5||y===26||y===27)&&(u=u.memoizedProps["data-testname"],typeof u=="string"&&u.toLowerCase()===f.value.toLowerCase()))return!0;break;default:throw Error(r(365))}return!1}function Z0(u){switch(u.$$typeof){case Fd:return"<"+(a(u.value)||"Unknown")+">";case Bd:return":has("+(Z0(u)||"")+")";case kd:return'[role="'+u.value+'"]';case Hd:return'"'+u.value+'"';case Gd:return'[data-testname="'+u.value+'"]';default:throw Error(r(365))}}function Gb(u,f){var y=[];u=[u,0];for(var M=0;M<u.length;){var C=u[M++],N=C.tag,Z=u[M++],le=f[Z];if(N!==5&&N!==26&&N!==27||!$u(C)){for(;le!=null&&Y0(C,le);)Z++,le=f[Z];if(Z===f.length)y.push(C);else for(C=C.child;C!==null;)u.push(C,Z),C=C.sibling}}return y}function K0(u,f){if(!Qu)throw Error(r(363));u=q0(u),u=Gb(u,f),f=[],u=Array.from(u);for(var y=0;y<u.length;){var M=u[y++],C=M.tag;if(C===5||C===26||C===27)$u(M)||f.push(M.stateNode);else for(M=M.child;M!==null;)u.push(M),M=M.sibling}return f}function lr(){if((cn&2)!==0&&Vt!==0)return Vt&-Vt;if(wt.T!==null){var u=ac;return u!==0?u:_e()}return b3()}function Hb(){Rr===0&&(Rr=(Vt&536870912)===0||qt?U():536870912);var u=Cr.current;return u!==null&&(u.flags|=32),Rr}function Oi(u,f,y){(u===fn&&dn===2||u.cancelPendingCommit!==null)&&(Yl(u,0),Xs(u,Vt,Rr,!1)),L(u,y),((cn&2)===0||u!==fn)&&(u===fn&&((cn&2)===0&&(Wo|=y),Nn===4&&Xs(u,Vt,Rr,!1)),be(u))}function Vb(u,f,y){if((cn&6)!==0)throw Error(r(327));var M=!y&&(f&60)===0&&(f&u.expiredLanes)===0||T(u,f),C=M?JD(u,f):ev(u,f,!0),N=M;do{if(C===0){pc&&!M&&Xs(u,f,0,!1);break}else if(C===6)Xs(u,f,0,!Js);else{if(y=u.current.alternate,N&&!ZD(y)){C=ev(u,f,!1),N=!1;continue}if(C===2){if(N=f,u.errorRecoveryDisabledLanes&N)var Z=0;else Z=u.pendingLanes&-536870913,Z=Z!==0?Z:Z&536870912?536870912:0;if(Z!==0){f=Z;e:{var le=u;C=oh;var we=Er&&le.current.memoizedState.isDehydrated;if(we&&(Yl(le,Z).flags|=256),Z=ev(le,Z,!1),Z!==2){if(Lv&&!we){le.errorRecoveryDisabledLanes|=N,Wo|=N,C=4;break e}N=ms,ms=C,N!==null&&J0(N)}C=Z}if(N=!1,C!==2)continue}}if(C===1){Yl(u,0),Xs(u,f,0,!0);break}e:{switch(M=u,C){case 0:case 1:throw Error(r(345));case 4:if((f&4194176)===f){Xs(M,f,Rr,!Js);break e}break;case 2:ms=null;break;case 3:case 5:break;default:throw Error(r(329))}if(M.finishedWork=y,M.finishedLanes=f,(f&62914560)===f&&(N=Pv+300-qr(),10<N)){if(Xs(M,f,Rr,!Js),w(M,0)!==0)break e;M.timeoutHandle=y3(Wb.bind(null,M,y,ms,Vd,Nv,f,Rr,Wo,mc,Js,2,-0,0),N);break e}Wb(M,y,ms,Vd,Nv,f,Rr,Wo,mc,Js,0,-0,0)}}break}while(!0);be(u)}function J0(u){ms===null?ms=u:ms.push.apply(ms,u)}function Wb(u,f,y,M,C,N,Z,le,we,Fe,Ke,ct,ht){var Dt=f.subtreeFlags;if((Dt&8192||(Dt&16785408)===16785408)&&(w3(),zb(f),f=T3(),f!==null)){u.cancelPendingCommit=f($b.bind(null,u,y,M,C,Z,le,we,1,ct,ht)),Xs(u,N,Z,!Fe);return}$b(u,y,M,C,Z,le,we,Ke,ct,ht)}function ZD(u){for(var f=u;;){var y=f.tag;if((y===0||y===11||y===15)&&f.flags&16384&&(y=f.updateQueue,y!==null&&(y=y.stores,y!==null)))for(var M=0;M<y.length;M++){var C=y[M],N=C.getSnapshot;C=C.value;try{if(!fr(N(),C))return!1}catch{return!1}}if(y=f.child,f.subtreeFlags&16384&&y!==null)y.return=f,f=y;else{if(f===u)break;for(;f.sibling===null;){if(f.return===null||f.return===u)return!0;f=f.return}f.sibling.return=f.return,f=f.sibling}}return!0}function Xs(u,f,y,M){f&=~Iv,f&=~Wo,u.suspendedLanes|=f,u.pingedLanes&=~f,M&&(u.warmLanes|=f),M=u.expirationTimes;for(var C=f;0<C;){var N=31-ur(C),Z=1<<N;M[N]=-1,C&=~Z}y!==0&&I(u,y,f)}function Xb(){return(cn&6)===0?(ue(0),!1):!0}function Q0(){if(Ft!==null){if(dn===0)var u=Ft.return;else u=Ft,Zs=Ho=null,q(u),cc=null,rh=0,u=Ft;for(;u!==null;)Mb(u.alternate,u),u=u.return;Ft=null}}function Yl(u,f){u.finishedWork=null,u.finishedLanes=0;var y=u.timeoutHandle;y!==mv&&(u.timeoutHandle=mv,_3(y)),y=u.cancelPendingCommit,y!==null&&(u.cancelPendingCommit=null,y()),Q0(),fn=u,Ft=y=Pa(u.current,null),Vt=f,dn=0,pr=null,Js=!1,pc=T(u,f),Lv=!1,mc=Rr=Iv=Wo=Wa=Nn=0,ms=oh=null,Nv=!1,(f&8)!==0&&(f|=f&32);var M=u.entangledLanes;if(M!==0)for(u=u.entanglements,M&=f;0<M;){var C=31-ur(M),N=1<<C;f|=u[C],M&=~N}return Qs=f,oe(),y}function jb(u,f){Nt=null,wt.H=ps,f===ih?(f=Qe(),dn=3):f===Cv?(f=Qe(),dn=4):dn=f===VS?8:f!==null&&typeof f=="object"&&typeof f.then=="function"?6:1,pr=f,Ft===null&&(Nn=1,hs(u,G(f,u.current)))}function qb(){var u=Cr.current;return u===null?!0:(Vt&4194176)===Vt?ds===null:(Vt&62914560)===Vt||(Vt&536870912)!==0?u===ds:!1}function Yb(){var u=wt.H;return wt.H=ps,u===null?ps:u}function Zb(){var u=wt.A;return wt.A=FU,u}function $0(){Nn=4,Js||(Vt&4194176)!==Vt&&Cr.current!==null||(pc=!0),(Wa&134217727)===0&&(Wo&134217727)===0||fn===null||Xs(fn,Vt,Rr,!1)}function ev(u,f,y){var M=cn;cn|=2;var C=Yb(),N=Zb();(fn!==u||Vt!==f)&&(Vd=null,Yl(u,f)),f=!1;var Z=Nn;e:do try{if(dn!==0&&Ft!==null){var le=Ft,we=pr;switch(dn){case 8:Q0(),Z=6;break e;case 3:case 2:case 6:Cr.current===null&&(f=!0);var Fe=dn;if(dn=0,pr=null,Zl(u,le,we,Fe),y&&pc){Z=0;break e}break;default:Fe=dn,dn=0,pr=null,Zl(u,le,we,Fe)}}KD(),Z=Nn;break}catch(Ke){jb(u,Ke)}while(!0);return f&&u.shellSuspendCounter++,Zs=Ho=null,cn=M,wt.H=C,wt.A=N,Ft===null&&(fn=null,Vt=0,oe()),Z}function KD(){for(;Ft!==null;)Kb(Ft)}function JD(u,f){var y=cn;cn|=2;var M=Yb(),C=Zb();fn!==u||Vt!==f?(Vd=null,lh=qr()+500,Yl(u,f)):pc=T(u,f);e:do try{if(dn!==0&&Ft!==null){f=Ft;var N=pr;t:switch(dn){case 1:dn=0,pr=null,Zl(u,f,N,1);break;case 2:if(rt(N)){dn=0,pr=null,Jb(f);break}f=function(){dn===2&&fn===u&&(dn=7),be(u)},N.then(f,f);break e;case 3:dn=7;break e;case 4:dn=5;break e;case 7:rt(N)?(dn=0,pr=null,Jb(f)):(dn=0,pr=null,Zl(u,f,N,7));break;case 5:var Z=null;switch(Ft.tag){case 26:Z=Ft.memoizedState;case 5:case 27:var le=Ft,we=le.type,Fe=le.pendingProps;if(Z?PS(Z):_S(we,Fe)){dn=0,pr=null;var Ke=le.sibling;if(Ke!==null)Ft=Ke;else{var ct=le.return;ct!==null?(Ft=ct,xd(ct)):Ft=null}break t}}dn=0,pr=null,Zl(u,f,N,5);break;case 6:dn=0,pr=null,Zl(u,f,N,6);break;case 8:Q0(),Nn=6;break e;default:throw Error(r(462))}}QD();break}catch(ht){jb(u,ht)}while(!0);return Zs=Ho=null,wt.H=M,wt.A=C,cn=y,Ft!==null?0:(fn=null,Vt=0,oe(),Nn)}function QD(){for(;Ft!==null&&!AU();)Kb(Ft)}function Kb(u){var f=vb(u.alternate,u,Qs);u.memoizedProps=u.pendingProps,f===null?xd(u):Ft=f}function Jb(u){var f=u,y=f.alternate;switch(f.tag){case 15:case 0:f=Wu(y,f,f.pendingProps,f.type,void 0,Vt);break;case 11:f=Wu(y,f,f.pendingProps,f.type.render,f.ref,Vt);break;case 5:q(f);default:Mb(y,f),f=Ft=iS(f,Qs),f=vb(y,f,Qs)}u.memoizedProps=u.pendingProps,f===null?xd(u):Ft=f}function Zl(u,f,y,M){Zs=Ho=null,q(f),cc=null,rh=0;var C=f.return;try{if(T0(u,C,f,y,Vt)){Nn=1,hs(u,G(y,u.current)),Ft=null;return}}catch(N){if(C!==null)throw Ft=C,N;Nn=1,hs(u,G(y,u.current)),Ft=null;return}f.flags&32768?(qt||M===1?u=!0:pc||(Vt&536870912)!==0?u=!1:(Js=u=!0,(M===2||M===3||M===6)&&(M=Cr.current,M!==null&&M.tag===13&&(M.flags|=16384))),Qb(f,u)):xd(f)}function xd(u){var f=u;do{if((f.flags&32768)!==0){Qb(f,Js);return}u=f.return;var y=XD(f.alternate,f,Qs);if(y!==null){Ft=y;return}if(f=f.sibling,f!==null){Ft=f;return}Ft=f=u}while(f!==null);Nn===0&&(Nn=5)}function Qb(u,f){do{var y=jD(u.alternate,u);if(y!==null){y.flags&=32767,Ft=y;return}if(y=u.return,y!==null&&(y.flags|=32768,y.subtreeFlags=0,y.deletions=null),!f&&(u=u.sibling,u!==null)){Ft=u;return}Ft=u=y}while(u!==null);Nn=6,Ft=null}function $b(u,f,y,M,C,N,Z,le,we,Fe){var Ke=wt.T,ct=No();try{ji(2),wt.T=null,$D(u,f,y,M,ct,C,N,Z,le,we,Fe)}finally{wt.T=Ke,ji(ct)}}function $D(u,f,y,M,C,N,Z,le){do Lo();while(Xo!==null);if((cn&6)!==0)throw Error(r(327));var we=u.finishedWork;if(M=u.finishedLanes,we===null)return null;if(u.finishedWork=null,u.finishedLanes=0,we===u.current)throw Error(r(177));u.callbackNode=null,u.callbackPriority=0,u.cancelPendingCommit=null;var Fe=we.lanes|we.childLanes;if(Fe|=Ev,P(u,M,Fe,N,Z,le),u===fn&&(Ft=fn=null,Vt=0),(we.subtreeFlags&10256)===0&&(we.flags&10256)===0||Wd||(Wd=!0,zv=Fe,Fv=y,i3(bv,function(){return Lo(),null})),y=(we.flags&15990)!==0,(we.subtreeFlags&15990)!==0||y?(y=wt.T,wt.T=null,N=No(),ji(2),Z=cn,cn|=4,qD(u,we),Ib(we,u),g3(u.containerInfo),u.current=we,Ub(u,we.alternate,we),CU(),cn=Z,ji(N),wt.T=y):u.current=we,Wd?(Wd=!1,Xo=u,ch=M):eS(u,Fe),Fe=u.pendingLanes,Fe===0&&(Xa=null),z(we.stateNode),be(u),f!==null)for(C=u.onRecoverableError,we=0;we<f.length;we++)Fe=f[we],C(Fe.value,{componentStack:Fe.stack});return(ch&3)!==0&&Lo(),Fe=u.pendingLanes,(M&4194218)!==0&&(Fe&42)!==0?u===Bv?uh++:(uh=0,Bv=u):uh=0,ue(0),null}function eS(u,f){(u.pooledCacheLanes&=f)===0&&(f=u.pooledCache,f!=null&&(u.pooledCache=null,ju(f)))}function Lo(){if(Xo!==null){var u=Xo,f=zv;zv=0;var y=H(ch),M=32>y?32:y;y=wt.T;var C=No();try{if(ji(M),wt.T=null,Xo===null)var N=!1;else{M=Fv,Fv=null;var Z=Xo,le=ch;if(Xo=null,ch=0,(cn&6)!==0)throw Error(r(331));var we=cn;if(cn|=4,Bb(Z.current),Pb(Z,Z.current,le,M),cn=we,ue(0,!1),hr&&typeof hr.onPostCommitFiberRoot=="function")try{hr.onPostCommitFiberRoot(eh,Z)}catch{}N=!0}return N}finally{ji(C),wt.T=y,eS(u,f)}}return!1}function tS(u,f,y){f=G(y,f),f=Gs(u.stateNode,f,2),u=Be(u,f,2),u!==null&&(L(u,2),be(u))}function sn(u,f,y){if(u.tag===3)tS(u,u,y);else for(;f!==null;){if(f.tag===3){tS(f,u,y);break}else if(f.tag===1){var M=f.stateNode;if(typeof f.type.getDerivedStateFromError=="function"||typeof M.componentDidCatch=="function"&&(Xa===null||!Xa.has(M))){u=G(y,u),y=Xl(2),M=Be(f,y,2),M!==null&&(bi(y,M,f,u),L(M,2),be(M));break}}f=f.return}}function tv(u,f,y){var M=u.pingCache;if(M===null){M=u.pingCache=new BU;var C=new Set;M.set(f,C)}else C=M.get(f),C===void 0&&(C=new Set,M.set(f,C));C.has(y)||(Lv=!0,C.add(y),u=e3.bind(null,u,f,y),f.then(u,u))}function e3(u,f,y){var M=u.pingCache;M!==null&&M.delete(f),u.pingedLanes|=u.suspendedLanes&y,u.warmLanes&=~y,fn===u&&(Vt&y)===y&&(Nn===4||Nn===3&&(Vt&62914560)===Vt&&300>qr()-Pv?(cn&2)===0&&Yl(u,0):Iv|=y,mc===Vt&&(mc=0)),be(u)}function nS(u,f){f===0&&(f=A()),u=pe(u,f),u!==null&&(L(u,f),be(u))}function t3(u){var f=u.memoizedState,y=0;f!==null&&(y=f.retryLane),nS(u,y)}function n3(u,f){var y=0;switch(u.tag){case 13:var M=u.stateNode,C=u.memoizedState;C!==null&&(y=C.retryLane);break;case 19:M=u.stateNode;break;case 22:M=u.stateNode._retryCache;break;default:throw Error(r(314))}M!==null&&M.delete(f),nS(u,y)}function i3(u,f){return Ad(u,f)}function r3(u,f,y,M){this.tag=u,this.key=y,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=f,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=M,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function nv(u){return u=u.prototype,!(!u||!u.isReactComponent)}function Pa(u,f){var y=u.alternate;return y===null?(y=t(u.tag,f,u.key,u.mode),y.elementType=u.elementType,y.type=u.type,y.stateNode=u.stateNode,y.alternate=u,u.alternate=y):(y.pendingProps=f,y.type=u.type,y.flags=0,y.subtreeFlags=0,y.deletions=null),y.flags=u.flags&31457280,y.childLanes=u.childLanes,y.lanes=u.lanes,y.child=u.child,y.memoizedProps=u.memoizedProps,y.memoizedState=u.memoizedState,y.updateQueue=u.updateQueue,f=u.dependencies,y.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext},y.sibling=u.sibling,y.index=u.index,y.ref=u.ref,y.refCleanup=u.refCleanup,y}function iS(u,f){u.flags&=31457282;var y=u.alternate;return y===null?(u.childLanes=0,u.lanes=f,u.child=null,u.subtreeFlags=0,u.memoizedProps=null,u.memoizedState=null,u.updateQueue=null,u.dependencies=null,u.stateNode=null):(u.childLanes=y.childLanes,u.lanes=y.lanes,u.child=y.child,u.subtreeFlags=0,u.deletions=null,u.memoizedProps=y.memoizedProps,u.memoizedState=y.memoizedState,u.updateQueue=y.updateQueue,u.type=y.type,f=y.dependencies,u.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext}),u}function bd(u,f,y,M,C,N){var Z=0;if(M=u,typeof u=="function")nv(u)&&(Z=1);else if(typeof u=="string")Z=Mr&&Mi?DS(u,y,pi.current)?26:FS(u)?27:5:Mr?DS(u,y,pi.current)?26:5:Mi&&FS(u)?27:5;else e:switch(u){case Jl:return Io(y.children,C,N,f);case uS:Z=8,C|=24;break;case ov:return u=t(12,y,f,C|2),u.elementType=ov,u.lanes=N,u;case cv:return u=t(13,y,f,C),u.elementType=cv,u.lanes=N,u;case uv:return u=t(19,y,f,C),u.elementType=uv,u.lanes=N,u;case fS:return rS(y,C,N,f);default:if(typeof u=="object"&&u!==null)switch(u.$$typeof){case l3:case za:Z=10;break e;case hS:Z=9;break e;case lv:Z=11;break e;case hv:Z=14;break e;case Fa:Z=16,M=null;break e}Z=29,y=Error(r(130,u===null?"null":typeof u,"")),M=null}return f=t(Z,y,f,C),f.elementType=u,f.type=M,f.lanes=N,f}function Io(u,f,y,M){return u=t(7,u,M,f),u.lanes=y,u}function rS(u,f,y,M){u=t(22,u,M,f),u.elementType=fS,u.lanes=y;var C={_visibility:1,_pendingVisibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var N=C._current;if(N===null)throw Error(r(456));if((C._pendingVisibility&2)===0){var Z=pe(N,2);Z!==null&&(C._pendingVisibility|=2,Oi(Z,N,2))}},attach:function(){var N=C._current;if(N===null)throw Error(r(456));if((C._pendingVisibility&2)!==0){var Z=pe(N,2);Z!==null&&(C._pendingVisibility&=-3,Oi(Z,N,2))}}};return u.stateNode=C,u}function iv(u,f,y){return u=t(6,u,null,f),u.lanes=y,u}function rv(u,f,y){return f=t(4,u.children!==null?u.children:[],u.key,f),f.lanes=y,f.stateNode={containerInfo:u.containerInfo,pendingChildren:null,implementation:u.implementation},f}function s3(u,f,y,M,C,N,Z,le){this.tag=1,this.containerInfo=u,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=mv,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=D(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=D(0),this.hiddenUpdates=D(null),this.identifierPrefix=M,this.onUncaughtError=C,this.onCaughtError=N,this.onRecoverableError=Z,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=le,this.incompleteTransitions=new Map}function sS(u,f,y,M,C,N,Z,le,we,Fe,Ke,ct){return u=new s3(u,f,y,Z,le,we,Fe,ct),f=1,N===!0&&(f|=24),N=t(3,null,null,f),u.current=N,N.stateNode=u,f=P0(),f.refCount++,u.pooledCache=f,f.refCount++,N.memoizedState={element:M,isDehydrated:y,cache:f},je(N),u}function aS(u){return u?(u=ec,u):ec}function oS(u){var f=u._reactInternals;if(f===void 0)throw typeof u.render=="function"?Error(r(188)):(u=Object.keys(u).join(","),Error(r(268,u)));return u=m(f),u=u!==null?v(u):null,u===null?null:Ju(u.stateNode)}function lS(u,f,y,M,C,N){C=aS(C),M.context===null?M.context=C:M.pendingContext=C,M=Le(f),M.payload={element:y},N=N===void 0?null:N,N!==null&&(M.callback=N),y=Be(u,M,f),y!==null&&(Oi(y,u,f),Ve(y,u,f))}function cS(u,f){if(u=u.memoizedState,u!==null&&u.dehydrated!==null){var y=u.retryLane;u.retryLane=y!==0&&y<f?y:f}}function sv(u,f){cS(u,f),(u=u.alternate)&&cS(u,f)}var zt={},a3=bA(),cr=G4(),av=Object.assign,o3=Symbol.for("react.element"),Sd=Symbol.for("react.transitional.element"),Kl=Symbol.for("react.portal"),Jl=Symbol.for("react.fragment"),uS=Symbol.for("react.strict_mode"),ov=Symbol.for("react.profiler"),l3=Symbol.for("react.provider"),hS=Symbol.for("react.consumer"),za=Symbol.for("react.context"),lv=Symbol.for("react.forward_ref"),cv=Symbol.for("react.suspense"),uv=Symbol.for("react.suspense_list"),hv=Symbol.for("react.memo"),Fa=Symbol.for("react.lazy"),fS=Symbol.for("react.offscreen"),c3=Symbol.for("react.memo_cache_sentinel"),dS=Symbol.iterator,u3=Symbol.for("react.client.reference"),wt=a3.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,fv,pS,dv=!1,Ed=Array.isArray,h3=e.rendererVersion,f3=e.rendererPackageName,mS=e.extraDevToolsConfig,Ju=e.getPublicInstance,d3=e.getRootHostContext,p3=e.getChildHostContext,m3=e.prepareForCommit,g3=e.resetAfterCommit,v3=e.createInstance,pv=e.appendInitialChild,gS=e.finalizeInitialChildren,Md=e.shouldSetTextContent,vS=e.createTextInstance,y3=e.scheduleTimeout,_3=e.cancelTimeout,mv=e.noTimeout,js=e.isPrimaryRenderer;e.warnsIfNotActing;var Ei=e.supportsMutation,Ba=e.supportsPersistence,Er=e.supportsHydration,yS=e.getInstanceFromNode;e.beforeActiveInstanceBlur,e.afterActiveInstanceBlur;var x3=e.preparePortalMount;e.prepareScopeUpdate,e.getInstanceFromScope;var ji=e.setCurrentUpdatePriority,No=e.getCurrentUpdatePriority,b3=e.resolveUpdatePriority;e.resolveEventType,e.resolveEventTimeStamp;var S3=e.shouldAttemptEagerTransition,E3=e.detachDeletedInstance;e.requestPostPaintCallback;var M3=e.maySuspendCommit,_S=e.preloadInstance,w3=e.startSuspendingCommit,xS=e.suspendInstance,T3=e.waitForCommitToBeReady,Ql=e.NotPendingTransition,Po=e.HostTransitionContext,A3=e.resetFormInstance;e.bindToConsole;var C3=e.supportsMicrotasks,R3=e.scheduleMicrotask,Qu=e.supportsTestSelectors,D3=e.findFiberRoot,U3=e.getBoundingRect,O3=e.getTextContent,$u=e.isHiddenSubtree,L3=e.matchAccessibilityRole,I3=e.setFocusIfFocusable,N3=e.setupIntersectionObserver,P3=e.appendChild,z3=e.appendChildToContainer,F3=e.commitTextUpdate,B3=e.commitMount,k3=e.commitUpdate,G3=e.insertBefore,H3=e.insertInContainerBefore,V3=e.removeChild,W3=e.removeChildFromContainer,bS=e.resetTextContent,X3=e.hideInstance,j3=e.hideTextInstance,q3=e.unhideInstance,Y3=e.unhideTextInstance,Z3=e.clearContainer,K3=e.cloneInstance,SS=e.createContainerChildSet,ES=e.appendChildToContainerChildSet,J3=e.finalizeContainerChildren,MS=e.replaceContainerChildren,wS=e.cloneHiddenInstance,TS=e.cloneHiddenTextInstance,gv=e.isSuspenseInstancePending,vv=e.isSuspenseInstanceFallback,Q3=e.getSuspenseInstanceFallbackErrorDetails,$3=e.registerSuspenseInstanceRetry,eU=e.canHydrateFormStateMarker,tU=e.isFormStateMarkerMatching,AS=e.getNextHydratableSibling,CS=e.getFirstHydratableChild,nU=e.getFirstHydratableChildWithinContainer,iU=e.getFirstHydratableChildWithinSuspenseInstance,rU=e.canHydrateInstance,sU=e.canHydrateTextInstance,aU=e.canHydrateSuspenseInstance,oU=e.hydrateInstance,lU=e.hydrateTextInstance,cU=e.hydrateSuspenseInstance,uU=e.getNextHydratableInstanceAfterSuspenseInstance,hU=e.commitHydratedContainer,fU=e.commitHydratedSuspenseInstance,dU=e.clearSuspenseBoundary,pU=e.clearSuspenseBoundaryFromContainer,RS=e.shouldDeleteUnhydratedTailInstances;e.diffHydratedPropsForDevWarnings,e.diffHydratedTextForDevWarnings,e.describeHydratableInstanceForDevWarnings;var mU=e.validateHydratableInstance,gU=e.validateHydratableTextInstance,Mr=e.supportsResources,DS=e.isHostHoistableType,yv=e.getHoistableRoot,US=e.getResource,OS=e.acquireResource,LS=e.releaseResource,vU=e.hydrateHoistable,IS=e.mountHoistable,NS=e.unmountHoistable,yU=e.createHoistableInstance,_U=e.prepareToCommitHoistables,xU=e.mayResourceSuspendCommit,PS=e.preloadResource,bU=e.suspendResource,Mi=e.supportsSingletons,zS=e.resolveSingletonInstance,SU=e.clearSingleton,EU=e.acquireSingletonInstance,MU=e.releaseSingletonInstance,FS=e.isHostSingletonType,_v=[],$l=-1,ec={},ur=Math.clz32?Math.clz32:E,wU=Math.log,TU=Math.LN2,wd=128,Td=4194304,Ad=cr.unstable_scheduleCallback,xv=cr.unstable_cancelCallback,AU=cr.unstable_shouldYield,CU=cr.unstable_requestPaint,qr=cr.unstable_now,BS=cr.unstable_ImmediatePriority,RU=cr.unstable_UserBlockingPriority,bv=cr.unstable_NormalPriority,DU=cr.unstable_IdlePriority,UU=cr.log,OU=cr.unstable_setDisableYieldValue,eh=null,hr=null,fr=typeof Object.is=="function"?Object.is:B,kS=new WeakMap,tc=[],nc=0,Cd=null,Rd=0,wr=[],Tr=0,zo=null,qs=1,Ys="",pi=_(null),th=_(null),ka=_(null),Dd=_(null),Li=null,wi=null,qt=!1,Yr=null,fs=!1,Sv=Error(r(519)),Ar=[],ic=0,Ev=0,Ud=null,rc=null,Mv=!1,Od=!1,wv=!1,sc=0,nh=null,Tv=0,ac=0,oc=null,Ga=!1,Av=!1,LU=Object.prototype.hasOwnProperty,ih=Error(r(460)),Cv=Error(r(474)),Ld={then:function(){}},lc=null,cc=null,rh=0,Fo=en(!0),GS=en(!1),uc=_(null),Id=_(0),Cr=_(null),ds=null,ti=_(0),Ha=0,Nt=null,ln=null,Xn=null,Nd=!1,hc=!1,Bo=!1,Pd=0,sh=0,fc=null,IU=0,Rv=function(){return{lastEffect:null,events:null,stores:null,memoCache:null}},ps={readContext:Si,use:ae,useCallback:jt,useContext:jt,useEffect:jt,useImperativeHandle:jt,useLayoutEffect:jt,useInsertionEffect:jt,useMemo:jt,useReducer:jt,useRef:jt,useState:jt,useDebugValue:jt,useDeferredValue:jt,useTransition:jt,useSyncExternalStore:jt,useId:jt};ps.useCacheRefresh=jt,ps.useMemoCache=jt,ps.useHostTransitionStatus=jt,ps.useFormState=jt,ps.useActionState=jt,ps.useOptimistic=jt;var ko={readContext:Si,use:ae,useCallback:function(u,f){return ge().memoizedState=[u,f===void 0?null:f],u},useContext:Si,useEffect:Gl,useImperativeHandle:function(u,f,y){y=y!=null?y.concat([u]):null,So(4194308,4,zs.bind(null,f,u),y)},useLayoutEffect:function(u,f){return So(4194308,4,u,f)},useInsertionEffect:function(u,f){So(4,2,u,f)},useMemo:function(u,f){var y=ge();f=f===void 0?null:f;var M=u();if(Bo){O(!0);try{u()}finally{O(!1)}}return y.memoizedState=[M,f],M},useReducer:function(u,f,y){var M=ge();if(y!==void 0){var C=y(f);if(Bo){O(!0);try{y(f)}finally{O(!1)}}}else C=f;return M.memoizedState=M.baseState=C,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:u,lastRenderedState:C},M.queue=u,u=u.dispatch=fd.bind(null,Nt,u),[M.memoizedState,u]},useRef:function(u){var f=ge();return u={current:u},f.memoizedState=u},useState:function(u){u=kt(u);var f=u.queue,y=ku.bind(null,Nt,f);return f.dispatch=y,[u.memoizedState,y]},useDebugValue:Bs,useDeferredValue:function(u,f){var y=ge();return wo(y,u,f)},useTransition:function(){var u=kt(!1);return u=zu.bind(null,Nt,u.queue,!0,!1),ge().memoizedState=u,[!1,u]},useSyncExternalStore:function(u,f,y){var M=Nt,C=ge();if(qt){if(y===void 0)throw Error(r(407));y=y()}else{if(y=f(),fn===null)throw Error(r(349));(Vt&60)!==0||pt(M,f,y)}C.memoizedState=y;var N={value:y,getSnapshot:f};return C.queue=N,Gl(Ht.bind(null,M,N,u),[u]),M.flags|=2048,ei(9,Tt.bind(null,M,N,y,f),{destroy:void 0},null),y},useId:function(){var u=ge(),f=fn.identifierPrefix;if(qt){var y=Ys,M=qs;y=(M&~(1<<32-ur(M)-1)).toString(32)+y,f=":"+f+"R"+y,y=Pd++,0<y&&(f+="H"+y.toString(32)),f+=":"}else y=IU++,f=":"+f+"r"+y.toString(32)+":";return u.memoizedState=f},useCacheRefresh:function(){return ge().memoizedState=Bu.bind(null,Nt)}};ko.useMemoCache=Xe,ko.useHostTransitionStatus=Ao,ko.useFormState=fi,ko.useActionState=fi,ko.useOptimistic=function(u){var f=ge();f.memoizedState=f.baseState=u;var y={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return f.queue=y,f=Vl.bind(null,Nt,!0,y),y.dispatch=f,[u,f]};var Va={readContext:Si,use:ae,useCallback:Pu,useContext:Si,useEffect:Ps,useImperativeHandle:Fs,useInsertionEffect:Nu,useLayoutEffect:Mo,useMemo:Ra,useReducer:lt,useRef:kl,useState:function(){return lt($e)},useDebugValue:Bs,useDeferredValue:function(u,f){var y=Te();return Hl(y,ln.memoizedState,u,f)},useTransition:function(){var u=lt($e)[0],f=Te().memoizedState;return[typeof u=="boolean"?u:Ue(u),f]},useSyncExternalStore:_t,useId:Fu};Va.useCacheRefresh=Vi,Va.useMemoCache=Xe,Va.useHostTransitionStatus=Ao,Va.useFormState=Vn,Va.useActionState=Vn,Va.useOptimistic=function(u,f){var y=Te();return gt(y,ln,u,f)};var Go={readContext:Si,use:ae,useCallback:Pu,useContext:Si,useEffect:Ps,useImperativeHandle:Fs,useInsertionEffect:Nu,useLayoutEffect:Mo,useMemo:Ra,useReducer:vt,useRef:kl,useState:function(){return vt($e)},useDebugValue:Bs,useDeferredValue:function(u,f){var y=Te();return ln===null?wo(y,u,f):Hl(y,ln.memoizedState,u,f)},useTransition:function(){var u=vt($e)[0],f=Te().memoizedState;return[typeof u=="boolean"?u:Ue(u),f]},useSyncExternalStore:_t,useId:Fu};Go.useCacheRefresh=Vi,Go.useMemoCache=Xe,Go.useHostTransitionStatus=Ao,Go.useFormState=Wr,Go.useActionState=Wr,Go.useOptimistic=function(u,f){var y=Te();return ln!==null?gt(y,ln,u,f):(y.baseState=u,[u,y.queue.dispatch])};var Dv={isMounted:function(u){return(u=u._reactInternals)?d(u)===u:!1},enqueueSetState:function(u,f,y){u=u._reactInternals;var M=lr(),C=Le(M);C.payload=f,y!=null&&(C.callback=y),f=Be(u,C,M),f!==null&&(Oi(f,u,M),Ve(f,u,M))},enqueueReplaceState:function(u,f,y){u=u._reactInternals;var M=lr(),C=Le(M);C.tag=1,C.payload=f,y!=null&&(C.callback=y),f=Be(u,C,M),f!==null&&(Oi(f,u,M),Ve(f,u,M))},enqueueForceUpdate:function(u,f){u=u._reactInternals;var y=lr(),M=Le(y);M.tag=2,f!=null&&(M.callback=f),f=Be(u,M,y),f!==null&&(Oi(f,u,y),Ve(f,u,y))}},HS=typeof reportError=="function"?reportError:function(u){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var f=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof u=="object"&&u!==null&&typeof u.message=="string"?String(u.message):String(u),error:u});if(!window.dispatchEvent(f))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",u);return}console.error(u)},VS=Error(r(461)),oi=!1,Uv={dehydrated:null,treeContext:null,retryLane:0},zd=_(null),Ho=null,Zs=null,NU=typeof AbortController<"u"?AbortController:function(){var u=[],f=this.signal={aborted:!1,addEventListener:function(y,M){u.push(M)}};this.abort=function(){f.aborted=!0,u.forEach(function(y){return y()})}},PU=cr.unstable_scheduleCallback,zU=cr.unstable_NormalPriority,Ln={$$typeof:za,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0},WS=wt.S;wt.S=function(u,f){typeof f=="object"&&f!==null&&typeof f.then=="function"&&me(u,f),WS!==null&&WS(u,f)};var Vo=_(null),Ks=!1,In=!1,Ov=!1,XS=typeof WeakSet=="function"?WeakSet:Set,li=null,jS=!1,jn=null,dr=!1,Zr=null,dc=8192,FU={getCacheForType:function(u){var f=Si(Ln),y=f.data.get(u);return y===void 0&&(y=u(),f.data.set(u,y)),y}},Fd=0,Bd=1,kd=2,Gd=3,Hd=4;if(typeof Symbol=="function"&&Symbol.for){var ah=Symbol.for;Fd=ah("selector.component"),Bd=ah("selector.has_pseudo_class"),kd=ah("selector.role"),Gd=ah("selector.test_id"),Hd=ah("selector.text")}var BU=typeof WeakMap=="function"?WeakMap:Map,cn=0,fn=null,Ft=null,Vt=0,dn=0,pr=null,Js=!1,pc=!1,Lv=!1,Qs=0,Nn=0,Wa=0,Wo=0,Iv=0,Rr=0,mc=0,oh=null,ms=null,Nv=!1,Pv=0,lh=1/0,Vd=null,Xa=null,Wd=!1,Xo=null,ch=0,zv=0,Fv=null,uh=0,Bv=null;return zt.attemptContinuousHydration=function(u){if(u.tag===13){var f=pe(u,67108864);f!==null&&Oi(f,u,67108864),sv(u,67108864)}},zt.attemptHydrationAtCurrentPriority=function(u){if(u.tag===13){var f=lr(),y=pe(u,f);y!==null&&Oi(y,u,f),sv(u,f)}},zt.attemptSynchronousHydration=function(u){switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var f=S(u.pendingLanes);if(f!==0){for(u.pendingLanes|=2,u.entangledLanes|=2;f;){var y=1<<31-ur(f);u.entanglements[1]|=y,f&=~y}be(u),(cn&6)===0&&(lh=qr()+500,ue(0))}}break;case 13:f=pe(u,2),f!==null&&Oi(f,u,2),Xb(),sv(u,2)}},zt.batchedUpdates=function(u,f){return u(f)},zt.createComponentSelector=function(u){return{$$typeof:Fd,value:u}},zt.createContainer=function(u,f,y,M,C,N,Z,le,we,Fe){return sS(u,f,!1,null,y,M,N,Z,le,we,Fe,null)},zt.createHasPseudoClassSelector=function(u){return{$$typeof:Bd,value:u}},zt.createHydrationContainer=function(u,f,y,M,C,N,Z,le,we,Fe,Ke,ct,ht){return u=sS(y,M,!0,u,C,N,le,we,Fe,Ke,ct,ht),u.context=aS(null),y=u.current,M=lr(),C=Le(M),C.callback=f??null,Be(y,C,M),u.current.lanes=M,L(u,M),be(u),u},zt.createPortal=function(u,f,y){var M=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Kl,key:M==null?null:""+M,children:u,containerInfo:f,implementation:y}},zt.createRoleSelector=function(u){return{$$typeof:kd,value:u}},zt.createTestNameSelector=function(u){return{$$typeof:Gd,value:u}},zt.createTextSelector=function(u){return{$$typeof:Hd,value:u}},zt.defaultOnCaughtError=function(u){console.error(u)},zt.defaultOnRecoverableError=function(u){HS(u)},zt.defaultOnUncaughtError=function(u){HS(u)},zt.deferredUpdates=function(u){var f=wt.T,y=No();try{return ji(32),wt.T=null,u()}finally{ji(y),wt.T=f}},zt.discreteUpdates=function(u,f,y,M,C){var N=wt.T,Z=No();try{return ji(2),wt.T=null,u(f,y,M,C)}finally{ji(Z),wt.T=N,cn===0&&(lh=qr()+500)}},zt.findAllNodes=K0,zt.findBoundingRects=function(u,f){if(!Qu)throw Error(r(363));f=K0(u,f),u=[];for(var y=0;y<f.length;y++)u.push(U3(f[y]));for(f=u.length-1;0<f;f--){y=u[f];for(var M=y.x,C=M+y.width,N=y.y,Z=N+y.height,le=f-1;0<=le;le--)if(f!==le){var we=u[le],Fe=we.x,Ke=Fe+we.width,ct=we.y,ht=ct+we.height;if(M>=Fe&&N>=ct&&C<=Ke&&Z<=ht){u.splice(f,1);break}else if(M!==Fe||y.width!==we.width||ht<N||ct>Z){if(!(N!==ct||y.height!==we.height||Ke<M||Fe>C)){Fe>M&&(we.width+=Fe-M,we.x=M),Ke<C&&(we.width=C-Fe),u.splice(f,1);break}}else{ct>N&&(we.height+=ct-N,we.y=N),ht<Z&&(we.height=Z-ct),u.splice(f,1);break}}}return u},zt.findHostInstance=oS,zt.findHostInstanceWithNoPortals=function(u){return u=m(u),u=u!==null?x(u):null,u===null?null:Ju(u.stateNode)},zt.findHostInstanceWithWarning=function(u){return oS(u)},zt.flushPassiveEffects=Lo,zt.flushSyncFromReconciler=function(u){var f=cn;cn|=1;var y=wt.T,M=No();try{if(ji(2),wt.T=null,u)return u()}finally{ji(M),wt.T=y,cn=f,(cn&6)===0&&ue(0)}},zt.flushSyncWork=Xb,zt.focusWithin=function(u,f){if(!Qu)throw Error(r(363));for(u=q0(u),f=Gb(u,f),f=Array.from(f),u=0;u<f.length;){var y=f[u++],M=y.tag;if(!$u(y)){if((M===5||M===26||M===27)&&I3(y.stateNode))return!0;for(y=y.child;y!==null;)f.push(y),y=y.sibling}}return!1},zt.getFindAllNodesFailureDescription=function(u,f){if(!Qu)throw Error(r(363));var y=0,M=[];u=[q0(u),0];for(var C=0;C<u.length;){var N=u[C++],Z=N.tag,le=u[C++],we=f[le];if((Z!==5&&Z!==26&&Z!==27||!$u(N))&&(Y0(N,we)&&(M.push(Z0(we)),le++,le>y&&(y=le)),le<f.length))for(N=N.child;N!==null;)u.push(N,le),N=N.sibling}if(y<f.length){for(u=[];y<f.length;y++)u.push(Z0(f[y]));return`findAllNodes was able to match part of the selector:
|
|
3839
|
+
`+y.stack}}function d(u){var f=u,y=u;if(u.alternate)for(;f.return;)f=f.return;else{u=f;do f=u,(f.flags&4098)!==0&&(y=f.return),u=f.return;while(u)}return f.tag===3?y:null}function p(u){if(d(u)!==u)throw Error(r(188))}function m(u){var f=u.alternate;if(!f){if(f=d(u),f===null)throw Error(r(188));return f!==u?null:u}for(var y=u,M=f;;){var C=y.return;if(C===null)break;var N=C.alternate;if(N===null){if(M=C.return,M!==null){y=M;continue}break}if(C.child===N.child){for(N=C.child;N;){if(N===y)return p(C),u;if(N===M)return p(C),f;N=N.sibling}throw Error(r(188))}if(y.return!==M.return)y=C,M=N;else{for(var Z=!1,le=C.child;le;){if(le===y){Z=!0,y=C,M=N;break}if(le===M){Z=!0,M=C,y=N;break}le=le.sibling}if(!Z){for(le=N.child;le;){if(le===y){Z=!0,y=N,M=C;break}if(le===M){Z=!0,M=N,y=C;break}le=le.sibling}if(!Z)throw Error(r(189))}}if(y.alternate!==M)throw Error(r(190))}if(y.tag!==3)throw Error(r(188));return y.stateNode.current===y?u:f}function v(u){var f=u.tag;if(f===5||f===26||f===27||f===6)return u;for(u=u.child;u!==null;){if(f=v(u),f!==null)return f;u=u.sibling}return null}function x(u){var f=u.tag;if(f===5||f===26||f===27||f===6)return u;for(u=u.child;u!==null;){if(u.tag!==4&&(f=x(u),f!==null))return f;u=u.sibling}return null}function _(u){return{current:u}}function g(u){0>$l||(u.current=_v[$l],_v[$l]=null,$l--)}function b(u,f){$l++,_v[$l]=u.current,u.current=f}function E(u){return u>>>=0,u===0?32:31-(wU(u)/TU|0)|0}function S(u){var f=u&42;if(f!==0)return f;switch(u&-u){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return u&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return u&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return u}}function w(u,f){var y=u.pendingLanes;if(y===0)return 0;var M=0,C=u.suspendedLanes,N=u.pingedLanes,Z=u.warmLanes;u=u.finishedLanes!==0;var le=y&134217727;return le!==0?(y=le&~C,y!==0?M=S(y):(N&=le,N!==0?M=S(N):u||(Z=le&~Z,Z!==0&&(M=S(Z))))):(le=y&~C,le!==0?M=S(le):N!==0?M=S(N):u||(Z=y&~Z,Z!==0&&(M=S(Z)))),M===0?0:f!==0&&f!==M&&(f&C)===0&&(C=M&-M,Z=f&-f,C>=Z||C===32&&(Z&4194176)!==0)?f:M}function T(u,f){return(u.pendingLanes&~(u.suspendedLanes&~u.pingedLanes)&f)===0}function R(u,f){switch(u){case 1:case 2:case 4:case 8:return f+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return f+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function U(){var u=wd;return wd<<=1,(wd&4194176)===0&&(wd=128),u}function A(){var u=Td;return Td<<=1,(Td&62914560)===0&&(Td=4194304),u}function D(u){for(var f=[],y=0;31>y;y++)f.push(u);return f}function L(u,f){u.pendingLanes|=f,f!==268435456&&(u.suspendedLanes=0,u.pingedLanes=0,u.warmLanes=0)}function P(u,f,y,M,C,N){var Z=u.pendingLanes;u.pendingLanes=y,u.suspendedLanes=0,u.pingedLanes=0,u.warmLanes=0,u.expiredLanes&=y,u.entangledLanes&=y,u.errorRecoveryDisabledLanes&=y,u.shellSuspendCounter=0;var le=u.entanglements,we=u.expirationTimes,Fe=u.hiddenUpdates;for(y=Z&~y;0<y;){var Ke=31-ur(y),ct=1<<Ke;le[Ke]=0,we[Ke]=-1;var ht=Fe[Ke];if(ht!==null)for(Fe[Ke]=null,Ke=0;Ke<ht.length;Ke++){var Dt=ht[Ke];Dt!==null&&(Dt.lane&=-536870913)}y&=~ct}M!==0&&I(u,M,0),N!==0&&C===0&&u.tag!==0&&(u.suspendedLanes|=N&~(Z&~f))}function I(u,f,y){u.pendingLanes|=f,u.suspendedLanes&=~f;var M=31-ur(f);u.entangledLanes|=f,u.entanglements[M]=u.entanglements[M]|1073741824|y&4194218}function V(u,f){var y=u.entangledLanes|=f;for(u=u.entanglements;y;){var M=31-ur(y),C=1<<M;C&f|u[M]&f&&(u[M]|=f),y&=~C}}function H(u){return u&=-u,2<u?8<u?(u&134217727)!==0?32:268435456:8:2}function z(u){if(hr&&typeof hr.onCommitFiberRoot=="function")try{hr.onCommitFiberRoot(eh,u,void 0,(u.current.flags&128)===128)}catch{}}function O(u){if(typeof UU=="function"&&OU(u),hr&&typeof hr.setStrictMode=="function")try{hr.setStrictMode(eh,u)}catch{}}function B(u,f){return u===f&&(u!==0||1/u===1/f)||u!==u&&f!==f}function G(u,f){if(typeof u=="object"&&u!==null){var y=kS.get(u);return y!==void 0?y:(f={value:u,source:f,stack:h(f)},kS.set(u,f),f)}return{value:u,source:f,stack:h(f)}}function X(u,f){tc[nc++]=Rd,tc[nc++]=Cd,Cd=u,Rd=f}function k(u,f,y){wr[Tr++]=qs,wr[Tr++]=Ys,wr[Tr++]=zo,zo=u;var M=qs;u=Ys;var C=32-ur(M)-1;M&=~(1<<C),y+=1;var N=32-ur(f)+C;if(30<N){var Z=C-C%5;N=(M&(1<<Z)-1).toString(32),M>>=Z,C-=Z,qs=1<<32-ur(f)+C|y<<C|M,Ys=N+u}else qs=1<<N|y<<C|M,Ys=u}function Y(u){u.return!==null&&(X(u,1),k(u,1,0))}function Q(u){for(;u===Cd;)Cd=tc[--nc],tc[nc]=null,Rd=tc[--nc],tc[nc]=null;for(;u===zo;)zo=wr[--Tr],wr[Tr]=null,Ys=wr[--Tr],wr[Tr]=null,qs=wr[--Tr],wr[Tr]=null}function te(u,f){b(ka,f),b(th,u),b(pi,null),u=d3(f),g(pi),b(pi,u)}function ee(){g(pi),g(th),g(ka)}function ie(u){u.memoizedState!==null&&b(Dd,u);var f=pi.current,y=p3(f,u.type);f!==y&&(b(th,u),b(pi,y))}function re(u){th.current===u&&(g(pi),g(th)),Dd.current===u&&(g(Dd),js?Po._currentValue=Ql:Po._currentValue2=Ql)}function de(u){var f=Error(r(418,""));throw J(G(f,u)),Sv}function Ae(u,f){if(!Er)throw Error(r(175));oU(u.stateNode,u.type,u.memoizedProps,f,u)||de(u)}function Me(u){for(Li=u.return;Li;)switch(Li.tag){case 3:case 27:fs=!0;return;case 5:case 13:fs=!1;return;default:Li=Li.return}}function ve(u){if(!Er||u!==Li)return!1;if(!qt)return Me(u),qt=!0,!1;var f=!1;if(Mi?u.tag!==3&&u.tag!==27&&(u.tag!==5||RS(u.type)&&!Md(u.type,u.memoizedProps))&&(f=!0):u.tag!==3&&(u.tag!==5||RS(u.type)&&!Md(u.type,u.memoizedProps))&&(f=!0),f&&wi&&de(u),Me(u),u.tag===13){if(!Er)throw Error(r(316));if(u=u.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(r(317));wi=uU(u)}else wi=Li?AS(u.stateNode):null;return!0}function fe(){Er&&(wi=Li=null,qt=!1)}function J(u){Yr===null?Yr=[u]:Yr.push(u)}function oe(){for(var u=ic,f=Ev=ic=0;f<u;){var y=Ar[f];Ar[f++]=null;var M=Ar[f];Ar[f++]=null;var C=Ar[f];Ar[f++]=null;var N=Ar[f];if(Ar[f++]=null,M!==null&&C!==null){var Z=M.pending;Z===null?C.next=C:(C.next=Z.next,Z.next=C),M.pending=C}N!==0&&ye(y,C,N)}}function se(u,f,y,M){Ar[ic++]=u,Ar[ic++]=f,Ar[ic++]=y,Ar[ic++]=M,Ev|=M,u.lanes|=M,u=u.alternate,u!==null&&(u.lanes|=M)}function $(u,f,y,M){return se(u,f,y,M),xe(u)}function pe(u,f){return se(u,null,null,f),xe(u)}function ye(u,f,y){u.lanes|=y;var M=u.alternate;M!==null&&(M.lanes|=y);for(var C=!1,N=u.return;N!==null;)N.childLanes|=y,M=N.alternate,M!==null&&(M.childLanes|=y),N.tag===22&&(u=N.stateNode,u===null||u._visibility&1||(C=!0)),u=N,N=N.return;C&&f!==null&&u.tag===3&&(N=u.stateNode,C=31-ur(y),N=N.hiddenUpdates,u=N[C],u===null?N[C]=[f]:u.push(f),f.lane=y|536870912)}function xe(u){if(50<uh)throw uh=0,Bv=null,Error(r(185));for(var f=u.return;f!==null;)u=f,f=u.return;return u.tag===3?u.stateNode:null}function be(u){u!==rc&&u.next===null&&(rc===null?Ud=rc=u:rc=rc.next=u),Od=!0,Mv||(Mv=!0,Se(He))}function ue(u,f){if(!wv&&Od){wv=!0;do for(var y=!1,M=Ud;M!==null;){if(u!==0){var C=M.pendingLanes;if(C===0)var N=0;else{var Z=M.suspendedLanes,le=M.pingedLanes;N=(1<<31-ur(42|u)+1)-1,N&=C&~(Z&~le),N=N&201326677?N&201326677|1:N?N|2:0}N!==0&&(y=!0,ne(M,N))}else N=Vt,N=w(M,M===fn?N:0),(N&3)===0||T(M,N)||(y=!0,ne(M,N));M=M.next}while(y);wv=!1}}function He(){Od=Mv=!1;var u=0;sc!==0&&(S3()&&(u=sc),sc=0);for(var f=qr(),y=null,M=Ud;M!==null;){var C=M.next,N=W(M,f);N===0?(M.next=null,y===null?Ud=C:y.next=C,C===null&&(rc=y)):(y=M,(u!==0||(N&3)!==0)&&(Od=!0)),M=C}ue(u)}function W(u,f){for(var y=u.suspendedLanes,M=u.pingedLanes,C=u.expirationTimes,N=u.pendingLanes&-62914561;0<N;){var Z=31-ur(N),le=1<<Z,we=C[Z];we===-1?((le&y)===0||(le&M)!==0)&&(C[Z]=R(le,f)):we<=f&&(u.expiredLanes|=le),N&=~le}if(f=fn,y=Vt,y=w(u,u===f?y:0),M=u.callbackNode,y===0||u===f&&dn===2||u.cancelPendingCommit!==null)return M!==null&&M!==null&&xv(M),u.callbackNode=null,u.callbackPriority=0;if((y&3)===0||T(u,y)){if(f=y&-y,f===u.callbackPriority)return f;switch(M!==null&&xv(M),H(y)){case 2:case 8:y=RU;break;case 32:y=bv;break;case 268435456:y=DU;break;default:y=bv}return M=F.bind(null,u),y=Ad(y,M),u.callbackPriority=f,u.callbackNode=y,f}return M!==null&&M!==null&&xv(M),u.callbackPriority=2,u.callbackNode=null,2}function F(u,f){var y=u.callbackNode;if(Lo()&&u.callbackNode!==y)return null;var M=Vt;return M=w(u,u===fn?M:0),M===0?null:(Vb(u,M,f),W(u,qr()),u.callbackNode!=null&&u.callbackNode===y?F.bind(null,u):null)}function ne(u,f){if(Lo())return null;Vb(u,f,!0)}function Se(u){C3?R3(function(){(cn&6)!==0?Ad(BS,u):u()}):Ad(BS,u)}function _e(){return sc===0&&(sc=U()),sc}function me(u,f){if(nh===null){var y=nh=[];Tv=0,ac=_e(),oc={status:"pending",value:void 0,then:function(M){y.push(M)}}}return Tv++,f.then(ze,ze),f}function ze(){if(--Tv===0&&nh!==null){oc!==null&&(oc.status="fulfilled");var u=nh;nh=null,ac=0,oc=null;for(var f=0;f<u.length;f++)(0,u[f])()}}function Ne(u,f){var y=[],M={status:"pending",value:null,reason:null,then:function(C){y.push(C)}};return u.then(function(){M.status="fulfilled",M.value=f;for(var C=0;C<y.length;C++)(0,y[C])(f)},function(C){for(M.status="rejected",M.reason=C,C=0;C<y.length;C++)(0,y[C])(void 0)}),M}function je(u){u.updateQueue={baseState:u.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ze(u,f){u=u.updateQueue,f.updateQueue===u&&(f.updateQueue={baseState:u.baseState,firstBaseUpdate:u.firstBaseUpdate,lastBaseUpdate:u.lastBaseUpdate,shared:u.shared,callbacks:null})}function Le(u){return{lane:u,tag:0,payload:null,callback:null,next:null}}function Be(u,f,y){var M=u.updateQueue;if(M===null)return null;if(M=M.shared,(cn&2)!==0){var C=M.pending;return C===null?f.next=f:(f.next=C.next,C.next=f),M.pending=f,f=xe(u),ye(u,null,y),f}return se(u,M,f,y),xe(u)}function Ve(u,f,y){if(f=f.updateQueue,f!==null&&(f=f.shared,(y&4194176)!==0)){var M=f.lanes;M&=u.pendingLanes,y|=M,f.lanes=y,V(u,y)}}function Je(u,f){var y=u.updateQueue,M=u.alternate;if(M!==null&&(M=M.updateQueue,y===M)){var C=null,N=null;if(y=y.firstBaseUpdate,y!==null){do{var Z={lane:y.lane,tag:y.tag,payload:y.payload,callback:null,next:null};N===null?C=N=Z:N=N.next=Z,y=y.next}while(y!==null);N===null?C=N=f:N=N.next=f}else C=N=f;y={baseState:M.baseState,firstBaseUpdate:C,lastBaseUpdate:N,shared:M.shared,callbacks:M.callbacks},u.updateQueue=y;return}u=y.lastBaseUpdate,u===null?y.firstBaseUpdate=f:u.next=f,y.lastBaseUpdate=f}function We(){if(Av){var u=oc;if(u!==null)throw u}}function dt(u,f,y,M){Av=!1;var C=u.updateQueue;Ga=!1;var N=C.firstBaseUpdate,Z=C.lastBaseUpdate,le=C.shared.pending;if(le!==null){C.shared.pending=null;var we=le,Fe=we.next;we.next=null,Z===null?N=Fe:Z.next=Fe,Z=we;var Ke=u.alternate;Ke!==null&&(Ke=Ke.updateQueue,le=Ke.lastBaseUpdate,le!==Z&&(le===null?Ke.firstBaseUpdate=Fe:le.next=Fe,Ke.lastBaseUpdate=we))}if(N!==null){var ct=C.baseState;Z=0,Ke=Fe=we=null,le=N;do{var ht=le.lane&-536870913,Dt=ht!==le.lane;if(Dt?(Vt&ht)===ht:(M&ht)===ht){ht!==0&&ht===ac&&(Av=!0),Ke!==null&&(Ke=Ke.next={lane:0,tag:le.tag,payload:le.payload,callback:null,next:null});e:{var Dr=u,hh=le;ht=f;var jo=y;switch(hh.tag){case 1:if(Dr=hh.payload,typeof Dr=="function"){ct=Dr.call(jo,ct,ht);break e}ct=Dr;break e;case 3:Dr.flags=Dr.flags&-65537|128;case 0:if(Dr=hh.payload,ht=typeof Dr=="function"?Dr.call(jo,ct,ht):Dr,ht==null)break e;ct=av({},ct,ht);break e;case 2:Ga=!0}}ht=le.callback,ht!==null&&(u.flags|=64,Dt&&(u.flags|=8192),Dt=C.callbacks,Dt===null?C.callbacks=[ht]:Dt.push(ht))}else Dt={lane:ht,tag:le.tag,payload:le.payload,callback:le.callback,next:null},Ke===null?(Fe=Ke=Dt,we=ct):Ke=Ke.next=Dt,Z|=ht;if(le=le.next,le===null){if(le=C.shared.pending,le===null)break;Dt=le,le=Dt.next,Dt.next=null,C.lastBaseUpdate=Dt,C.shared.pending=null}}while(!0);Ke===null&&(we=ct),C.baseState=we,C.firstBaseUpdate=Fe,C.lastBaseUpdate=Ke,N===null&&(C.shared.lanes=0),Wa|=Z,u.lanes=Z,u.memoizedState=ct}}function ce(u,f){if(typeof u!="function")throw Error(r(191,u));u.call(f)}function Ie(u,f){var y=u.callbacks;if(y!==null)for(u.callbacks=null,u=0;u<y.length;u++)ce(y[u],f)}function Ge(u,f){if(fr(u,f))return!0;if(typeof u!="object"||u===null||typeof f!="object"||f===null)return!1;var y=Object.keys(u),M=Object.keys(f);if(y.length!==M.length)return!1;for(M=0;M<y.length;M++){var C=y[M];if(!LU.call(f,C)||!fr(u[C],f[C]))return!1}return!0}function rt(u){return u=u.status,u==="fulfilled"||u==="rejected"}function Pe(){}function De(u,f,y){switch(y=u[y],y===void 0?u.push(f):y!==f&&(f.then(Pe,Pe),f=y),f.status){case"fulfilled":return f.value;case"rejected":throw u=f.reason,u===ih?Error(r(483)):u;default:if(typeof f.status=="string")f.then(Pe,Pe);else{if(u=fn,u!==null&&100<u.shellSuspendCounter)throw Error(r(482));u=f,u.status="pending",u.then(function(M){if(f.status==="pending"){var C=f;C.status="fulfilled",C.value=M}},function(M){if(f.status==="pending"){var C=f;C.status="rejected",C.reason=M}})}switch(f.status){case"fulfilled":return f.value;case"rejected":throw u=f.reason,u===ih?Error(r(483)):u}throw lc=f,ih}}function Qe(){if(lc===null)throw Error(r(459));var u=lc;return lc=null,u}function ot(u){var f=rh;return rh+=1,cc===null&&(cc=[]),De(cc,u,f)}function st(u,f){f=f.props.ref,u.ref=f!==void 0?f:null}function mt(u,f){throw f.$$typeof===o3?Error(r(525)):(u=Object.prototype.toString.call(f),Error(r(31,u==="[object Object]"?"object with keys {"+Object.keys(f).join(", ")+"}":u)))}function on(u){var f=u._init;return f(u._payload)}function en(u){function f(Ce,Ee){if(u){var Oe=Ce.deletions;Oe===null?(Ce.deletions=[Ee],Ce.flags|=16):Oe.push(Ee)}}function y(Ce,Ee){if(!u)return null;for(;Ee!==null;)f(Ce,Ee),Ee=Ee.sibling;return null}function M(Ce){for(var Ee=new Map;Ce!==null;)Ce.key!==null?Ee.set(Ce.key,Ce):Ee.set(Ce.index,Ce),Ce=Ce.sibling;return Ee}function C(Ce,Ee){return Ce=Pa(Ce,Ee),Ce.index=0,Ce.sibling=null,Ce}function N(Ce,Ee,Oe){return Ce.index=Oe,u?(Oe=Ce.alternate,Oe!==null?(Oe=Oe.index,Oe<Ee?(Ce.flags|=33554434,Ee):Oe):(Ce.flags|=33554434,Ee)):(Ce.flags|=1048576,Ee)}function Z(Ce){return u&&Ce.alternate===null&&(Ce.flags|=33554434),Ce}function le(Ce,Ee,Oe,qe){return Ee===null||Ee.tag!==6?(Ee=iv(Oe,Ce.mode,qe),Ee.return=Ce,Ee):(Ee=C(Ee,Oe),Ee.return=Ce,Ee)}function we(Ce,Ee,Oe,qe){var yt=Oe.type;return yt===Jl?Ke(Ce,Ee,Oe.props.children,qe,Oe.key):Ee!==null&&(Ee.elementType===yt||typeof yt=="object"&&yt!==null&&yt.$$typeof===Fa&&on(yt)===Ee.type)?(Ee=C(Ee,Oe.props),st(Ee,Oe),Ee.return=Ce,Ee):(Ee=bd(Oe.type,Oe.key,Oe.props,null,Ce.mode,qe),st(Ee,Oe),Ee.return=Ce,Ee)}function Fe(Ce,Ee,Oe,qe){return Ee===null||Ee.tag!==4||Ee.stateNode.containerInfo!==Oe.containerInfo||Ee.stateNode.implementation!==Oe.implementation?(Ee=rv(Oe,Ce.mode,qe),Ee.return=Ce,Ee):(Ee=C(Ee,Oe.children||[]),Ee.return=Ce,Ee)}function Ke(Ce,Ee,Oe,qe,yt){return Ee===null||Ee.tag!==7?(Ee=Io(Oe,Ce.mode,qe,yt),Ee.return=Ce,Ee):(Ee=C(Ee,Oe),Ee.return=Ce,Ee)}function ct(Ce,Ee,Oe){if(typeof Ee=="string"&&Ee!==""||typeof Ee=="number"||typeof Ee=="bigint")return Ee=iv(""+Ee,Ce.mode,Oe),Ee.return=Ce,Ee;if(typeof Ee=="object"&&Ee!==null){switch(Ee.$$typeof){case Sd:return Oe=bd(Ee.type,Ee.key,Ee.props,null,Ce.mode,Oe),st(Oe,Ee),Oe.return=Ce,Oe;case Kl:return Ee=rv(Ee,Ce.mode,Oe),Ee.return=Ce,Ee;case Fa:var qe=Ee._init;return Ee=qe(Ee._payload),ct(Ce,Ee,Oe)}if(Ed(Ee)||s(Ee))return Ee=Io(Ee,Ce.mode,Oe,null),Ee.return=Ce,Ee;if(typeof Ee.then=="function")return ct(Ce,ot(Ee),Oe);if(Ee.$$typeof===za)return ct(Ce,md(Ce,Ee),Oe);mt(Ce,Ee)}return null}function ht(Ce,Ee,Oe,qe){var yt=Ee!==null?Ee.key:null;if(typeof Oe=="string"&&Oe!==""||typeof Oe=="number"||typeof Oe=="bigint")return yt!==null?null:le(Ce,Ee,""+Oe,qe);if(typeof Oe=="object"&&Oe!==null){switch(Oe.$$typeof){case Sd:return Oe.key===yt?we(Ce,Ee,Oe,qe):null;case Kl:return Oe.key===yt?Fe(Ce,Ee,Oe,qe):null;case Fa:return yt=Oe._init,Oe=yt(Oe._payload),ht(Ce,Ee,Oe,qe)}if(Ed(Oe)||s(Oe))return yt!==null?null:Ke(Ce,Ee,Oe,qe,null);if(typeof Oe.then=="function")return ht(Ce,Ee,ot(Oe),qe);if(Oe.$$typeof===za)return ht(Ce,Ee,md(Ce,Oe),qe);mt(Ce,Oe)}return null}function Dt(Ce,Ee,Oe,qe,yt){if(typeof qe=="string"&&qe!==""||typeof qe=="number"||typeof qe=="bigint")return Ce=Ce.get(Oe)||null,le(Ee,Ce,""+qe,yt);if(typeof qe=="object"&&qe!==null){switch(qe.$$typeof){case Sd:return Ce=Ce.get(qe.key===null?Oe:qe.key)||null,we(Ee,Ce,qe,yt);case Kl:return Ce=Ce.get(qe.key===null?Oe:qe.key)||null,Fe(Ee,Ce,qe,yt);case Fa:var yn=qe._init;return qe=yn(qe._payload),Dt(Ce,Ee,Oe,qe,yt)}if(Ed(qe)||s(qe))return Ce=Ce.get(Oe)||null,Ke(Ee,Ce,qe,yt,null);if(typeof qe.then=="function")return Dt(Ce,Ee,Oe,ot(qe),yt);if(qe.$$typeof===za)return Dt(Ce,Ee,Oe,md(Ee,qe),yt);mt(Ee,qe)}return null}function Dr(Ce,Ee,Oe,qe){for(var yt=null,yn=null,Et=Ee,Yt=Ee=0,ci=null;Et!==null&&Yt<Oe.length;Yt++){Et.index>Yt?(ci=Et,Et=null):ci=Et.sibling;var Zt=ht(Ce,Et,Oe[Yt],qe);if(Zt===null){Et===null&&(Et=ci);break}u&&Et&&Zt.alternate===null&&f(Ce,Et),Ee=N(Zt,Ee,Yt),yn===null?yt=Zt:yn.sibling=Zt,yn=Zt,Et=ci}if(Yt===Oe.length)return y(Ce,Et),qt&&X(Ce,Yt),yt;if(Et===null){for(;Yt<Oe.length;Yt++)Et=ct(Ce,Oe[Yt],qe),Et!==null&&(Ee=N(Et,Ee,Yt),yn===null?yt=Et:yn.sibling=Et,yn=Et);return qt&&X(Ce,Yt),yt}for(Et=M(Et);Yt<Oe.length;Yt++)ci=Dt(Et,Ce,Yt,Oe[Yt],qe),ci!==null&&(u&&ci.alternate!==null&&Et.delete(ci.key===null?Yt:ci.key),Ee=N(ci,Ee,Yt),yn===null?yt=ci:yn.sibling=ci,yn=ci);return u&&Et.forEach(function(ja){return f(Ce,ja)}),qt&&X(Ce,Yt),yt}function hh(Ce,Ee,Oe,qe){if(Oe==null)throw Error(r(151));for(var yt=null,yn=null,Et=Ee,Yt=Ee=0,ci=null,Zt=Oe.next();Et!==null&&!Zt.done;Yt++,Zt=Oe.next()){Et.index>Yt?(ci=Et,Et=null):ci=Et.sibling;var ja=ht(Ce,Et,Zt.value,qe);if(ja===null){Et===null&&(Et=ci);break}u&&Et&&ja.alternate===null&&f(Ce,Et),Ee=N(ja,Ee,Yt),yn===null?yt=ja:yn.sibling=ja,yn=ja,Et=ci}if(Zt.done)return y(Ce,Et),qt&&X(Ce,Yt),yt;if(Et===null){for(;!Zt.done;Yt++,Zt=Oe.next())Zt=ct(Ce,Zt.value,qe),Zt!==null&&(Ee=N(Zt,Ee,Yt),yn===null?yt=Zt:yn.sibling=Zt,yn=Zt);return qt&&X(Ce,Yt),yt}for(Et=M(Et);!Zt.done;Yt++,Zt=Oe.next())Zt=Dt(Et,Ce,Yt,Zt.value,qe),Zt!==null&&(u&&Zt.alternate!==null&&Et.delete(Zt.key===null?Yt:Zt.key),Ee=N(Zt,Ee,Yt),yn===null?yt=Zt:yn.sibling=Zt,yn=Zt);return u&&Et.forEach(function(kU){return f(Ce,kU)}),qt&&X(Ce,Yt),yt}function jo(Ce,Ee,Oe,qe){if(typeof Oe=="object"&&Oe!==null&&Oe.type===Jl&&Oe.key===null&&(Oe=Oe.props.children),typeof Oe=="object"&&Oe!==null){switch(Oe.$$typeof){case Sd:e:{for(var yt=Oe.key;Ee!==null;){if(Ee.key===yt){if(yt=Oe.type,yt===Jl){if(Ee.tag===7){y(Ce,Ee.sibling),qe=C(Ee,Oe.props.children),qe.return=Ce,Ce=qe;break e}}else if(Ee.elementType===yt||typeof yt=="object"&&yt!==null&&yt.$$typeof===Fa&&on(yt)===Ee.type){y(Ce,Ee.sibling),qe=C(Ee,Oe.props),st(qe,Oe),qe.return=Ce,Ce=qe;break e}y(Ce,Ee);break}else f(Ce,Ee);Ee=Ee.sibling}Oe.type===Jl?(qe=Io(Oe.props.children,Ce.mode,qe,Oe.key),qe.return=Ce,Ce=qe):(qe=bd(Oe.type,Oe.key,Oe.props,null,Ce.mode,qe),st(qe,Oe),qe.return=Ce,Ce=qe)}return Z(Ce);case Kl:e:{for(yt=Oe.key;Ee!==null;){if(Ee.key===yt)if(Ee.tag===4&&Ee.stateNode.containerInfo===Oe.containerInfo&&Ee.stateNode.implementation===Oe.implementation){y(Ce,Ee.sibling),qe=C(Ee,Oe.children||[]),qe.return=Ce,Ce=qe;break e}else{y(Ce,Ee);break}else f(Ce,Ee);Ee=Ee.sibling}qe=rv(Oe,Ce.mode,qe),qe.return=Ce,Ce=qe}return Z(Ce);case Fa:return yt=Oe._init,Oe=yt(Oe._payload),jo(Ce,Ee,Oe,qe)}if(Ed(Oe))return Dr(Ce,Ee,Oe,qe);if(s(Oe)){if(yt=s(Oe),typeof yt!="function")throw Error(r(150));return Oe=yt.call(Oe),hh(Ce,Ee,Oe,qe)}if(typeof Oe.then=="function")return jo(Ce,Ee,ot(Oe),qe);if(Oe.$$typeof===za)return jo(Ce,Ee,md(Ce,Oe),qe);mt(Ce,Oe)}return typeof Oe=="string"&&Oe!==""||typeof Oe=="number"||typeof Oe=="bigint"?(Oe=""+Oe,Ee!==null&&Ee.tag===6?(y(Ce,Ee.sibling),qe=C(Ee,Oe),qe.return=Ce,Ce=qe):(y(Ce,Ee),qe=iv(Oe,Ce.mode,qe),qe.return=Ce,Ce=qe),Z(Ce)):y(Ce,Ee)}return function(Ce,Ee,Oe,qe){try{rh=0;var yt=jo(Ce,Ee,Oe,qe);return cc=null,yt}catch(Et){if(Et===ih)throw Et;var yn=t(29,Et,null,Ce.mode);return yn.lanes=qe,yn.return=Ce,yn}}}function gn(u,f){u=Qs,b(Id,u),b(uc,f),Qs=u|f.baseLanes}function bn(){b(Id,Qs),b(uc,uc.current)}function xi(){Qs=Id.current,g(uc),g(Id)}function Bn(u){var f=u.alternate;b(ti,ti.current&1),b(Cr,u),ds===null&&(f===null||uc.current!==null||f.memoizedState!==null)&&(ds=u)}function Hi(u){if(u.tag===22){if(b(ti,ti.current),b(Cr,u),ds===null){var f=u.alternate;f!==null&&f.memoizedState!==null&&(ds=u)}}else kn()}function kn(){b(ti,ti.current),b(Cr,Cr.current)}function Un(u){g(Cr),ds===u&&(ds=null),g(ti)}function vn(u){for(var f=u;f!==null;){if(f.tag===13){var y=f.memoizedState;if(y!==null&&(y=y.dehydrated,y===null||gv(y)||vv(y)))return f}else if(f.tag===19&&f.memoizedProps.revealOrder!==void 0){if((f.flags&128)!==0)return f}else if(f.child!==null){f.child.return=f,f=f.child;continue}if(f===u)break;for(;f.sibling===null;){if(f.return===null||f.return===u)return null;f=f.return}f.sibling.return=f.return,f=f.sibling}return null}function jt(){throw Error(r(321))}function Ls(u,f){if(f===null)return!1;for(var y=0;y<f.length&&y<u.length;y++)if(!fr(u[y],f[y]))return!1;return!0}function Is(u,f,y,M,C,N){return Ha=N,Nt=f,f.memoizedState=null,f.updateQueue=null,f.lanes=0,wt.H=u===null||u.memoizedState===null?ko:Va,Bo=!1,N=y(M,C),Bo=!1,hc&&(N=xo(f,y,M,C)),Bl(u),N}function Bl(u){wt.H=ps;var f=ln!==null&&ln.next!==null;if(Ha=0,Xn=ln=Nt=null,Nd=!1,sh=0,fc=null,f)throw Error(r(300));u===null||oi||(u=u.dependencies,u!==null&&pd(u)&&(oi=!0))}function xo(u,f,y,M){Nt=u;var C=0;do{if(hc&&(fc=null),sh=0,hc=!1,25<=C)throw Error(r(301));if(C+=1,Xn=ln=null,u.updateQueue!=null){var N=u.updateQueue;N.lastEffect=null,N.events=null,N.stores=null,N.memoCache!=null&&(N.memoCache.index=0)}wt.H=Go,N=f(y,M)}while(hc);return N}function Ca(){var u=wt.H,f=u.useState()[0];return f=typeof f.then=="function"?Ue(f):f,u=u.useState()[0],(ln!==null?ln.memoizedState:null)!==u&&(Nt.flags|=1024),f}function Ns(){var u=Pd!==0;return Pd=0,u}function bo(u,f,y){f.updateQueue=u.updateQueue,f.flags&=-2053,u.lanes&=~y}function q(u){if(Nd){for(u=u.memoizedState;u!==null;){var f=u.queue;f!==null&&(f.pending=null),u=u.next}Nd=!1}Ha=0,Xn=ln=Nt=null,hc=!1,sh=Pd=0,fc=null}function ge(){var u={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xn===null?Nt.memoizedState=Xn=u:Xn=Xn.next=u,Xn}function Te(){if(ln===null){var u=Nt.alternate;u=u!==null?u.memoizedState:null}else u=ln.next;var f=Xn===null?Nt.memoizedState:Xn.next;if(f!==null)Xn=f,ln=u;else{if(u===null)throw Nt.alternate===null?Error(r(467)):Error(r(310));ln=u,u={memoizedState:ln.memoizedState,baseState:ln.baseState,baseQueue:ln.baseQueue,queue:ln.queue,next:null},Xn===null?Nt.memoizedState=Xn=u:Xn=Xn.next=u}return Xn}function Ue(u){var f=sh;return sh+=1,fc===null&&(fc=[]),u=De(fc,u,f),f=Nt,(Xn===null?f.memoizedState:Xn.next)===null&&(f=f.alternate,wt.H=f===null||f.memoizedState===null?ko:Va),u}function ae(u){if(u!==null&&typeof u=="object"){if(typeof u.then=="function")return Ue(u);if(u.$$typeof===za)return Si(u)}throw Error(r(438,String(u)))}function Xe(u){var f=null,y=Nt.updateQueue;if(y!==null&&(f=y.memoCache),f==null){var M=Nt.alternate;M!==null&&(M=M.updateQueue,M!==null&&(M=M.memoCache,M!=null&&(f={data:M.data.map(function(C){return C.slice()}),index:0})))}if(f==null&&(f={data:[],index:0}),y===null&&(y=Rv(),Nt.updateQueue=y),y.memoCache=f,y=f.data[f.index],y===void 0)for(y=f.data[f.index]=Array(u),M=0;M<u;M++)y[M]=c3;return f.index++,y}function $e(u,f){return typeof f=="function"?f(u):f}function lt(u){var f=Te();return at(f,ln,u)}function at(u,f,y){var M=u.queue;if(M===null)throw Error(r(311));M.lastRenderedReducer=y;var C=u.baseQueue,N=M.pending;if(N!==null){if(C!==null){var Z=C.next;C.next=N.next,N.next=Z}f.baseQueue=C=N,M.pending=null}if(N=u.baseState,C===null)u.memoizedState=N;else{f=C.next;var le=Z=null,we=null,Fe=f,Ke=!1;do{var ct=Fe.lane&-536870913;if(ct!==Fe.lane?(Vt&ct)===ct:(Ha&ct)===ct){var ht=Fe.revertLane;if(ht===0)we!==null&&(we=we.next={lane:0,revertLane:0,action:Fe.action,hasEagerState:Fe.hasEagerState,eagerState:Fe.eagerState,next:null}),ct===ac&&(Ke=!0);else if((Ha&ht)===ht){Fe=Fe.next,ht===ac&&(Ke=!0);continue}else ct={lane:0,revertLane:Fe.revertLane,action:Fe.action,hasEagerState:Fe.hasEagerState,eagerState:Fe.eagerState,next:null},we===null?(le=we=ct,Z=N):we=we.next=ct,Nt.lanes|=ht,Wa|=ht;ct=Fe.action,Bo&&y(N,ct),N=Fe.hasEagerState?Fe.eagerState:y(N,ct)}else ht={lane:ct,revertLane:Fe.revertLane,action:Fe.action,hasEagerState:Fe.hasEagerState,eagerState:Fe.eagerState,next:null},we===null?(le=we=ht,Z=N):we=we.next=ht,Nt.lanes|=ct,Wa|=ct;Fe=Fe.next}while(Fe!==null&&Fe!==f);if(we===null?Z=N:we.next=le,!fr(N,u.memoizedState)&&(oi=!0,Ke&&(y=oc,y!==null)))throw y;u.memoizedState=N,u.baseState=Z,u.baseQueue=we,M.lastRenderedState=N}return C===null&&(M.lanes=0),[u.memoizedState,M.dispatch]}function vt(u){var f=Te(),y=f.queue;if(y===null)throw Error(r(311));y.lastRenderedReducer=u;var M=y.dispatch,C=y.pending,N=f.memoizedState;if(C!==null){y.pending=null;var Z=C=C.next;do N=u(N,Z.action),Z=Z.next;while(Z!==C);fr(N,f.memoizedState)||(oi=!0),f.memoizedState=N,f.baseQueue===null&&(f.baseState=N),y.lastRenderedState=N}return[N,M]}function _t(u,f,y){var M=Nt,C=Te(),N=qt;if(N){if(y===void 0)throw Error(r(407));y=y()}else y=f();var Z=!fr((ln||C).memoizedState,y);if(Z&&(C.memoizedState=y,oi=!0),C=C.queue,Ps(Ht.bind(null,M,C,u),[u]),C.getSnapshot!==f||Z||Xn!==null&&Xn.memoizedState.tag&1){if(M.flags|=2048,ei(9,Tt.bind(null,M,C,y,f),{destroy:void 0},null),fn===null)throw Error(r(349));N||(Ha&60)!==0||pt(M,f,y)}return y}function pt(u,f,y){u.flags|=16384,u={getSnapshot:f,value:y},f=Nt.updateQueue,f===null?(f=Rv(),Nt.updateQueue=f,f.stores=[u]):(y=f.stores,y===null?f.stores=[u]:y.push(u))}function Tt(u,f,y,M){f.value=y,f.getSnapshot=M,tn(f)&&Jt(u)}function Ht(u,f,y){return y(function(){tn(f)&&Jt(u)})}function tn(u){var f=u.getSnapshot;u=u.value;try{var y=f();return!fr(u,y)}catch{return!0}}function Jt(u){var f=pe(u,2);f!==null&&Oi(f,u,2)}function kt(u){var f=ge();if(typeof u=="function"){var y=u;if(u=y(),Bo){O(!0);try{y()}finally{O(!1)}}}return f.memoizedState=f.baseState=u,f.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$e,lastRenderedState:u},f}function gt(u,f,y,M){return u.baseState=y,at(u,ln,typeof M=="function"?M:$e)}function Qt(u,f,y,M,C){if(Co(u))throw Error(r(485));if(u=f.action,u!==null){var N={payload:C,action:u,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(Z){N.listeners.push(Z)}};wt.T!==null?y(!0):N.isTransition=!1,M(N),y=f.pending,y===null?(N.next=f.pending=N,It(f,N)):(N.next=y.next,f.pending=y.next=N)}}function It(u,f){var y=f.action,M=f.payload,C=u.state;if(f.isTransition){var N=wt.T,Z={};wt.T=Z;try{var le=y(C,M),we=wt.S;we!==null&&we(Z,le),Sn(u,f,le)}catch(Fe){Gn(u,f,Fe)}finally{wt.T=N}}else try{N=y(C,M),Sn(u,f,N)}catch(Fe){Gn(u,f,Fe)}}function Sn(u,f,y){y!==null&&typeof y=="object"&&typeof y.then=="function"?y.then(function(M){rr(u,f,M)},function(M){return Gn(u,f,M)}):rr(u,f,y)}function rr(u,f,y){f.status="fulfilled",f.value=y,xr(f),u.state=y,f=u.pending,f!==null&&(y=f.next,y===f?u.pending=null:(y=y.next,f.next=y,It(u,y)))}function Gn(u,f,y){var M=u.pending;if(u.pending=null,M!==null){M=M.next;do f.status="rejected",f.reason=y,xr(f),f=f.next;while(f!==M)}u.action=null}function xr(u){u=u.listeners;for(var f=0;f<u.length;f++)(0,u[f])()}function Pt(u,f){return f}function fi(u,f){if(qt){var y=fn.formState;if(y!==null){e:{var M=Nt;if(qt){if(wi){var C=eU(wi,fs);if(C){wi=AS(C),M=tU(C);break e}}de(M)}M=!1}M&&(f=y[0])}}y=ge(),y.memoizedState=y.baseState=f,M={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pt,lastRenderedState:f},y.queue=M,y=ku.bind(null,Nt,M),M.dispatch=y,M=kt(!1);var N=Vl.bind(null,Nt,!1,M.queue);return M=ge(),C={state:f,dispatch:null,action:u,pending:null},M.queue=C,y=Qt.bind(null,Nt,C,N,y),C.dispatch=y,M.memoizedState=u,[f,y,!1]}function Vn(u){var f=Te();return xn(f,ln,u)}function xn(u,f,y){f=at(u,f,Pt)[0],u=lt($e)[0],f=typeof f=="object"&&f!==null&&typeof f.then=="function"?Ue(f):f;var M=Te(),C=M.queue,N=C.dispatch;return y!==M.memoizedState&&(Nt.flags|=2048,ei(9,$n.bind(null,C,y),{destroy:void 0},null)),[f,N,u]}function $n(u,f){u.action=f}function Wr(u){var f=Te(),y=ln;if(y!==null)return xn(f,y,u);Te(),f=f.memoizedState,y=Te();var M=y.queue.dispatch;return y.memoizedState=u,[f,M,!1]}function ei(u,f,y,M){return u={tag:u,create:f,inst:y,deps:M,next:null},f=Nt.updateQueue,f===null&&(f=Rv(),Nt.updateQueue=f),y=f.lastEffect,y===null?f.lastEffect=u.next=u:(M=y.next,y.next=u,u.next=M,f.lastEffect=u),u}function kl(){return Te().memoizedState}function So(u,f,y,M){var C=ge();Nt.flags|=u,C.memoizedState=ei(1|f,y,{destroy:void 0},M===void 0?null:M)}function Eo(u,f,y,M){var C=Te();M=M===void 0?null:M;var N=C.memoizedState.inst;ln!==null&&M!==null&&Ls(M,ln.memoizedState.deps)?C.memoizedState=ei(f,y,N,M):(Nt.flags|=u,C.memoizedState=ei(1|f,y,N,M))}function Gl(u,f){So(8390656,8,u,f)}function Ps(u,f){Eo(2048,8,u,f)}function Nu(u,f){return Eo(4,2,u,f)}function Mo(u,f){return Eo(4,4,u,f)}function zs(u,f){if(typeof f=="function"){u=u();var y=f(u);return function(){typeof y=="function"?y():f(null)}}if(f!=null)return u=u(),f.current=u,function(){f.current=null}}function Fs(u,f,y){y=y!=null?y.concat([u]):null,Eo(4,4,zs.bind(null,f,u),y)}function Bs(){}function Pu(u,f){var y=Te();f=f===void 0?null:f;var M=y.memoizedState;return f!==null&&Ls(f,M[1])?M[0]:(y.memoizedState=[u,f],u)}function Ra(u,f){var y=Te();f=f===void 0?null:f;var M=y.memoizedState;if(f!==null&&Ls(f,M[1]))return M[0];if(M=u(),Bo){O(!0);try{u()}finally{O(!1)}}return y.memoizedState=[M,f],M}function wo(u,f,y){return y===void 0||(Ha&1073741824)!==0?u.memoizedState=f:(u.memoizedState=y,u=Hb(),Nt.lanes|=u,Wa|=u,y)}function Hl(u,f,y,M){return fr(y,f)?y:uc.current!==null?(u=wo(u,y,M),fr(u,f)||(oi=!0),u):(Ha&42)===0?(oi=!0,u.memoizedState=y):(u=Hb(),Nt.lanes|=u,Wa|=u,f)}function zu(u,f,y,M,C){var N=No();ji(N!==0&&8>N?N:8);var Z=wt.T,le={};wt.T=le,Vl(u,!1,f,y);try{var we=C(),Fe=wt.S;if(Fe!==null&&Fe(le,we),we!==null&&typeof we=="object"&&typeof we.then=="function"){var Ke=Ne(we,M);ks(u,f,Ke,lr(u))}else ks(u,f,M,lr(u))}catch(ct){ks(u,f,{then:function(){},status:"rejected",reason:ct},lr())}finally{ji(N),wt.T=Z}}function To(u){var f=u.memoizedState;if(f!==null)return f;f={memoizedState:Ql,baseState:Ql,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$e,lastRenderedState:Ql},next:null};var y={};return f.next={memoizedState:y,baseState:y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$e,lastRenderedState:y},next:null},u.memoizedState=f,u=u.alternate,u!==null&&(u.memoizedState=f),f}function Ao(){return Si(Po)}function Fu(){return Te().memoizedState}function Vi(){return Te().memoizedState}function Bu(u){for(var f=u.return;f!==null;){switch(f.tag){case 24:case 3:var y=lr();u=Le(y);var M=Be(f,u,y);M!==null&&(Oi(M,f,y),Ve(M,f,y)),f={cache:P0()},u.payload=f;return}f=f.return}}function fd(u,f,y){var M=lr();y={lane:M,revertLane:0,action:y,hasEagerState:!1,eagerState:null,next:null},Co(u)?Da(f,y):(y=$(u,f,y,M),y!==null&&(Oi(y,u,M),Ua(y,f,M)))}function ku(u,f,y){var M=lr();ks(u,f,y,M)}function ks(u,f,y,M){var C={lane:M,revertLane:0,action:y,hasEagerState:!1,eagerState:null,next:null};if(Co(u))Da(f,C);else{var N=u.alternate;if(u.lanes===0&&(N===null||N.lanes===0)&&(N=f.lastRenderedReducer,N!==null))try{var Z=f.lastRenderedState,le=N(Z,y);if(C.hasEagerState=!0,C.eagerState=le,fr(le,Z))return se(u,f,C,0),fn===null&&oe(),!1}catch{}if(y=$(u,f,C,M),y!==null)return Oi(y,u,M),Ua(y,f,M),!0}return!1}function Vl(u,f,y,M){if(M={lane:2,revertLane:_e(),action:M,hasEagerState:!1,eagerState:null,next:null},Co(u)){if(f)throw Error(r(479))}else f=$(u,y,M,2),f!==null&&Oi(f,u,2)}function Co(u){var f=u.alternate;return u===Nt||f!==null&&f===Nt}function Da(u,f){hc=Nd=!0;var y=u.pending;y===null?f.next=f:(f.next=y.next,y.next=f),u.pending=f}function Ua(u,f,y){if((y&4194176)!==0){var M=f.lanes;M&=u.pendingLanes,y|=M,f.lanes=y,V(u,y)}}function br(u,f,y,M){f=u.memoizedState,y=y(M,f),y=y==null?f:av({},f,y),u.memoizedState=y,u.lanes===0&&(u.updateQueue.baseState=y)}function Gu(u,f,y,M,C,N,Z){return u=u.stateNode,typeof u.shouldComponentUpdate=="function"?u.shouldComponentUpdate(M,N,Z):f.prototype&&f.prototype.isPureReactComponent?!Ge(y,M)||!Ge(C,N):!0}function Wl(u,f,y,M){u=f.state,typeof f.componentWillReceiveProps=="function"&&f.componentWillReceiveProps(y,M),typeof f.UNSAFE_componentWillReceiveProps=="function"&&f.UNSAFE_componentWillReceiveProps(y,M),f.state!==u&&Dv.enqueueReplaceState(f,f.state,null)}function Xr(u,f){var y=f;if("ref"in f){y={};for(var M in f)M!=="ref"&&(y[M]=f[M])}if(u=u.defaultProps){y===f&&(y=av({},y));for(var C in u)y[C]===void 0&&(y[C]=u[C])}return y}function hs(u,f){try{var y=u.onUncaughtError;y(f.value,{componentStack:f.stack})}catch(M){setTimeout(function(){throw M})}}function Hu(u,f,y){try{var M=u.onCaughtError;M(y.value,{componentStack:y.stack,errorBoundary:f.tag===1?f.stateNode:null})}catch(C){setTimeout(function(){throw C})}}function Gs(u,f,y){return y=Le(y),y.tag=3,y.payload={element:null},y.callback=function(){hs(u,f)},y}function Xl(u){return u=Le(u),u.tag=3,u}function bi(u,f,y,M){var C=y.type.getDerivedStateFromError;if(typeof C=="function"){var N=M.value;u.payload=function(){return C(N)},u.callback=function(){Hu(f,y,M)}}var Z=y.stateNode;Z!==null&&typeof Z.componentDidCatch=="function"&&(u.callback=function(){Hu(f,y,M),typeof C!="function"&&(Xa===null?Xa=new Set([this]):Xa.add(this));var le=M.stack;this.componentDidCatch(M.value,{componentStack:le!==null?le:""})})}function T0(u,f,y,M,C){if(y.flags|=32768,M!==null&&typeof M=="object"&&typeof M.then=="function"){if(f=y.alternate,f!==null&&Xu(f,y,C,!0),y=Cr.current,y!==null){switch(y.tag){case 13:return ds===null?$0():y.alternate===null&&Nn===0&&(Nn=3),y.flags&=-257,y.flags|=65536,y.lanes=C,M===Ld?y.flags|=16384:(f=y.updateQueue,f===null?y.updateQueue=new Set([M]):f.add(M),tv(u,M,C)),!1;case 22:return y.flags|=65536,M===Ld?y.flags|=16384:(f=y.updateQueue,f===null?(f={transitions:null,markerInstances:null,retryQueue:new Set([M])},y.updateQueue=f):(y=f.retryQueue,y===null?f.retryQueue=new Set([M]):y.add(M)),tv(u,M,C)),!1}throw Error(r(435,y.tag))}return tv(u,M,C),$0(),!1}if(qt)return f=Cr.current,f!==null?((f.flags&65536)===0&&(f.flags|=256),f.flags|=65536,f.lanes=C,M!==Sv&&(u=Error(r(422),{cause:M}),J(G(u,y)))):(M!==Sv&&(f=Error(r(423),{cause:M}),J(G(f,y))),u=u.current.alternate,u.flags|=65536,C&=-C,u.lanes|=C,M=G(M,y),C=Gs(u.stateNode,M,C),Je(u,C),Nn!==4&&(Nn=2)),!1;var N=Error(r(520),{cause:M});if(N=G(N,y),oh===null?oh=[N]:oh.push(N),Nn!==4&&(Nn=2),f===null)return!0;M=G(M,y),y=f;do{switch(y.tag){case 3:return y.flags|=65536,u=C&-C,y.lanes|=u,u=Gs(y.stateNode,M,u),Je(y,u),!1;case 1:if(f=y.type,N=y.stateNode,(y.flags&128)===0&&(typeof f.getDerivedStateFromError=="function"||N!==null&&typeof N.componentDidCatch=="function"&&(Xa===null||!Xa.has(N))))return y.flags|=65536,C&=-C,y.lanes|=C,C=Xl(C),bi(C,u,y,M),Je(y,C),!1}y=y.return}while(y!==null);return!1}function On(u,f,y,M){f.child=u===null?GS(f,null,y,M):Fo(f,u.child,y,M)}function Ro(u,f,y,M,C){y=y.render;var N=f.ref;if("ref"in M){var Z={};for(var le in M)le!=="ref"&&(Z[le]=M[le])}else Z=M;return Do(f),M=Is(u,f,y,Z,N,C),le=Ns(),u!==null&&!oi?(bo(u,f,C),Hs(u,f,C)):(qt&&le&&Y(f),f.flags|=1,On(u,f,M,C),f.child)}function Vu(u,f,y,M,C){if(u===null){var N=y.type;return typeof N=="function"&&!nv(N)&&N.defaultProps===void 0&&y.compare===null?(f.tag=15,f.type=N,dd(u,f,N,M,C)):(u=bd(y.type,null,M,f,f.mode,C),u.ref=f.ref,u.return=f,f.child=u)}if(N=u.child,!L0(u,C)){var Z=N.memoizedProps;if(y=y.compare,y=y!==null?y:Ge,y(Z,M)&&u.ref===f.ref)return Hs(u,f,C)}return f.flags|=1,u=Pa(N,M),u.ref=f.ref,u.return=f,f.child=u}function dd(u,f,y,M,C){if(u!==null){var N=u.memoizedProps;if(Ge(N,M)&&u.ref===f.ref)if(oi=!1,f.pendingProps=M=N,L0(u,C))(u.flags&131072)!==0&&(oi=!0);else return f.lanes=u.lanes,Hs(u,f,C)}return Sr(u,f,y,M,C)}function di(u,f,y){var M=f.pendingProps,C=M.children,N=(f.stateNode._pendingVisibility&2)!==0,Z=u!==null?u.memoizedState:null;if(Wn(u,f),M.mode==="hidden"||N){if((f.flags&128)!==0){if(M=Z!==null?Z.baseLanes|y:y,u!==null){for(C=f.child=u.child,N=0;C!==null;)N=N|C.lanes|C.childLanes,C=C.sibling;f.childLanes=N&~M}else f.childLanes=0,f.child=null;return Wi(u,f,M,y)}if((y&536870912)!==0)f.memoizedState={baseLanes:0,cachePool:null},u!==null&&gd(f,Z!==null?Z.cachePool:null),Z!==null?gn(f,Z):bn(),Hi(f);else return f.lanes=f.childLanes=536870912,Wi(u,f,Z!==null?Z.baseLanes|y:y,y)}else Z!==null?(gd(f,Z.cachePool),gn(f,Z),kn(),f.memoizedState=null):(u!==null&&gd(f,null),bn(),kn());return On(u,f,C,y),f.child}function Wi(u,f,y,M){var C=z0();return C=C===null?null:{parent:js?Ln._currentValue:Ln._currentValue2,pool:C},f.memoizedState={baseLanes:y,cachePool:C},u!==null&&gd(f,null),bn(),Hi(f),u!==null&&Xu(u,f,M,!0),null}function Wn(u,f){var y=f.ref;if(y===null)u!==null&&u.ref!==null&&(f.flags|=2097664);else{if(typeof y!="function"&&typeof y!="object")throw Error(r(284));(u===null||u.ref!==y)&&(f.flags|=2097664)}}function Sr(u,f,y,M,C){return Do(f),y=Is(u,f,y,M,void 0,C),M=Ns(),u!==null&&!oi?(bo(u,f,C),Hs(u,f,C)):(qt&&M&&Y(f),f.flags|=1,On(u,f,y,C),f.child)}function Wu(u,f,y,M,C,N){return Do(f),f.updateQueue=null,y=xo(f,M,y,C),Bl(u),M=Ns(),u!==null&&!oi?(bo(u,f,N),Hs(u,f,N)):(qt&&M&&Y(f),f.flags|=1,On(u,f,y,N),f.child)}function fb(u,f,y,M,C){if(Do(f),f.stateNode===null){var N=ec,Z=y.contextType;typeof Z=="object"&&Z!==null&&(N=Si(Z)),N=new y(M,N),f.memoizedState=N.state!==null&&N.state!==void 0?N.state:null,N.updater=Dv,f.stateNode=N,N._reactInternals=f,N=f.stateNode,N.props=M,N.state=f.memoizedState,N.refs={},je(f),Z=y.contextType,N.context=typeof Z=="object"&&Z!==null?Si(Z):ec,N.state=f.memoizedState,Z=y.getDerivedStateFromProps,typeof Z=="function"&&(br(f,y,Z,M),N.state=f.memoizedState),typeof y.getDerivedStateFromProps=="function"||typeof N.getSnapshotBeforeUpdate=="function"||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(Z=N.state,typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount(),Z!==N.state&&Dv.enqueueReplaceState(N,N.state,null),dt(f,M,N,C),We(),N.state=f.memoizedState),typeof N.componentDidMount=="function"&&(f.flags|=4194308),M=!0}else if(u===null){N=f.stateNode;var le=f.memoizedProps,we=Xr(y,le);N.props=we;var Fe=N.context,Ke=y.contextType;Z=ec,typeof Ke=="object"&&Ke!==null&&(Z=Si(Ke));var ct=y.getDerivedStateFromProps;Ke=typeof ct=="function"||typeof N.getSnapshotBeforeUpdate=="function",le=f.pendingProps!==le,Ke||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(le||Fe!==Z)&&Wl(f,N,M,Z),Ga=!1;var ht=f.memoizedState;N.state=ht,dt(f,M,N,C),We(),Fe=f.memoizedState,le||ht!==Fe||Ga?(typeof ct=="function"&&(br(f,y,ct,M),Fe=f.memoizedState),(we=Ga||Gu(f,y,we,M,ht,Fe,Z))?(Ke||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount()),typeof N.componentDidMount=="function"&&(f.flags|=4194308)):(typeof N.componentDidMount=="function"&&(f.flags|=4194308),f.memoizedProps=M,f.memoizedState=Fe),N.props=M,N.state=Fe,N.context=Z,M=we):(typeof N.componentDidMount=="function"&&(f.flags|=4194308),M=!1)}else{N=f.stateNode,Ze(u,f),Z=f.memoizedProps,Ke=Xr(y,Z),N.props=Ke,ct=f.pendingProps,ht=N.context,Fe=y.contextType,we=ec,typeof Fe=="object"&&Fe!==null&&(we=Si(Fe)),le=y.getDerivedStateFromProps,(Fe=typeof le=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(Z!==ct||ht!==we)&&Wl(f,N,M,we),Ga=!1,ht=f.memoizedState,N.state=ht,dt(f,M,N,C),We();var Dt=f.memoizedState;Z!==ct||ht!==Dt||Ga||u!==null&&u.dependencies!==null&&pd(u.dependencies)?(typeof le=="function"&&(br(f,y,le,M),Dt=f.memoizedState),(Ke=Ga||Gu(f,y,Ke,M,ht,Dt,we)||u!==null&&u.dependencies!==null&&pd(u.dependencies))?(Fe||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(M,Dt,we),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(M,Dt,we)),typeof N.componentDidUpdate=="function"&&(f.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(f.flags|=1024)):(typeof N.componentDidUpdate!="function"||Z===u.memoizedProps&&ht===u.memoizedState||(f.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||Z===u.memoizedProps&&ht===u.memoizedState||(f.flags|=1024),f.memoizedProps=M,f.memoizedState=Dt),N.props=M,N.state=Dt,N.context=we,M=Ke):(typeof N.componentDidUpdate!="function"||Z===u.memoizedProps&&ht===u.memoizedState||(f.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||Z===u.memoizedProps&&ht===u.memoizedState||(f.flags|=1024),M=!1)}return N=M,Wn(u,f),M=(f.flags&128)!==0,N||M?(N=f.stateNode,y=M&&typeof y.getDerivedStateFromError!="function"?null:N.render(),f.flags|=1,u!==null&&M?(f.child=Fo(f,u.child,null,C),f.child=Fo(f,null,y,C)):On(u,f,y,C),f.memoizedState=N.state,u=f.child):u=Hs(u,f,C),u}function db(u,f,y,M){return fe(),f.flags|=256,On(u,f,y,M),f.child}function A0(u){return{baseLanes:u,cachePool:_b()}}function C0(u,f,y){return u=u!==null?u.childLanes&~y:0,f&&(u|=Rr),u}function pb(u,f,y){var M=f.pendingProps,C=!1,N=(f.flags&128)!==0,Z;if((Z=N)||(Z=u!==null&&u.memoizedState===null?!1:(ti.current&2)!==0),Z&&(C=!0,f.flags&=-129),Z=(f.flags&32)!==0,f.flags&=-33,u===null){if(qt){if(C?Bn(f):kn(),qt){var le=wi,we;(we=le)&&(le=aU(le,fs),le!==null?(f.memoizedState={dehydrated:le,treeContext:zo!==null?{id:qs,overflow:Ys}:null,retryLane:536870912},we=t(18,null,null,0),we.stateNode=le,we.return=f,f.child=we,Li=f,wi=null,we=!0):we=!1),we||de(f)}if(le=f.memoizedState,le!==null&&(le=le.dehydrated,le!==null))return vv(le)?f.lanes=16:f.lanes=536870912,null;Un(f)}return le=M.children,M=M.fallback,C?(kn(),C=f.mode,le=D0({mode:"hidden",children:le},C),M=Io(M,C,y,null),le.return=f,M.return=f,le.sibling=M,f.child=le,C=f.child,C.memoizedState=A0(y),C.childLanes=C0(u,Z,y),f.memoizedState=Uv,M):(Bn(f),R0(f,le))}if(we=u.memoizedState,we!==null&&(le=we.dehydrated,le!==null)){if(N)f.flags&256?(Bn(f),f.flags&=-257,f=U0(u,f,y)):f.memoizedState!==null?(kn(),f.child=u.child,f.flags|=128,f=null):(kn(),C=M.fallback,le=f.mode,M=D0({mode:"visible",children:M.children},le),C=Io(C,le,y,null),C.flags|=2,M.return=f,C.return=f,M.sibling=C,f.child=M,Fo(f,u.child,null,y),M=f.child,M.memoizedState=A0(y),M.childLanes=C0(u,Z,y),f.memoizedState=Uv,f=C);else if(Bn(f),vv(le))Z=Q3(le).digest,M=Error(r(419)),M.stack="",M.digest=Z,J({value:M,source:null,stack:null}),f=U0(u,f,y);else if(oi||Xu(u,f,y,!1),Z=(y&u.childLanes)!==0,oi||Z){if(Z=fn,Z!==null){if(M=y&-y,(M&42)!==0)M=1;else switch(M){case 2:M=1;break;case 8:M=4;break;case 32:M=16;break;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:M=64;break;case 268435456:M=134217728;break;default:M=0}if(M=(M&(Z.suspendedLanes|y))!==0?0:M,M!==0&&M!==we.retryLane)throw we.retryLane=M,pe(u,M),Oi(Z,u,M),VS}gv(le)||$0(),f=U0(u,f,y)}else gv(le)?(f.flags|=128,f.child=u.child,f=t3.bind(null,u),$3(le,f),f=null):(u=we.treeContext,Er&&(wi=iU(le),Li=f,qt=!0,Yr=null,fs=!1,u!==null&&(wr[Tr++]=qs,wr[Tr++]=Ys,wr[Tr++]=zo,qs=u.id,Ys=u.overflow,zo=f)),f=R0(f,M.children),f.flags|=4096);return f}return C?(kn(),C=M.fallback,le=f.mode,we=u.child,N=we.sibling,M=Pa(we,{mode:"hidden",children:M.children}),M.subtreeFlags=we.subtreeFlags&31457280,N!==null?C=Pa(N,C):(C=Io(C,le,y,null),C.flags|=2),C.return=f,M.return=f,M.sibling=C,f.child=M,M=C,C=f.child,le=u.child.memoizedState,le===null?le=A0(y):(we=le.cachePool,we!==null?(N=js?Ln._currentValue:Ln._currentValue2,we=we.parent!==N?{parent:N,pool:N}:we):we=_b(),le={baseLanes:le.baseLanes|y,cachePool:we}),C.memoizedState=le,C.childLanes=C0(u,Z,y),f.memoizedState=Uv,M):(Bn(f),y=u.child,u=y.sibling,y=Pa(y,{mode:"visible",children:M.children}),y.return=f,y.sibling=null,u!==null&&(Z=f.deletions,Z===null?(f.deletions=[u],f.flags|=16):Z.push(u)),f.child=y,f.memoizedState=null,y)}function R0(u,f){return f=D0({mode:"visible",children:f},u.mode),f.return=u,u.child=f}function D0(u,f){return rS(u,f,0,null)}function U0(u,f,y){return Fo(f,u.child,null,y),u=R0(f,f.pendingProps.children),u.flags|=2,f.memoizedState=null,u}function mb(u,f,y){u.lanes|=f;var M=u.alternate;M!==null&&(M.lanes|=f),I0(u.return,f,y)}function O0(u,f,y,M,C){var N=u.memoizedState;N===null?u.memoizedState={isBackwards:f,rendering:null,renderingStartTime:0,last:M,tail:y,tailMode:C}:(N.isBackwards=f,N.rendering=null,N.renderingStartTime=0,N.last=M,N.tail=y,N.tailMode=C)}function gb(u,f,y){var M=f.pendingProps,C=M.revealOrder,N=M.tail;if(On(u,f,M.children,y),M=ti.current,(M&2)!==0)M=M&1|2,f.flags|=128;else{if(u!==null&&(u.flags&128)!==0)e:for(u=f.child;u!==null;){if(u.tag===13)u.memoizedState!==null&&mb(u,y,f);else if(u.tag===19)mb(u,y,f);else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===f)break e;for(;u.sibling===null;){if(u.return===null||u.return===f)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}M&=1}switch(b(ti,M),C){case"forwards":for(y=f.child,C=null;y!==null;)u=y.alternate,u!==null&&vn(u)===null&&(C=y),y=y.sibling;y=C,y===null?(C=f.child,f.child=null):(C=y.sibling,y.sibling=null),O0(f,!1,C,y,N);break;case"backwards":for(y=null,C=f.child,f.child=null;C!==null;){if(u=C.alternate,u!==null&&vn(u)===null){f.child=C;break}u=C.sibling,C.sibling=y,y=C,C=u}O0(f,!0,y,null,N);break;case"together":O0(f,!1,null,null,void 0);break;default:f.memoizedState=null}return f.child}function Hs(u,f,y){if(u!==null&&(f.dependencies=u.dependencies),Wa|=f.lanes,(y&f.childLanes)===0)if(u!==null){if(Xu(u,f,y,!1),(y&f.childLanes)===0)return null}else return null;if(u!==null&&f.child!==u.child)throw Error(r(153));if(f.child!==null){for(u=f.child,y=Pa(u,u.pendingProps),f.child=y,y.return=f;u.sibling!==null;)u=u.sibling,y=y.sibling=Pa(u,u.pendingProps),y.return=f;y.sibling=null}return f.child}function L0(u,f){return(u.lanes&f)!==0?!0:(u=u.dependencies,!!(u!==null&&pd(u)))}function WD(u,f,y){switch(f.tag){case 3:te(f,f.stateNode.containerInfo),Oa(f,Ln,u.memoizedState.cache),fe();break;case 27:case 5:ie(f);break;case 4:te(f,f.stateNode.containerInfo);break;case 10:Oa(f,f.type,f.memoizedProps.value);break;case 13:var M=f.memoizedState;if(M!==null)return M.dehydrated!==null?(Bn(f),f.flags|=128,null):(y&f.child.childLanes)!==0?pb(u,f,y):(Bn(f),u=Hs(u,f,y),u!==null?u.sibling:null);Bn(f);break;case 19:var C=(u.flags&128)!==0;if(M=(y&f.childLanes)!==0,M||(Xu(u,f,y,!1),M=(y&f.childLanes)!==0),C){if(M)return gb(u,f,y);f.flags|=128}if(C=f.memoizedState,C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),b(ti,ti.current),M)break;return null;case 22:case 23:return f.lanes=0,di(u,f,y);case 24:Oa(f,Ln,u.memoizedState.cache)}return Hs(u,f,y)}function vb(u,f,y){if(u!==null)if(u.memoizedProps!==f.pendingProps)oi=!0;else{if(!L0(u,y)&&(f.flags&128)===0)return oi=!1,WD(u,f,y);oi=(u.flags&131072)!==0}else oi=!1,qt&&(f.flags&1048576)!==0&&k(f,Rd,f.index);switch(f.lanes=0,f.tag){case 16:e:{u=f.pendingProps;var M=f.elementType,C=M._init;if(M=C(M._payload),f.type=M,typeof M=="function")nv(M)?(u=Xr(M,u),f.tag=1,f=fb(null,f,M,u,y)):(f.tag=0,f=Sr(null,f,M,u,y));else{if(M!=null){if(C=M.$$typeof,C===lv){f.tag=11,f=Ro(null,f,M,u,y);break e}else if(C===hv){f.tag=14,f=Vu(null,f,M,u,y);break e}}throw f=a(M)||M,Error(r(306,f,""))}}return f;case 0:return Sr(u,f,f.type,f.pendingProps,y);case 1:return M=f.type,C=Xr(M,f.pendingProps),fb(u,f,M,C,y);case 3:e:{if(te(f,f.stateNode.containerInfo),u===null)throw Error(r(387));var N=f.pendingProps;C=f.memoizedState,M=C.element,Ze(u,f),dt(f,N,null,y);var Z=f.memoizedState;if(N=Z.cache,Oa(f,Ln,N),N!==C.cache&&N0(f,[Ln],y,!0),We(),N=Z.element,Er&&C.isDehydrated)if(C={element:N,isDehydrated:!1,cache:Z.cache},f.updateQueue.baseState=C,f.memoizedState=C,f.flags&256){f=db(u,f,N,y);break e}else if(N!==M){M=G(Error(r(424)),f),J(M),f=db(u,f,N,y);break e}else for(Er&&(wi=nU(f.stateNode.containerInfo),Li=f,qt=!0,Yr=null,fs=!0),y=GS(f,null,N,y),f.child=y;y;)y.flags=y.flags&-3|4096,y=y.sibling;else{if(fe(),N===M){f=Hs(u,f,y);break e}On(u,f,N,y)}f=f.child}return f;case 26:if(Mr)return Wn(u,f),u===null?(y=US(f.type,null,f.pendingProps,null))?f.memoizedState=y:qt||(f.stateNode=yU(f.type,f.pendingProps,ka.current,f)):f.memoizedState=US(f.type,u.memoizedProps,f.pendingProps,u.memoizedState),null;case 27:if(Mi)return ie(f),u===null&&Mi&&qt&&(M=f.stateNode=zS(f.type,f.pendingProps,ka.current,pi.current,!1),Li=f,fs=!0,wi=CS(M)),M=f.pendingProps.children,u!==null||qt?On(u,f,M,y):f.child=Fo(f,null,M,y),Wn(u,f),f.child;case 5:return u===null&&qt&&(mU(f.type,f.pendingProps,pi.current),(C=M=wi)&&(M=rU(M,f.type,f.pendingProps,fs),M!==null?(f.stateNode=M,Li=f,wi=CS(M),fs=!1,C=!0):C=!1),C||de(f)),ie(f),C=f.type,N=f.pendingProps,Z=u!==null?u.memoizedProps:null,M=N.children,Md(C,N)?M=null:Z!==null&&Md(C,Z)&&(f.flags|=32),f.memoizedState!==null&&(C=Is(u,f,Ca,null,null,y),js?Po._currentValue=C:Po._currentValue2=C),Wn(u,f),On(u,f,M,y),f.child;case 6:return u===null&&qt&&(gU(f.pendingProps,pi.current),(u=y=wi)&&(y=sU(y,f.pendingProps,fs),y!==null?(f.stateNode=y,Li=f,wi=null,u=!0):u=!1),u||de(f)),null;case 13:return pb(u,f,y);case 4:return te(f,f.stateNode.containerInfo),M=f.pendingProps,u===null?f.child=Fo(f,null,M,y):On(u,f,M,y),f.child;case 11:return Ro(u,f,f.type,f.pendingProps,y);case 7:return On(u,f,f.pendingProps,y),f.child;case 8:return On(u,f,f.pendingProps.children,y),f.child;case 12:return On(u,f,f.pendingProps.children,y),f.child;case 10:return M=f.pendingProps,Oa(f,f.type,M.value),On(u,f,M.children,y),f.child;case 9:return C=f.type._context,M=f.pendingProps.children,Do(f),C=Si(C),M=M(C),f.flags|=1,On(u,f,M,y),f.child;case 14:return Vu(u,f,f.type,f.pendingProps,y);case 15:return dd(u,f,f.type,f.pendingProps,y);case 19:return gb(u,f,y);case 22:return di(u,f,y);case 24:return Do(f),M=Si(Ln),u===null?(C=z0(),C===null&&(C=fn,N=P0(),C.pooledCache=N,N.refCount++,N!==null&&(C.pooledCacheLanes|=y),C=N),f.memoizedState={parent:M,cache:C},je(f),Oa(f,Ln,C)):((u.lanes&y)!==0&&(Ze(u,f),dt(f,null,null,y),We()),C=u.memoizedState,N=f.memoizedState,C.parent!==M?(C={parent:M,cache:M},f.memoizedState=C,f.lanes===0&&(f.memoizedState=f.updateQueue.baseState=C),Oa(f,Ln,M)):(M=N.cache,Oa(f,Ln,M),M!==C.cache&&N0(f,[Ln],y,!0))),On(u,f,f.pendingProps.children,y),f.child;case 29:throw f.pendingProps}throw Error(r(156,f.tag))}function Oa(u,f,y){js?(b(zd,f._currentValue),f._currentValue=y):(b(zd,f._currentValue2),f._currentValue2=y)}function Vs(u){var f=zd.current;js?u._currentValue=f:u._currentValue2=f,g(zd)}function I0(u,f,y){for(;u!==null;){var M=u.alternate;if((u.childLanes&f)!==f?(u.childLanes|=f,M!==null&&(M.childLanes|=f)):M!==null&&(M.childLanes&f)!==f&&(M.childLanes|=f),u===y)break;u=u.return}}function N0(u,f,y,M){var C=u.child;for(C!==null&&(C.return=u);C!==null;){var N=C.dependencies;if(N!==null){var Z=C.child;N=N.firstContext;e:for(;N!==null;){var le=N;N=C;for(var we=0;we<f.length;we++)if(le.context===f[we]){N.lanes|=y,le=N.alternate,le!==null&&(le.lanes|=y),I0(N.return,y,u),M||(Z=null);break e}N=le.next}}else if(C.tag===18){if(Z=C.return,Z===null)throw Error(r(341));Z.lanes|=y,N=Z.alternate,N!==null&&(N.lanes|=y),I0(Z,y,u),Z=null}else Z=C.child;if(Z!==null)Z.return=C;else for(Z=C;Z!==null;){if(Z===u){Z=null;break}if(C=Z.sibling,C!==null){C.return=Z.return,Z=C;break}Z=Z.return}C=Z}}function Xu(u,f,y,M){u=null;for(var C=f,N=!1;C!==null;){if(!N){if((C.flags&524288)!==0)N=!0;else if((C.flags&262144)!==0)break}if(C.tag===10){var Z=C.alternate;if(Z===null)throw Error(r(387));if(Z=Z.memoizedProps,Z!==null){var le=C.type;fr(C.pendingProps.value,Z.value)||(u!==null?u.push(le):u=[le])}}else if(C===Dd.current){if(Z=C.alternate,Z===null)throw Error(r(387));Z.memoizedState.memoizedState!==C.memoizedState.memoizedState&&(u!==null?u.push(Po):u=[Po])}C=C.return}u!==null&&N0(f,u,y,M),f.flags|=262144}function pd(u){for(u=u.firstContext;u!==null;){var f=u.context;if(!fr(js?f._currentValue:f._currentValue2,u.memoizedValue))return!0;u=u.next}return!1}function Do(u){Ho=u,Zs=null,u=u.dependencies,u!==null&&(u.firstContext=null)}function Si(u){return yb(Ho,u)}function md(u,f){return Ho===null&&Do(u),yb(u,f)}function yb(u,f){var y=js?f._currentValue:f._currentValue2;if(f={context:f,memoizedValue:y,next:null},Zs===null){if(u===null)throw Error(r(308));Zs=f,u.dependencies={lanes:0,firstContext:f},u.flags|=524288}else Zs=Zs.next=f;return y}function P0(){return{controller:new NU,data:new Map,refCount:0}}function ju(u){u.refCount--,u.refCount===0&&PU(zU,function(){u.controller.abort()})}function z0(){var u=Vo.current;return u!==null?u:fn.pooledCache}function gd(u,f){f===null?b(Vo,Vo.current):b(Vo,f.pool)}function _b(){var u=z0();return u===null?null:{parent:js?Ln._currentValue:Ln._currentValue2,pool:u}}function sr(u){u.flags|=4}function xb(u,f){if(u!==null&&u.child===f.child)return!1;if((f.flags&16)!==0)return!0;for(u=f.child;u!==null;){if((u.flags&13878)!==0||(u.subtreeFlags&13878)!==0)return!0;u=u.sibling}return!1}function F0(u,f,y,M){if(Ei)for(y=f.child;y!==null;){if(y.tag===5||y.tag===6)pv(u,y.stateNode);else if(!(y.tag===4||Mi&&y.tag===27)&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===f)break;for(;y.sibling===null;){if(y.return===null||y.return===f)return;y=y.return}y.sibling.return=y.return,y=y.sibling}else if(Ba)for(var C=f.child;C!==null;){if(C.tag===5){var N=C.stateNode;y&&M&&(N=wS(N,C.type,C.memoizedProps)),pv(u,N)}else if(C.tag===6)N=C.stateNode,y&&M&&(N=TS(N,C.memoizedProps)),pv(u,N);else if(C.tag!==4){if(C.tag===22&&C.memoizedState!==null)N=C.child,N!==null&&(N.return=C),F0(u,C,!0,!0);else if(C.child!==null){C.child.return=C,C=C.child;continue}}if(C===f)break;for(;C.sibling===null;){if(C.return===null||C.return===f)return;C=C.return}C.sibling.return=C.return,C=C.sibling}}function bb(u,f,y,M){if(Ba)for(var C=f.child;C!==null;){if(C.tag===5){var N=C.stateNode;y&&M&&(N=wS(N,C.type,C.memoizedProps)),ES(u,N)}else if(C.tag===6)N=C.stateNode,y&&M&&(N=TS(N,C.memoizedProps)),ES(u,N);else if(C.tag!==4){if(C.tag===22&&C.memoizedState!==null)N=C.child,N!==null&&(N.return=C),bb(u,C,!(C.memoizedProps!==null&&C.memoizedProps.mode==="manual"),!0);else if(C.child!==null){C.child.return=C,C=C.child;continue}}if(C===f)break;for(;C.sibling===null;){if(C.return===null||C.return===f)return;C=C.return}C.sibling.return=C.return,C=C.sibling}}function Sb(u,f){if(Ba&&xb(u,f)){u=f.stateNode;var y=u.containerInfo,M=SS();bb(M,f,!1,!1),u.pendingChildren=M,sr(f),J3(y,M)}}function B0(u,f,y,M){if(Ei)u.memoizedProps!==M&&sr(f);else if(Ba){var C=u.stateNode,N=u.memoizedProps;if((u=xb(u,f))||N!==M){var Z=pi.current;N=K3(C,y,N,M,!u,null),N===C?f.stateNode=C:(gS(N,y,M,Z)&&sr(f),f.stateNode=N,u?F0(N,f,!1,!1):sr(f))}else f.stateNode=C}}function k0(u,f,y){if(M3(f,y)){if(u.flags|=16777216,!_S(f,y))if(qb())u.flags|=8192;else throw lc=Ld,Cv}else u.flags&=-16777217}function Eb(u,f){if(xU(f)){if(u.flags|=16777216,!PS(f))if(qb())u.flags|=8192;else throw lc=Ld,Cv}else u.flags&=-16777217}function vd(u,f){f!==null&&(u.flags|=4),u.flags&16384&&(f=u.tag!==22?A():536870912,u.lanes|=f,mc|=f)}function qu(u,f){if(!qt)switch(u.tailMode){case"hidden":f=u.tail;for(var y=null;f!==null;)f.alternate!==null&&(y=f),f=f.sibling;y===null?u.tail=null:y.sibling=null;break;case"collapsed":y=u.tail;for(var M=null;y!==null;)y.alternate!==null&&(M=y),y=y.sibling;M===null?f||u.tail===null?u.tail=null:u.tail.sibling=null:M.sibling=null}}function En(u){var f=u.alternate!==null&&u.alternate.child===u.child,y=0,M=0;if(f)for(var C=u.child;C!==null;)y|=C.lanes|C.childLanes,M|=C.subtreeFlags&31457280,M|=C.flags&31457280,C.return=u,C=C.sibling;else for(C=u.child;C!==null;)y|=C.lanes|C.childLanes,M|=C.subtreeFlags,M|=C.flags,C.return=u,C=C.sibling;return u.subtreeFlags|=M,u.childLanes=y,f}function XD(u,f,y){var M=f.pendingProps;switch(Q(f),f.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return En(f),null;case 1:return En(f),null;case 3:return y=f.stateNode,M=null,u!==null&&(M=u.memoizedState.cache),f.memoizedState.cache!==M&&(f.flags|=2048),Vs(Ln),ee(),y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(u===null||u.child===null)&&(ve(f)?sr(f):u===null||u.memoizedState.isDehydrated&&(f.flags&256)===0||(f.flags|=1024,Yr!==null&&(J0(Yr),Yr=null))),Sb(u,f),En(f),null;case 26:if(Mr){y=f.type;var C=f.memoizedState;return u===null?(sr(f),C!==null?(En(f),Eb(f,C)):(En(f),k0(f,y,M))):C?C!==u.memoizedState?(sr(f),En(f),Eb(f,C)):(En(f),f.flags&=-16777217):(Ei?u.memoizedProps!==M&&sr(f):B0(u,f,y,M),En(f),k0(f,y,M)),null}case 27:if(Mi){if(re(f),y=ka.current,C=f.type,u!==null&&f.stateNode!=null)Ei?u.memoizedProps!==M&&sr(f):B0(u,f,C,M);else{if(!M){if(f.stateNode===null)throw Error(r(166));return En(f),null}u=pi.current,ve(f)?Ae(f,u):(u=zS(C,M,y,u,!0),f.stateNode=u,sr(f))}return En(f),null}case 5:if(re(f),y=f.type,u!==null&&f.stateNode!=null)B0(u,f,y,M);else{if(!M){if(f.stateNode===null)throw Error(r(166));return En(f),null}u=pi.current,ve(f)?Ae(f,u):(C=v3(y,M,ka.current,u,f),F0(C,f,!1,!1),f.stateNode=C,gS(C,y,M,u)&&sr(f))}return En(f),k0(f,f.type,f.pendingProps),null;case 6:if(u&&f.stateNode!=null)y=u.memoizedProps,Ei?y!==M&&sr(f):Ba&&(y!==M?(f.stateNode=vS(M,ka.current,pi.current,f),sr(f)):f.stateNode=u.stateNode);else{if(typeof M!="string"&&f.stateNode===null)throw Error(r(166));if(u=ka.current,y=pi.current,ve(f)){if(!Er)throw Error(r(176));if(u=f.stateNode,y=f.memoizedProps,M=null,C=Li,C!==null)switch(C.tag){case 27:case 5:M=C.memoizedProps}lU(u,y,f,M)||de(f)}else f.stateNode=vS(M,u,y,f)}return En(f),null;case 13:if(M=f.memoizedState,u===null||u.memoizedState!==null&&u.memoizedState.dehydrated!==null){if(C=ve(f),M!==null&&M.dehydrated!==null){if(u===null){if(!C)throw Error(r(318));if(!Er)throw Error(r(344));if(C=f.memoizedState,C=C!==null?C.dehydrated:null,!C)throw Error(r(317));cU(C,f)}else fe(),(f.flags&128)===0&&(f.memoizedState=null),f.flags|=4;En(f),C=!1}else Yr!==null&&(J0(Yr),Yr=null),C=!0;if(!C)return f.flags&256?(Un(f),f):(Un(f),null)}if(Un(f),(f.flags&128)!==0)return f.lanes=y,f;if(y=M!==null,u=u!==null&&u.memoizedState!==null,y){M=f.child,C=null,M.alternate!==null&&M.alternate.memoizedState!==null&&M.alternate.memoizedState.cachePool!==null&&(C=M.alternate.memoizedState.cachePool.pool);var N=null;M.memoizedState!==null&&M.memoizedState.cachePool!==null&&(N=M.memoizedState.cachePool.pool),N!==C&&(M.flags|=2048)}return y!==u&&y&&(f.child.flags|=8192),vd(f,f.updateQueue),En(f),null;case 4:return ee(),Sb(u,f),u===null&&x3(f.stateNode.containerInfo),En(f),null;case 10:return Vs(f.type),En(f),null;case 19:if(g(ti),C=f.memoizedState,C===null)return En(f),null;if(M=(f.flags&128)!==0,N=C.rendering,N===null)if(M)qu(C,!1);else{if(Nn!==0||u!==null&&(u.flags&128)!==0)for(u=f.child;u!==null;){if(N=vn(u),N!==null){for(f.flags|=128,qu(C,!1),u=N.updateQueue,f.updateQueue=u,vd(f,u),f.subtreeFlags=0,u=y,y=f.child;y!==null;)iS(y,u),y=y.sibling;return b(ti,ti.current&1|2),f.child}u=u.sibling}C.tail!==null&&qr()>lh&&(f.flags|=128,M=!0,qu(C,!1),f.lanes=4194304)}else{if(!M)if(u=vn(N),u!==null){if(f.flags|=128,M=!0,u=u.updateQueue,f.updateQueue=u,vd(f,u),qu(C,!0),C.tail===null&&C.tailMode==="hidden"&&!N.alternate&&!qt)return En(f),null}else 2*qr()-C.renderingStartTime>lh&&y!==536870912&&(f.flags|=128,M=!0,qu(C,!1),f.lanes=4194304);C.isBackwards?(N.sibling=f.child,f.child=N):(u=C.last,u!==null?u.sibling=N:f.child=N,C.last=N)}return C.tail!==null?(f=C.tail,C.rendering=f,C.tail=f.sibling,C.renderingStartTime=qr(),f.sibling=null,u=ti.current,b(ti,M?u&1|2:u&1),f):(En(f),null);case 22:case 23:return Un(f),xi(),M=f.memoizedState!==null,u!==null?u.memoizedState!==null!==M&&(f.flags|=8192):M&&(f.flags|=8192),M?(y&536870912)!==0&&(f.flags&128)===0&&(En(f),f.subtreeFlags&6&&(f.flags|=8192)):En(f),y=f.updateQueue,y!==null&&vd(f,y.retryQueue),y=null,u!==null&&u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(y=u.memoizedState.cachePool.pool),M=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(M=f.memoizedState.cachePool.pool),M!==y&&(f.flags|=2048),u!==null&&g(Vo),null;case 24:return y=null,u!==null&&(y=u.memoizedState.cache),f.memoizedState.cache!==y&&(f.flags|=2048),Vs(Ln),En(f),null;case 25:return null}throw Error(r(156,f.tag))}function jD(u,f){switch(Q(f),f.tag){case 1:return u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 3:return Vs(Ln),ee(),u=f.flags,(u&65536)!==0&&(u&128)===0?(f.flags=u&-65537|128,f):null;case 26:case 27:case 5:return re(f),null;case 13:if(Un(f),u=f.memoizedState,u!==null&&u.dehydrated!==null){if(f.alternate===null)throw Error(r(340));fe()}return u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 19:return g(ti),null;case 4:return ee(),null;case 10:return Vs(f.type),null;case 22:case 23:return Un(f),xi(),u!==null&&g(Vo),u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 24:return Vs(Ln),null;case 25:return null;default:return null}}function Mb(u,f){switch(Q(f),f.tag){case 3:Vs(Ln),ee();break;case 26:case 27:case 5:re(f);break;case 4:ee();break;case 13:Un(f);break;case 19:g(ti);break;case 10:Vs(f.type);break;case 22:case 23:Un(f),xi(),u!==null&&g(Vo);break;case 24:Vs(Ln)}}function Yu(u,f){try{var y=f.updateQueue,M=y!==null?y.lastEffect:null;if(M!==null){var C=M.next;y=C;do{if((y.tag&u)===u){M=void 0;var N=y.create,Z=y.inst;M=N(),Z.destroy=M}y=y.next}while(y!==C)}}catch(le){sn(f,f.return,le)}}function La(u,f,y){try{var M=f.updateQueue,C=M!==null?M.lastEffect:null;if(C!==null){var N=C.next;M=N;do{if((M.tag&u)===u){var Z=M.inst,le=Z.destroy;if(le!==void 0){Z.destroy=void 0,C=f;var we=y;try{le()}catch(Fe){sn(C,we,Fe)}}}M=M.next}while(M!==N)}}catch(Fe){sn(f,f.return,Fe)}}function wb(u){var f=u.updateQueue;if(f!==null){var y=u.stateNode;try{Ie(f,y)}catch(M){sn(u,u.return,M)}}}function Tb(u,f,y){y.props=Xr(u.type,u.memoizedProps),y.state=u.memoizedState;try{y.componentWillUnmount()}catch(M){sn(u,f,M)}}function Uo(u,f){try{var y=u.ref;if(y!==null){var M=u.stateNode;switch(u.tag){case 26:case 27:case 5:var C=Ju(M);break;default:C=M}typeof y=="function"?u.refCleanup=y(C):y.current=C}}catch(N){sn(u,f,N)}}function ar(u,f){var y=u.ref,M=u.refCleanup;if(y!==null)if(typeof M=="function")try{M()}catch(C){sn(u,f,C)}finally{u.refCleanup=null,u=u.alternate,u!=null&&(u.refCleanup=null)}else if(typeof y=="function")try{y(null)}catch(C){sn(u,f,C)}else y.current=null}function Ab(u){var f=u.type,y=u.memoizedProps,M=u.stateNode;try{B3(M,f,y,u)}catch(C){sn(u,u.return,C)}}function Cb(u,f,y){try{k3(u.stateNode,u.type,y,f,u)}catch(M){sn(u,u.return,M)}}function Rb(u){return u.tag===5||u.tag===3||(Mr?u.tag===26:!1)||(Mi?u.tag===27:!1)||u.tag===4}function G0(u){e:for(;;){for(;u.sibling===null;){if(u.return===null||Rb(u.return))return null;u=u.return}for(u.sibling.return=u.return,u=u.sibling;u.tag!==5&&u.tag!==6&&(!Mi||u.tag!==27)&&u.tag!==18;){if(u.flags&2||u.child===null||u.tag===4)continue e;u.child.return=u,u=u.child}if(!(u.flags&2))return u.stateNode}}function H0(u,f,y){var M=u.tag;if(M===5||M===6)u=u.stateNode,f?H3(y,u,f):z3(y,u);else if(!(M===4||Mi&&M===27)&&(u=u.child,u!==null))for(H0(u,f,y),u=u.sibling;u!==null;)H0(u,f,y),u=u.sibling}function yd(u,f,y){var M=u.tag;if(M===5||M===6)u=u.stateNode,f?G3(y,u,f):P3(y,u);else if(!(M===4||Mi&&M===27)&&(u=u.child,u!==null))for(yd(u,f,y),u=u.sibling;u!==null;)yd(u,f,y),u=u.sibling}function Db(u,f,y){u=u.containerInfo;try{MS(u,y)}catch(M){sn(f,f.return,M)}}function qD(u,f){for(m3(u.containerInfo),li=f;li!==null;)if(u=li,f=u.child,(u.subtreeFlags&1028)!==0&&f!==null)f.return=u,li=f;else for(;li!==null;){u=li;var y=u.alternate;switch(f=u.flags,u.tag){case 0:break;case 11:case 15:break;case 1:if((f&1024)!==0&&y!==null){f=void 0;var M=u,C=y.memoizedProps;y=y.memoizedState;var N=M.stateNode;try{var Z=Xr(M.type,C,M.elementType===M.type);f=N.getSnapshotBeforeUpdate(Z,y),N.__reactInternalSnapshotBeforeUpdate=f}catch(le){sn(M,M.return,le)}}break;case 3:(f&1024)!==0&&Ei&&Z3(u.stateNode.containerInfo);break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((f&1024)!==0)throw Error(r(163))}if(f=u.sibling,f!==null){f.return=u.return,li=f;break}li=u.return}return Z=jS,jS=!1,Z}function Ub(u,f,y){var M=y.flags;switch(y.tag){case 0:case 11:case 15:Ws(u,y),M&4&&Yu(5,y);break;case 1:if(Ws(u,y),M&4)if(u=y.stateNode,f===null)try{u.componentDidMount()}catch(le){sn(y,y.return,le)}else{var C=Xr(y.type,f.memoizedProps);f=f.memoizedState;try{u.componentDidUpdate(C,f,u.__reactInternalSnapshotBeforeUpdate)}catch(le){sn(y,y.return,le)}}M&64&&wb(y),M&512&&Uo(y,y.return);break;case 3:if(Ws(u,y),M&64&&(M=y.updateQueue,M!==null)){if(u=null,y.child!==null)switch(y.child.tag){case 27:case 5:u=Ju(y.child.stateNode);break;case 1:u=y.child.stateNode}try{Ie(M,u)}catch(le){sn(y,y.return,le)}}break;case 26:if(Mr){Ws(u,y),M&512&&Uo(y,y.return);break}case 27:case 5:Ws(u,y),f===null&&M&4&&Ab(y),M&512&&Uo(y,y.return);break;case 12:Ws(u,y);break;case 13:Ws(u,y),M&4&&Lb(u,y);break;case 22:if(C=y.memoizedState!==null||Ks,!C){f=f!==null&&f.memoizedState!==null||In;var N=Ks,Z=In;Ks=C,(In=f)&&!Z?Ia(u,y,(y.subtreeFlags&8772)!==0):Ws(u,y),Ks=N,In=Z}M&512&&(y.memoizedProps.mode==="manual"?Uo(y,y.return):ar(y,y.return));break;default:Ws(u,y)}}function Ob(u){var f=u.alternate;f!==null&&(u.alternate=null,Ob(f)),u.child=null,u.deletions=null,u.sibling=null,u.tag===5&&(f=u.stateNode,f!==null&&E3(f)),u.stateNode=null,u.return=null,u.dependencies=null,u.memoizedProps=null,u.memoizedState=null,u.pendingProps=null,u.stateNode=null,u.updateQueue=null}function jr(u,f,y){for(y=y.child;y!==null;)V0(u,f,y),y=y.sibling}function V0(u,f,y){if(hr&&typeof hr.onCommitFiberUnmount=="function")try{hr.onCommitFiberUnmount(eh,y)}catch{}switch(y.tag){case 26:if(Mr){In||ar(y,f),jr(u,f,y),y.memoizedState?LS(y.memoizedState):y.stateNode&&NS(y.stateNode);break}case 27:if(Mi){In||ar(y,f);var M=jn,C=dr;jn=y.stateNode,jr(u,f,y),MU(y.stateNode),jn=M,dr=C;break}case 5:In||ar(y,f);case 6:if(Ei){if(M=jn,C=dr,jn=null,jr(u,f,y),jn=M,dr=C,jn!==null)if(dr)try{W3(jn,y.stateNode)}catch(N){sn(y,f,N)}else try{V3(jn,y.stateNode)}catch(N){sn(y,f,N)}}else jr(u,f,y);break;case 18:Ei&&jn!==null&&(dr?pU(jn,y.stateNode):dU(jn,y.stateNode));break;case 4:Ei?(M=jn,C=dr,jn=y.stateNode.containerInfo,dr=!0,jr(u,f,y),jn=M,dr=C):(Ba&&Db(y.stateNode,y,SS()),jr(u,f,y));break;case 0:case 11:case 14:case 15:In||La(2,y,f),In||La(4,y,f),jr(u,f,y);break;case 1:In||(ar(y,f),M=y.stateNode,typeof M.componentWillUnmount=="function"&&Tb(y,f,M)),jr(u,f,y);break;case 21:jr(u,f,y);break;case 22:In||ar(y,f),In=(M=In)||y.memoizedState!==null,jr(u,f,y),In=M;break;default:jr(u,f,y)}}function Lb(u,f){if(Er&&f.memoizedState===null&&(u=f.alternate,u!==null&&(u=u.memoizedState,u!==null&&(u=u.dehydrated,u!==null))))try{fU(u)}catch(y){sn(f,f.return,y)}}function YD(u){switch(u.tag){case 13:case 19:var f=u.stateNode;return f===null&&(f=u.stateNode=new XS),f;case 22:return u=u.stateNode,f=u._retryCache,f===null&&(f=u._retryCache=new XS),f;default:throw Error(r(435,u.tag))}}function W0(u,f){var y=YD(u);f.forEach(function(M){var C=n3.bind(null,u,M);y.has(M)||(y.add(M),M.then(C,C))})}function Xi(u,f){var y=f.deletions;if(y!==null)for(var M=0;M<y.length;M++){var C=y[M],N=u,Z=f;if(Ei){var le=Z;e:for(;le!==null;){switch(le.tag){case 27:case 5:jn=le.stateNode,dr=!1;break e;case 3:jn=le.stateNode.containerInfo,dr=!0;break e;case 4:jn=le.stateNode.containerInfo,dr=!0;break e}le=le.return}if(jn===null)throw Error(r(160));V0(N,Z,C),jn=null,dr=!1}else V0(N,Z,C);N=C.alternate,N!==null&&(N.return=null),C.return=null}if(f.subtreeFlags&13878)for(f=f.child;f!==null;)Ib(f,u),f=f.sibling}function Ib(u,f){var y=u.alternate,M=u.flags;switch(u.tag){case 0:case 11:case 14:case 15:Xi(f,u),or(u),M&4&&(La(3,u,u.return),Yu(3,u),La(5,u,u.return));break;case 1:Xi(f,u),or(u),M&512&&(In||y===null||ar(y,y.return)),M&64&&Ks&&(u=u.updateQueue,u!==null&&(M=u.callbacks,M!==null&&(y=u.shared.hiddenCallbacks,u.shared.hiddenCallbacks=y===null?M:y.concat(M))));break;case 26:if(Mr){var C=Zr;Xi(f,u),or(u),M&512&&(In||y===null||ar(y,y.return)),M&4&&(M=y!==null?y.memoizedState:null,f=u.memoizedState,y===null?f===null?u.stateNode===null?u.stateNode=vU(C,u.type,u.memoizedProps,u):IS(C,u.type,u.stateNode):u.stateNode=OS(C,f,u.memoizedProps):M!==f?(M===null?y.stateNode!==null&&NS(y.stateNode):LS(M),f===null?IS(C,u.type,u.stateNode):OS(C,f,u.memoizedProps)):f===null&&u.stateNode!==null&&Cb(u,u.memoizedProps,y.memoizedProps));break}case 27:if(Mi&&M&4&&u.alternate===null){C=u.stateNode;var N=u.memoizedProps;try{SU(C),EU(u.type,N,C,u)}catch(Ke){sn(u,u.return,Ke)}}case 5:if(Xi(f,u),or(u),M&512&&(In||y===null||ar(y,y.return)),Ei){if(u.flags&32){f=u.stateNode;try{bS(f)}catch(Ke){sn(u,u.return,Ke)}}M&4&&u.stateNode!=null&&(f=u.memoizedProps,Cb(u,f,y!==null?y.memoizedProps:f)),M&1024&&(Ov=!0)}break;case 6:if(Xi(f,u),or(u),M&4&&Ei){if(u.stateNode===null)throw Error(r(162));M=u.memoizedProps,y=y!==null?y.memoizedProps:M,f=u.stateNode;try{F3(f,y,M)}catch(Ke){sn(u,u.return,Ke)}}break;case 3:if(Mr?(_U(),C=Zr,Zr=yv(f.containerInfo),Xi(f,u),Zr=C):Xi(f,u),or(u),M&4){if(Ei&&Er&&y!==null&&y.memoizedState.isDehydrated)try{hU(f.containerInfo)}catch(Ke){sn(u,u.return,Ke)}if(Ba){M=f.containerInfo,y=f.pendingChildren;try{MS(M,y)}catch(Ke){sn(u,u.return,Ke)}}}Ov&&(Ov=!1,Nb(u));break;case 4:Mr?(y=Zr,Zr=yv(u.stateNode.containerInfo),Xi(f,u),or(u),Zr=y):(Xi(f,u),or(u)),M&4&&Ba&&Db(u.stateNode,u,u.stateNode.pendingChildren);break;case 12:Xi(f,u),or(u);break;case 13:Xi(f,u),or(u),u.child.flags&8192&&u.memoizedState!==null!=(y!==null&&y.memoizedState!==null)&&(Pv=qr()),M&4&&(M=u.updateQueue,M!==null&&(u.updateQueue=null,W0(u,M)));break;case 22:M&512&&(In||y===null||ar(y,y.return)),C=u.memoizedState!==null;var Z=y!==null&&y.memoizedState!==null,le=Ks,we=In;if(Ks=le||C,In=we||Z,Xi(f,u),In=we,Ks=le,or(u),f=u.stateNode,f._current=u,f._visibility&=-3,f._visibility|=f._pendingVisibility&2,M&8192&&(f._visibility=C?f._visibility&-2:f._visibility|1,C&&(f=Ks||In,y===null||Z||f||jl(u)),Ei&&(u.memoizedProps===null||u.memoizedProps.mode!=="manual"))){e:if(y=null,Ei)for(f=u;;){if(f.tag===5||Mr&&f.tag===26||Mi&&f.tag===27){if(y===null){Z=y=f;try{N=Z.stateNode,C?X3(N):q3(Z.stateNode,Z.memoizedProps)}catch(Ke){sn(Z,Z.return,Ke)}}}else if(f.tag===6){if(y===null){Z=f;try{var Fe=Z.stateNode;C?j3(Fe):Y3(Fe,Z.memoizedProps)}catch(Ke){sn(Z,Z.return,Ke)}}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===u)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===u)break e;for(;f.sibling===null;){if(f.return===null||f.return===u)break e;y===f&&(y=null),f=f.return}y===f&&(y=null),f.sibling.return=f.return,f=f.sibling}}M&4&&(M=u.updateQueue,M!==null&&(y=M.retryQueue,y!==null&&(M.retryQueue=null,W0(u,y))));break;case 19:Xi(f,u),or(u),M&4&&(M=u.updateQueue,M!==null&&(u.updateQueue=null,W0(u,M)));break;case 21:break;default:Xi(f,u),or(u)}}function or(u){var f=u.flags;if(f&2){try{if(Ei&&(!Mi||u.tag!==27)){e:{for(var y=u.return;y!==null;){if(Rb(y)){var M=y;break e}y=y.return}throw Error(r(160))}switch(M.tag){case 27:if(Mi){var C=M.stateNode,N=G0(u);yd(u,N,C);break}case 5:var Z=M.stateNode;M.flags&32&&(bS(Z),M.flags&=-33);var le=G0(u);yd(u,le,Z);break;case 3:case 4:var we=M.stateNode.containerInfo,Fe=G0(u);H0(u,Fe,we);break;default:throw Error(r(161))}}}catch(Ke){sn(u,u.return,Ke)}u.flags&=-3}f&4096&&(u.flags&=-4097)}function Nb(u){if(u.subtreeFlags&1024)for(u=u.child;u!==null;){var f=u;Nb(f),f.tag===5&&f.flags&1024&&A3(f.stateNode),u=u.sibling}}function Ws(u,f){if(f.subtreeFlags&8772)for(f=f.child;f!==null;)Ub(u,f.alternate,f),f=f.sibling}function jl(u){for(u=u.child;u!==null;){var f=u;switch(f.tag){case 0:case 11:case 14:case 15:La(4,f,f.return),jl(f);break;case 1:ar(f,f.return);var y=f.stateNode;typeof y.componentWillUnmount=="function"&&Tb(f,f.return,y),jl(f);break;case 26:case 27:case 5:ar(f,f.return),jl(f);break;case 22:ar(f,f.return),f.memoizedState===null&&jl(f);break;default:jl(f)}u=u.sibling}}function Ia(u,f,y){for(y=y&&(f.subtreeFlags&8772)!==0,f=f.child;f!==null;){var M=f.alternate,C=u,N=f,Z=N.flags;switch(N.tag){case 0:case 11:case 15:Ia(C,N,y),Yu(4,N);break;case 1:if(Ia(C,N,y),M=N,C=M.stateNode,typeof C.componentDidMount=="function")try{C.componentDidMount()}catch(Fe){sn(M,M.return,Fe)}if(M=N,C=M.updateQueue,C!==null){var le=M.stateNode;try{var we=C.shared.hiddenCallbacks;if(we!==null)for(C.shared.hiddenCallbacks=null,C=0;C<we.length;C++)ce(we[C],le)}catch(Fe){sn(M,M.return,Fe)}}y&&Z&64&&wb(N),Uo(N,N.return);break;case 26:case 27:case 5:Ia(C,N,y),y&&M===null&&Z&4&&Ab(N),Uo(N,N.return);break;case 12:Ia(C,N,y);break;case 13:Ia(C,N,y),y&&Z&4&&Lb(C,N);break;case 22:N.memoizedState===null&&Ia(C,N,y),Uo(N,N.return);break;default:Ia(C,N,y)}f=f.sibling}}function X0(u,f){var y=null;u!==null&&u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(y=u.memoizedState.cachePool.pool),u=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(u=f.memoizedState.cachePool.pool),u!==y&&(u!=null&&u.refCount++,y!=null&&ju(y))}function j0(u,f){u=null,f.alternate!==null&&(u=f.alternate.memoizedState.cache),f=f.memoizedState.cache,f!==u&&(f.refCount++,u!=null&&ju(u))}function Na(u,f,y,M){if(f.subtreeFlags&10256)for(f=f.child;f!==null;)Pb(u,f,y,M),f=f.sibling}function Pb(u,f,y,M){var C=f.flags;switch(f.tag){case 0:case 11:case 15:Na(u,f,y,M),C&2048&&Yu(9,f);break;case 3:Na(u,f,y,M),C&2048&&(u=null,f.alternate!==null&&(u=f.alternate.memoizedState.cache),f=f.memoizedState.cache,f!==u&&(f.refCount++,u!=null&&ju(u)));break;case 12:if(C&2048){Na(u,f,y,M),u=f.stateNode;try{var N=f.memoizedProps,Z=N.id,le=N.onPostCommit;typeof le=="function"&&le(Z,f.alternate===null?"mount":"update",u.passiveEffectDuration,-0)}catch(we){sn(f,f.return,we)}}else Na(u,f,y,M);break;case 23:break;case 22:N=f.stateNode,f.memoizedState!==null?N._visibility&4?Na(u,f,y,M):Zu(u,f):N._visibility&4?Na(u,f,y,M):(N._visibility|=4,ql(u,f,y,M,(f.subtreeFlags&10256)!==0)),C&2048&&X0(f.alternate,f);break;case 24:Na(u,f,y,M),C&2048&&j0(f.alternate,f);break;default:Na(u,f,y,M)}}function ql(u,f,y,M,C){for(C=C&&(f.subtreeFlags&10256)!==0,f=f.child;f!==null;){var N=u,Z=f,le=y,we=M,Fe=Z.flags;switch(Z.tag){case 0:case 11:case 15:ql(N,Z,le,we,C),Yu(8,Z);break;case 23:break;case 22:var Ke=Z.stateNode;Z.memoizedState!==null?Ke._visibility&4?ql(N,Z,le,we,C):Zu(N,Z):(Ke._visibility|=4,ql(N,Z,le,we,C)),C&&Fe&2048&&X0(Z.alternate,Z);break;case 24:ql(N,Z,le,we,C),C&&Fe&2048&&j0(Z.alternate,Z);break;default:ql(N,Z,le,we,C)}f=f.sibling}}function Zu(u,f){if(f.subtreeFlags&10256)for(f=f.child;f!==null;){var y=u,M=f,C=M.flags;switch(M.tag){case 22:Zu(y,M),C&2048&&X0(M.alternate,M);break;case 24:Zu(y,M),C&2048&&j0(M.alternate,M);break;default:Zu(y,M)}f=f.sibling}}function Oo(u){if(u.subtreeFlags&dc)for(u=u.child;u!==null;)zb(u),u=u.sibling}function zb(u){switch(u.tag){case 26:Oo(u),u.flags&dc&&(u.memoizedState!==null?bU(Zr,u.memoizedState,u.memoizedProps):xS(u.type,u.memoizedProps));break;case 5:Oo(u),u.flags&dc&&xS(u.type,u.memoizedProps);break;case 3:case 4:if(Mr){var f=Zr;Zr=yv(u.stateNode.containerInfo),Oo(u),Zr=f}else Oo(u);break;case 22:u.memoizedState===null&&(f=u.alternate,f!==null&&f.memoizedState!==null?(f=dc,dc=16777216,Oo(u),dc=f):Oo(u));break;default:Oo(u)}}function Fb(u){var f=u.alternate;if(f!==null&&(u=f.child,u!==null)){f.child=null;do f=u.sibling,u.sibling=null,u=f;while(u!==null)}}function Ku(u){var f=u.deletions;if((u.flags&16)!==0){if(f!==null)for(var y=0;y<f.length;y++){var M=f[y];li=M,kb(M,u)}Fb(u)}if(u.subtreeFlags&10256)for(u=u.child;u!==null;)Bb(u),u=u.sibling}function Bb(u){switch(u.tag){case 0:case 11:case 15:Ku(u),u.flags&2048&&La(9,u,u.return);break;case 3:Ku(u);break;case 12:Ku(u);break;case 22:var f=u.stateNode;u.memoizedState!==null&&f._visibility&4&&(u.return===null||u.return.tag!==13)?(f._visibility&=-5,_d(u)):Ku(u);break;default:Ku(u)}}function _d(u){var f=u.deletions;if((u.flags&16)!==0){if(f!==null)for(var y=0;y<f.length;y++){var M=f[y];li=M,kb(M,u)}Fb(u)}for(u=u.child;u!==null;){switch(f=u,f.tag){case 0:case 11:case 15:La(8,f,f.return),_d(f);break;case 22:y=f.stateNode,y._visibility&4&&(y._visibility&=-5,_d(f));break;default:_d(f)}u=u.sibling}}function kb(u,f){for(;li!==null;){var y=li;switch(y.tag){case 0:case 11:case 15:La(8,y,f);break;case 23:case 22:if(y.memoizedState!==null&&y.memoizedState.cachePool!==null){var M=y.memoizedState.cachePool.pool;M!=null&&M.refCount++}break;case 24:ju(y.memoizedState.cache)}if(M=y.child,M!==null)M.return=y,li=M;else e:for(y=u;li!==null;){M=li;var C=M.sibling,N=M.return;if(Ob(M),M===y){li=null;break e}if(C!==null){C.return=N,li=C;break e}li=N}}}function q0(u){var f=yS(u);if(f!=null){if(typeof f.memoizedProps["data-testname"]!="string")throw Error(r(364));return f}if(u=D3(u),u===null)throw Error(r(362));return u.stateNode.current}function Y0(u,f){var y=u.tag;switch(f.$$typeof){case Fd:if(u.type===f.value)return!0;break;case Bd:e:{for(f=f.value,u=[u,0],y=0;y<u.length;){var M=u[y++],C=M.tag,N=u[y++],Z=f[N];if(C!==5&&C!==26&&C!==27||!$u(M)){for(;Z!=null&&Y0(M,Z);)N++,Z=f[N];if(N===f.length){f=!0;break e}else for(M=M.child;M!==null;)u.push(M,N),M=M.sibling}}f=!1}return f;case kd:if((y===5||y===26||y===27)&&L3(u.stateNode,f.value))return!0;break;case Hd:if((y===5||y===6||y===26||y===27)&&(u=O3(u),u!==null&&0<=u.indexOf(f.value)))return!0;break;case Gd:if((y===5||y===26||y===27)&&(u=u.memoizedProps["data-testname"],typeof u=="string"&&u.toLowerCase()===f.value.toLowerCase()))return!0;break;default:throw Error(r(365))}return!1}function Z0(u){switch(u.$$typeof){case Fd:return"<"+(a(u.value)||"Unknown")+">";case Bd:return":has("+(Z0(u)||"")+")";case kd:return'[role="'+u.value+'"]';case Hd:return'"'+u.value+'"';case Gd:return'[data-testname="'+u.value+'"]';default:throw Error(r(365))}}function Gb(u,f){var y=[];u=[u,0];for(var M=0;M<u.length;){var C=u[M++],N=C.tag,Z=u[M++],le=f[Z];if(N!==5&&N!==26&&N!==27||!$u(C)){for(;le!=null&&Y0(C,le);)Z++,le=f[Z];if(Z===f.length)y.push(C);else for(C=C.child;C!==null;)u.push(C,Z),C=C.sibling}}return y}function K0(u,f){if(!Qu)throw Error(r(363));u=q0(u),u=Gb(u,f),f=[],u=Array.from(u);for(var y=0;y<u.length;){var M=u[y++],C=M.tag;if(C===5||C===26||C===27)$u(M)||f.push(M.stateNode);else for(M=M.child;M!==null;)u.push(M),M=M.sibling}return f}function lr(){if((cn&2)!==0&&Vt!==0)return Vt&-Vt;if(wt.T!==null){var u=ac;return u!==0?u:_e()}return b3()}function Hb(){Rr===0&&(Rr=(Vt&536870912)===0||qt?U():536870912);var u=Cr.current;return u!==null&&(u.flags|=32),Rr}function Oi(u,f,y){(u===fn&&dn===2||u.cancelPendingCommit!==null)&&(Yl(u,0),Xs(u,Vt,Rr,!1)),L(u,y),((cn&2)===0||u!==fn)&&(u===fn&&((cn&2)===0&&(Wo|=y),Nn===4&&Xs(u,Vt,Rr,!1)),be(u))}function Vb(u,f,y){if((cn&6)!==0)throw Error(r(327));var M=!y&&(f&60)===0&&(f&u.expiredLanes)===0||T(u,f),C=M?JD(u,f):ev(u,f,!0),N=M;do{if(C===0){pc&&!M&&Xs(u,f,0,!1);break}else if(C===6)Xs(u,f,0,!Js);else{if(y=u.current.alternate,N&&!ZD(y)){C=ev(u,f,!1),N=!1;continue}if(C===2){if(N=f,u.errorRecoveryDisabledLanes&N)var Z=0;else Z=u.pendingLanes&-536870913,Z=Z!==0?Z:Z&536870912?536870912:0;if(Z!==0){f=Z;e:{var le=u;C=oh;var we=Er&&le.current.memoizedState.isDehydrated;if(we&&(Yl(le,Z).flags|=256),Z=ev(le,Z,!1),Z!==2){if(Lv&&!we){le.errorRecoveryDisabledLanes|=N,Wo|=N,C=4;break e}N=ms,ms=C,N!==null&&J0(N)}C=Z}if(N=!1,C!==2)continue}}if(C===1){Yl(u,0),Xs(u,f,0,!0);break}e:{switch(M=u,C){case 0:case 1:throw Error(r(345));case 4:if((f&4194176)===f){Xs(M,f,Rr,!Js);break e}break;case 2:ms=null;break;case 3:case 5:break;default:throw Error(r(329))}if(M.finishedWork=y,M.finishedLanes=f,(f&62914560)===f&&(N=Pv+300-qr(),10<N)){if(Xs(M,f,Rr,!Js),w(M,0)!==0)break e;M.timeoutHandle=y3(Wb.bind(null,M,y,ms,Vd,Nv,f,Rr,Wo,mc,Js,2,-0,0),N);break e}Wb(M,y,ms,Vd,Nv,f,Rr,Wo,mc,Js,0,-0,0)}}break}while(!0);be(u)}function J0(u){ms===null?ms=u:ms.push.apply(ms,u)}function Wb(u,f,y,M,C,N,Z,le,we,Fe,Ke,ct,ht){var Dt=f.subtreeFlags;if((Dt&8192||(Dt&16785408)===16785408)&&(w3(),zb(f),f=T3(),f!==null)){u.cancelPendingCommit=f($b.bind(null,u,y,M,C,Z,le,we,1,ct,ht)),Xs(u,N,Z,!Fe);return}$b(u,y,M,C,Z,le,we,Ke,ct,ht)}function ZD(u){for(var f=u;;){var y=f.tag;if((y===0||y===11||y===15)&&f.flags&16384&&(y=f.updateQueue,y!==null&&(y=y.stores,y!==null)))for(var M=0;M<y.length;M++){var C=y[M],N=C.getSnapshot;C=C.value;try{if(!fr(N(),C))return!1}catch{return!1}}if(y=f.child,f.subtreeFlags&16384&&y!==null)y.return=f,f=y;else{if(f===u)break;for(;f.sibling===null;){if(f.return===null||f.return===u)return!0;f=f.return}f.sibling.return=f.return,f=f.sibling}}return!0}function Xs(u,f,y,M){f&=~Iv,f&=~Wo,u.suspendedLanes|=f,u.pingedLanes&=~f,M&&(u.warmLanes|=f),M=u.expirationTimes;for(var C=f;0<C;){var N=31-ur(C),Z=1<<N;M[N]=-1,C&=~Z}y!==0&&I(u,y,f)}function Xb(){return(cn&6)===0?(ue(0),!1):!0}function Q0(){if(Ft!==null){if(dn===0)var u=Ft.return;else u=Ft,Zs=Ho=null,q(u),cc=null,rh=0,u=Ft;for(;u!==null;)Mb(u.alternate,u),u=u.return;Ft=null}}function Yl(u,f){u.finishedWork=null,u.finishedLanes=0;var y=u.timeoutHandle;y!==mv&&(u.timeoutHandle=mv,_3(y)),y=u.cancelPendingCommit,y!==null&&(u.cancelPendingCommit=null,y()),Q0(),fn=u,Ft=y=Pa(u.current,null),Vt=f,dn=0,pr=null,Js=!1,pc=T(u,f),Lv=!1,mc=Rr=Iv=Wo=Wa=Nn=0,ms=oh=null,Nv=!1,(f&8)!==0&&(f|=f&32);var M=u.entangledLanes;if(M!==0)for(u=u.entanglements,M&=f;0<M;){var C=31-ur(M),N=1<<C;f|=u[C],M&=~N}return Qs=f,oe(),y}function jb(u,f){Nt=null,wt.H=ps,f===ih?(f=Qe(),dn=3):f===Cv?(f=Qe(),dn=4):dn=f===VS?8:f!==null&&typeof f=="object"&&typeof f.then=="function"?6:1,pr=f,Ft===null&&(Nn=1,hs(u,G(f,u.current)))}function qb(){var u=Cr.current;return u===null?!0:(Vt&4194176)===Vt?ds===null:(Vt&62914560)===Vt||(Vt&536870912)!==0?u===ds:!1}function Yb(){var u=wt.H;return wt.H=ps,u===null?ps:u}function Zb(){var u=wt.A;return wt.A=FU,u}function $0(){Nn=4,Js||(Vt&4194176)!==Vt&&Cr.current!==null||(pc=!0),(Wa&134217727)===0&&(Wo&134217727)===0||fn===null||Xs(fn,Vt,Rr,!1)}function ev(u,f,y){var M=cn;cn|=2;var C=Yb(),N=Zb();(fn!==u||Vt!==f)&&(Vd=null,Yl(u,f)),f=!1;var Z=Nn;e:do try{if(dn!==0&&Ft!==null){var le=Ft,we=pr;switch(dn){case 8:Q0(),Z=6;break e;case 3:case 2:case 6:Cr.current===null&&(f=!0);var Fe=dn;if(dn=0,pr=null,Zl(u,le,we,Fe),y&&pc){Z=0;break e}break;default:Fe=dn,dn=0,pr=null,Zl(u,le,we,Fe)}}KD(),Z=Nn;break}catch(Ke){jb(u,Ke)}while(!0);return f&&u.shellSuspendCounter++,Zs=Ho=null,cn=M,wt.H=C,wt.A=N,Ft===null&&(fn=null,Vt=0,oe()),Z}function KD(){for(;Ft!==null;)Kb(Ft)}function JD(u,f){var y=cn;cn|=2;var M=Yb(),C=Zb();fn!==u||Vt!==f?(Vd=null,lh=qr()+500,Yl(u,f)):pc=T(u,f);e:do try{if(dn!==0&&Ft!==null){f=Ft;var N=pr;t:switch(dn){case 1:dn=0,pr=null,Zl(u,f,N,1);break;case 2:if(rt(N)){dn=0,pr=null,Jb(f);break}f=function(){dn===2&&fn===u&&(dn=7),be(u)},N.then(f,f);break e;case 3:dn=7;break e;case 4:dn=5;break e;case 7:rt(N)?(dn=0,pr=null,Jb(f)):(dn=0,pr=null,Zl(u,f,N,7));break;case 5:var Z=null;switch(Ft.tag){case 26:Z=Ft.memoizedState;case 5:case 27:var le=Ft,we=le.type,Fe=le.pendingProps;if(Z?PS(Z):_S(we,Fe)){dn=0,pr=null;var Ke=le.sibling;if(Ke!==null)Ft=Ke;else{var ct=le.return;ct!==null?(Ft=ct,xd(ct)):Ft=null}break t}}dn=0,pr=null,Zl(u,f,N,5);break;case 6:dn=0,pr=null,Zl(u,f,N,6);break;case 8:Q0(),Nn=6;break e;default:throw Error(r(462))}}QD();break}catch(ht){jb(u,ht)}while(!0);return Zs=Ho=null,wt.H=M,wt.A=C,cn=y,Ft!==null?0:(fn=null,Vt=0,oe(),Nn)}function QD(){for(;Ft!==null&&!AU();)Kb(Ft)}function Kb(u){var f=vb(u.alternate,u,Qs);u.memoizedProps=u.pendingProps,f===null?xd(u):Ft=f}function Jb(u){var f=u,y=f.alternate;switch(f.tag){case 15:case 0:f=Wu(y,f,f.pendingProps,f.type,void 0,Vt);break;case 11:f=Wu(y,f,f.pendingProps,f.type.render,f.ref,Vt);break;case 5:q(f);default:Mb(y,f),f=Ft=iS(f,Qs),f=vb(y,f,Qs)}u.memoizedProps=u.pendingProps,f===null?xd(u):Ft=f}function Zl(u,f,y,M){Zs=Ho=null,q(f),cc=null,rh=0;var C=f.return;try{if(T0(u,C,f,y,Vt)){Nn=1,hs(u,G(y,u.current)),Ft=null;return}}catch(N){if(C!==null)throw Ft=C,N;Nn=1,hs(u,G(y,u.current)),Ft=null;return}f.flags&32768?(qt||M===1?u=!0:pc||(Vt&536870912)!==0?u=!1:(Js=u=!0,(M===2||M===3||M===6)&&(M=Cr.current,M!==null&&M.tag===13&&(M.flags|=16384))),Qb(f,u)):xd(f)}function xd(u){var f=u;do{if((f.flags&32768)!==0){Qb(f,Js);return}u=f.return;var y=XD(f.alternate,f,Qs);if(y!==null){Ft=y;return}if(f=f.sibling,f!==null){Ft=f;return}Ft=f=u}while(f!==null);Nn===0&&(Nn=5)}function Qb(u,f){do{var y=jD(u.alternate,u);if(y!==null){y.flags&=32767,Ft=y;return}if(y=u.return,y!==null&&(y.flags|=32768,y.subtreeFlags=0,y.deletions=null),!f&&(u=u.sibling,u!==null)){Ft=u;return}Ft=u=y}while(u!==null);Nn=6,Ft=null}function $b(u,f,y,M,C,N,Z,le,we,Fe){var Ke=wt.T,ct=No();try{ji(2),wt.T=null,$D(u,f,y,M,ct,C,N,Z,le,we,Fe)}finally{wt.T=Ke,ji(ct)}}function $D(u,f,y,M,C,N,Z,le){do Lo();while(Xo!==null);if((cn&6)!==0)throw Error(r(327));var we=u.finishedWork;if(M=u.finishedLanes,we===null)return null;if(u.finishedWork=null,u.finishedLanes=0,we===u.current)throw Error(r(177));u.callbackNode=null,u.callbackPriority=0,u.cancelPendingCommit=null;var Fe=we.lanes|we.childLanes;if(Fe|=Ev,P(u,M,Fe,N,Z,le),u===fn&&(Ft=fn=null,Vt=0),(we.subtreeFlags&10256)===0&&(we.flags&10256)===0||Wd||(Wd=!0,zv=Fe,Fv=y,i3(bv,function(){return Lo(),null})),y=(we.flags&15990)!==0,(we.subtreeFlags&15990)!==0||y?(y=wt.T,wt.T=null,N=No(),ji(2),Z=cn,cn|=4,qD(u,we),Ib(we,u),g3(u.containerInfo),u.current=we,Ub(u,we.alternate,we),CU(),cn=Z,ji(N),wt.T=y):u.current=we,Wd?(Wd=!1,Xo=u,ch=M):eS(u,Fe),Fe=u.pendingLanes,Fe===0&&(Xa=null),z(we.stateNode),be(u),f!==null)for(C=u.onRecoverableError,we=0;we<f.length;we++)Fe=f[we],C(Fe.value,{componentStack:Fe.stack});return(ch&3)!==0&&Lo(),Fe=u.pendingLanes,(M&4194218)!==0&&(Fe&42)!==0?u===Bv?uh++:(uh=0,Bv=u):uh=0,ue(0),null}function eS(u,f){(u.pooledCacheLanes&=f)===0&&(f=u.pooledCache,f!=null&&(u.pooledCache=null,ju(f)))}function Lo(){if(Xo!==null){var u=Xo,f=zv;zv=0;var y=H(ch),M=32>y?32:y;y=wt.T;var C=No();try{if(ji(M),wt.T=null,Xo===null)var N=!1;else{M=Fv,Fv=null;var Z=Xo,le=ch;if(Xo=null,ch=0,(cn&6)!==0)throw Error(r(331));var we=cn;if(cn|=4,Bb(Z.current),Pb(Z,Z.current,le,M),cn=we,ue(0,!1),hr&&typeof hr.onPostCommitFiberRoot=="function")try{hr.onPostCommitFiberRoot(eh,Z)}catch{}N=!0}return N}finally{ji(C),wt.T=y,eS(u,f)}}return!1}function tS(u,f,y){f=G(y,f),f=Gs(u.stateNode,f,2),u=Be(u,f,2),u!==null&&(L(u,2),be(u))}function sn(u,f,y){if(u.tag===3)tS(u,u,y);else for(;f!==null;){if(f.tag===3){tS(f,u,y);break}else if(f.tag===1){var M=f.stateNode;if(typeof f.type.getDerivedStateFromError=="function"||typeof M.componentDidCatch=="function"&&(Xa===null||!Xa.has(M))){u=G(y,u),y=Xl(2),M=Be(f,y,2),M!==null&&(bi(y,M,f,u),L(M,2),be(M));break}}f=f.return}}function tv(u,f,y){var M=u.pingCache;if(M===null){M=u.pingCache=new BU;var C=new Set;M.set(f,C)}else C=M.get(f),C===void 0&&(C=new Set,M.set(f,C));C.has(y)||(Lv=!0,C.add(y),u=e3.bind(null,u,f,y),f.then(u,u))}function e3(u,f,y){var M=u.pingCache;M!==null&&M.delete(f),u.pingedLanes|=u.suspendedLanes&y,u.warmLanes&=~y,fn===u&&(Vt&y)===y&&(Nn===4||Nn===3&&(Vt&62914560)===Vt&&300>qr()-Pv?(cn&2)===0&&Yl(u,0):Iv|=y,mc===Vt&&(mc=0)),be(u)}function nS(u,f){f===0&&(f=A()),u=pe(u,f),u!==null&&(L(u,f),be(u))}function t3(u){var f=u.memoizedState,y=0;f!==null&&(y=f.retryLane),nS(u,y)}function n3(u,f){var y=0;switch(u.tag){case 13:var M=u.stateNode,C=u.memoizedState;C!==null&&(y=C.retryLane);break;case 19:M=u.stateNode;break;case 22:M=u.stateNode._retryCache;break;default:throw Error(r(314))}M!==null&&M.delete(f),nS(u,y)}function i3(u,f){return Ad(u,f)}function r3(u,f,y,M){this.tag=u,this.key=y,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=f,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=M,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function nv(u){return u=u.prototype,!(!u||!u.isReactComponent)}function Pa(u,f){var y=u.alternate;return y===null?(y=t(u.tag,f,u.key,u.mode),y.elementType=u.elementType,y.type=u.type,y.stateNode=u.stateNode,y.alternate=u,u.alternate=y):(y.pendingProps=f,y.type=u.type,y.flags=0,y.subtreeFlags=0,y.deletions=null),y.flags=u.flags&31457280,y.childLanes=u.childLanes,y.lanes=u.lanes,y.child=u.child,y.memoizedProps=u.memoizedProps,y.memoizedState=u.memoizedState,y.updateQueue=u.updateQueue,f=u.dependencies,y.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext},y.sibling=u.sibling,y.index=u.index,y.ref=u.ref,y.refCleanup=u.refCleanup,y}function iS(u,f){u.flags&=31457282;var y=u.alternate;return y===null?(u.childLanes=0,u.lanes=f,u.child=null,u.subtreeFlags=0,u.memoizedProps=null,u.memoizedState=null,u.updateQueue=null,u.dependencies=null,u.stateNode=null):(u.childLanes=y.childLanes,u.lanes=y.lanes,u.child=y.child,u.subtreeFlags=0,u.deletions=null,u.memoizedProps=y.memoizedProps,u.memoizedState=y.memoizedState,u.updateQueue=y.updateQueue,u.type=y.type,f=y.dependencies,u.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext}),u}function bd(u,f,y,M,C,N){var Z=0;if(M=u,typeof u=="function")nv(u)&&(Z=1);else if(typeof u=="string")Z=Mr&&Mi?DS(u,y,pi.current)?26:FS(u)?27:5:Mr?DS(u,y,pi.current)?26:5:Mi&&FS(u)?27:5;else e:switch(u){case Jl:return Io(y.children,C,N,f);case uS:Z=8,C|=24;break;case ov:return u=t(12,y,f,C|2),u.elementType=ov,u.lanes=N,u;case cv:return u=t(13,y,f,C),u.elementType=cv,u.lanes=N,u;case uv:return u=t(19,y,f,C),u.elementType=uv,u.lanes=N,u;case fS:return rS(y,C,N,f);default:if(typeof u=="object"&&u!==null)switch(u.$$typeof){case l3:case za:Z=10;break e;case hS:Z=9;break e;case lv:Z=11;break e;case hv:Z=14;break e;case Fa:Z=16,M=null;break e}Z=29,y=Error(r(130,u===null?"null":typeof u,"")),M=null}return f=t(Z,y,f,C),f.elementType=u,f.type=M,f.lanes=N,f}function Io(u,f,y,M){return u=t(7,u,M,f),u.lanes=y,u}function rS(u,f,y,M){u=t(22,u,M,f),u.elementType=fS,u.lanes=y;var C={_visibility:1,_pendingVisibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var N=C._current;if(N===null)throw Error(r(456));if((C._pendingVisibility&2)===0){var Z=pe(N,2);Z!==null&&(C._pendingVisibility|=2,Oi(Z,N,2))}},attach:function(){var N=C._current;if(N===null)throw Error(r(456));if((C._pendingVisibility&2)!==0){var Z=pe(N,2);Z!==null&&(C._pendingVisibility&=-3,Oi(Z,N,2))}}};return u.stateNode=C,u}function iv(u,f,y){return u=t(6,u,null,f),u.lanes=y,u}function rv(u,f,y){return f=t(4,u.children!==null?u.children:[],u.key,f),f.lanes=y,f.stateNode={containerInfo:u.containerInfo,pendingChildren:null,implementation:u.implementation},f}function s3(u,f,y,M,C,N,Z,le){this.tag=1,this.containerInfo=u,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=mv,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=D(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=D(0),this.hiddenUpdates=D(null),this.identifierPrefix=M,this.onUncaughtError=C,this.onCaughtError=N,this.onRecoverableError=Z,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=le,this.incompleteTransitions=new Map}function sS(u,f,y,M,C,N,Z,le,we,Fe,Ke,ct){return u=new s3(u,f,y,Z,le,we,Fe,ct),f=1,N===!0&&(f|=24),N=t(3,null,null,f),u.current=N,N.stateNode=u,f=P0(),f.refCount++,u.pooledCache=f,f.refCount++,N.memoizedState={element:M,isDehydrated:y,cache:f},je(N),u}function aS(u){return u?(u=ec,u):ec}function oS(u){var f=u._reactInternals;if(f===void 0)throw typeof u.render=="function"?Error(r(188)):(u=Object.keys(u).join(","),Error(r(268,u)));return u=m(f),u=u!==null?v(u):null,u===null?null:Ju(u.stateNode)}function lS(u,f,y,M,C,N){C=aS(C),M.context===null?M.context=C:M.pendingContext=C,M=Le(f),M.payload={element:y},N=N===void 0?null:N,N!==null&&(M.callback=N),y=Be(u,M,f),y!==null&&(Oi(y,u,f),Ve(y,u,f))}function cS(u,f){if(u=u.memoizedState,u!==null&&u.dehydrated!==null){var y=u.retryLane;u.retryLane=y!==0&&y<f?y:f}}function sv(u,f){cS(u,f),(u=u.alternate)&&cS(u,f)}var zt={},a3=bA(),cr=G4(),av=Object.assign,o3=Symbol.for("react.element"),Sd=Symbol.for("react.transitional.element"),Kl=Symbol.for("react.portal"),Jl=Symbol.for("react.fragment"),uS=Symbol.for("react.strict_mode"),ov=Symbol.for("react.profiler"),l3=Symbol.for("react.provider"),hS=Symbol.for("react.consumer"),za=Symbol.for("react.context"),lv=Symbol.for("react.forward_ref"),cv=Symbol.for("react.suspense"),uv=Symbol.for("react.suspense_list"),hv=Symbol.for("react.memo"),Fa=Symbol.for("react.lazy"),fS=Symbol.for("react.offscreen"),c3=Symbol.for("react.memo_cache_sentinel"),dS=Symbol.iterator,u3=Symbol.for("react.client.reference"),wt=a3.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,fv,pS,dv=!1,Ed=Array.isArray,h3=e.rendererVersion,f3=e.rendererPackageName,mS=e.extraDevToolsConfig,Ju=e.getPublicInstance,d3=e.getRootHostContext,p3=e.getChildHostContext,m3=e.prepareForCommit,g3=e.resetAfterCommit,v3=e.createInstance,pv=e.appendInitialChild,gS=e.finalizeInitialChildren,Md=e.shouldSetTextContent,vS=e.createTextInstance,y3=e.scheduleTimeout,_3=e.cancelTimeout,mv=e.noTimeout,js=e.isPrimaryRenderer;e.warnsIfNotActing;var Ei=e.supportsMutation,Ba=e.supportsPersistence,Er=e.supportsHydration,yS=e.getInstanceFromNode;e.beforeActiveInstanceBlur,e.afterActiveInstanceBlur;var x3=e.preparePortalMount;e.prepareScopeUpdate,e.getInstanceFromScope;var ji=e.setCurrentUpdatePriority,No=e.getCurrentUpdatePriority,b3=e.resolveUpdatePriority;e.resolveEventType,e.resolveEventTimeStamp;var S3=e.shouldAttemptEagerTransition,E3=e.detachDeletedInstance;e.requestPostPaintCallback;var M3=e.maySuspendCommit,_S=e.preloadInstance,w3=e.startSuspendingCommit,xS=e.suspendInstance,T3=e.waitForCommitToBeReady,Ql=e.NotPendingTransition,Po=e.HostTransitionContext,A3=e.resetFormInstance;e.bindToConsole;var C3=e.supportsMicrotasks,R3=e.scheduleMicrotask,Qu=e.supportsTestSelectors,D3=e.findFiberRoot,U3=e.getBoundingRect,O3=e.getTextContent,$u=e.isHiddenSubtree,L3=e.matchAccessibilityRole,I3=e.setFocusIfFocusable,N3=e.setupIntersectionObserver,P3=e.appendChild,z3=e.appendChildToContainer,F3=e.commitTextUpdate,B3=e.commitMount,k3=e.commitUpdate,G3=e.insertBefore,H3=e.insertInContainerBefore,V3=e.removeChild,W3=e.removeChildFromContainer,bS=e.resetTextContent,X3=e.hideInstance,j3=e.hideTextInstance,q3=e.unhideInstance,Y3=e.unhideTextInstance,Z3=e.clearContainer,K3=e.cloneInstance,SS=e.createContainerChildSet,ES=e.appendChildToContainerChildSet,J3=e.finalizeContainerChildren,MS=e.replaceContainerChildren,wS=e.cloneHiddenInstance,TS=e.cloneHiddenTextInstance,gv=e.isSuspenseInstancePending,vv=e.isSuspenseInstanceFallback,Q3=e.getSuspenseInstanceFallbackErrorDetails,$3=e.registerSuspenseInstanceRetry,eU=e.canHydrateFormStateMarker,tU=e.isFormStateMarkerMatching,AS=e.getNextHydratableSibling,CS=e.getFirstHydratableChild,nU=e.getFirstHydratableChildWithinContainer,iU=e.getFirstHydratableChildWithinSuspenseInstance,rU=e.canHydrateInstance,sU=e.canHydrateTextInstance,aU=e.canHydrateSuspenseInstance,oU=e.hydrateInstance,lU=e.hydrateTextInstance,cU=e.hydrateSuspenseInstance,uU=e.getNextHydratableInstanceAfterSuspenseInstance,hU=e.commitHydratedContainer,fU=e.commitHydratedSuspenseInstance,dU=e.clearSuspenseBoundary,pU=e.clearSuspenseBoundaryFromContainer,RS=e.shouldDeleteUnhydratedTailInstances;e.diffHydratedPropsForDevWarnings,e.diffHydratedTextForDevWarnings,e.describeHydratableInstanceForDevWarnings;var mU=e.validateHydratableInstance,gU=e.validateHydratableTextInstance,Mr=e.supportsResources,DS=e.isHostHoistableType,yv=e.getHoistableRoot,US=e.getResource,OS=e.acquireResource,LS=e.releaseResource,vU=e.hydrateHoistable,IS=e.mountHoistable,NS=e.unmountHoistable,yU=e.createHoistableInstance,_U=e.prepareToCommitHoistables,xU=e.mayResourceSuspendCommit,PS=e.preloadResource,bU=e.suspendResource,Mi=e.supportsSingletons,zS=e.resolveSingletonInstance,SU=e.clearSingleton,EU=e.acquireSingletonInstance,MU=e.releaseSingletonInstance,FS=e.isHostSingletonType,_v=[],$l=-1,ec={},ur=Math.clz32?Math.clz32:E,wU=Math.log,TU=Math.LN2,wd=128,Td=4194304,Ad=cr.unstable_scheduleCallback,xv=cr.unstable_cancelCallback,AU=cr.unstable_shouldYield,CU=cr.unstable_requestPaint,qr=cr.unstable_now,BS=cr.unstable_ImmediatePriority,RU=cr.unstable_UserBlockingPriority,bv=cr.unstable_NormalPriority,DU=cr.unstable_IdlePriority,UU=cr.log,OU=cr.unstable_setDisableYieldValue,eh=null,hr=null,fr=typeof Object.is=="function"?Object.is:B,kS=new WeakMap,tc=[],nc=0,Cd=null,Rd=0,wr=[],Tr=0,zo=null,qs=1,Ys="",pi=_(null),th=_(null),ka=_(null),Dd=_(null),Li=null,wi=null,qt=!1,Yr=null,fs=!1,Sv=Error(r(519)),Ar=[],ic=0,Ev=0,Ud=null,rc=null,Mv=!1,Od=!1,wv=!1,sc=0,nh=null,Tv=0,ac=0,oc=null,Ga=!1,Av=!1,LU=Object.prototype.hasOwnProperty,ih=Error(r(460)),Cv=Error(r(474)),Ld={then:function(){}},lc=null,cc=null,rh=0,Fo=en(!0),GS=en(!1),uc=_(null),Id=_(0),Cr=_(null),ds=null,ti=_(0),Ha=0,Nt=null,ln=null,Xn=null,Nd=!1,hc=!1,Bo=!1,Pd=0,sh=0,fc=null,IU=0,Rv=function(){return{lastEffect:null,events:null,stores:null,memoCache:null}},ps={readContext:Si,use:ae,useCallback:jt,useContext:jt,useEffect:jt,useImperativeHandle:jt,useLayoutEffect:jt,useInsertionEffect:jt,useMemo:jt,useReducer:jt,useRef:jt,useState:jt,useDebugValue:jt,useDeferredValue:jt,useTransition:jt,useSyncExternalStore:jt,useId:jt};ps.useCacheRefresh=jt,ps.useMemoCache=jt,ps.useHostTransitionStatus=jt,ps.useFormState=jt,ps.useActionState=jt,ps.useOptimistic=jt;var ko={readContext:Si,use:ae,useCallback:function(u,f){return ge().memoizedState=[u,f===void 0?null:f],u},useContext:Si,useEffect:Gl,useImperativeHandle:function(u,f,y){y=y!=null?y.concat([u]):null,So(4194308,4,zs.bind(null,f,u),y)},useLayoutEffect:function(u,f){return So(4194308,4,u,f)},useInsertionEffect:function(u,f){So(4,2,u,f)},useMemo:function(u,f){var y=ge();f=f===void 0?null:f;var M=u();if(Bo){O(!0);try{u()}finally{O(!1)}}return y.memoizedState=[M,f],M},useReducer:function(u,f,y){var M=ge();if(y!==void 0){var C=y(f);if(Bo){O(!0);try{y(f)}finally{O(!1)}}}else C=f;return M.memoizedState=M.baseState=C,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:u,lastRenderedState:C},M.queue=u,u=u.dispatch=fd.bind(null,Nt,u),[M.memoizedState,u]},useRef:function(u){var f=ge();return u={current:u},f.memoizedState=u},useState:function(u){u=kt(u);var f=u.queue,y=ku.bind(null,Nt,f);return f.dispatch=y,[u.memoizedState,y]},useDebugValue:Bs,useDeferredValue:function(u,f){var y=ge();return wo(y,u,f)},useTransition:function(){var u=kt(!1);return u=zu.bind(null,Nt,u.queue,!0,!1),ge().memoizedState=u,[!1,u]},useSyncExternalStore:function(u,f,y){var M=Nt,C=ge();if(qt){if(y===void 0)throw Error(r(407));y=y()}else{if(y=f(),fn===null)throw Error(r(349));(Vt&60)!==0||pt(M,f,y)}C.memoizedState=y;var N={value:y,getSnapshot:f};return C.queue=N,Gl(Ht.bind(null,M,N,u),[u]),M.flags|=2048,ei(9,Tt.bind(null,M,N,y,f),{destroy:void 0},null),y},useId:function(){var u=ge(),f=fn.identifierPrefix;if(qt){var y=Ys,M=qs;y=(M&~(1<<32-ur(M)-1)).toString(32)+y,f=":"+f+"R"+y,y=Pd++,0<y&&(f+="H"+y.toString(32)),f+=":"}else y=IU++,f=":"+f+"r"+y.toString(32)+":";return u.memoizedState=f},useCacheRefresh:function(){return ge().memoizedState=Bu.bind(null,Nt)}};ko.useMemoCache=Xe,ko.useHostTransitionStatus=Ao,ko.useFormState=fi,ko.useActionState=fi,ko.useOptimistic=function(u){var f=ge();f.memoizedState=f.baseState=u;var y={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return f.queue=y,f=Vl.bind(null,Nt,!0,y),y.dispatch=f,[u,f]};var Va={readContext:Si,use:ae,useCallback:Pu,useContext:Si,useEffect:Ps,useImperativeHandle:Fs,useInsertionEffect:Nu,useLayoutEffect:Mo,useMemo:Ra,useReducer:lt,useRef:kl,useState:function(){return lt($e)},useDebugValue:Bs,useDeferredValue:function(u,f){var y=Te();return Hl(y,ln.memoizedState,u,f)},useTransition:function(){var u=lt($e)[0],f=Te().memoizedState;return[typeof u=="boolean"?u:Ue(u),f]},useSyncExternalStore:_t,useId:Fu};Va.useCacheRefresh=Vi,Va.useMemoCache=Xe,Va.useHostTransitionStatus=Ao,Va.useFormState=Vn,Va.useActionState=Vn,Va.useOptimistic=function(u,f){var y=Te();return gt(y,ln,u,f)};var Go={readContext:Si,use:ae,useCallback:Pu,useContext:Si,useEffect:Ps,useImperativeHandle:Fs,useInsertionEffect:Nu,useLayoutEffect:Mo,useMemo:Ra,useReducer:vt,useRef:kl,useState:function(){return vt($e)},useDebugValue:Bs,useDeferredValue:function(u,f){var y=Te();return ln===null?wo(y,u,f):Hl(y,ln.memoizedState,u,f)},useTransition:function(){var u=vt($e)[0],f=Te().memoizedState;return[typeof u=="boolean"?u:Ue(u),f]},useSyncExternalStore:_t,useId:Fu};Go.useCacheRefresh=Vi,Go.useMemoCache=Xe,Go.useHostTransitionStatus=Ao,Go.useFormState=Wr,Go.useActionState=Wr,Go.useOptimistic=function(u,f){var y=Te();return ln!==null?gt(y,ln,u,f):(y.baseState=u,[u,y.queue.dispatch])};var Dv={isMounted:function(u){return(u=u._reactInternals)?d(u)===u:!1},enqueueSetState:function(u,f,y){u=u._reactInternals;var M=lr(),C=Le(M);C.payload=f,y!=null&&(C.callback=y),f=Be(u,C,M),f!==null&&(Oi(f,u,M),Ve(f,u,M))},enqueueReplaceState:function(u,f,y){u=u._reactInternals;var M=lr(),C=Le(M);C.tag=1,C.payload=f,y!=null&&(C.callback=y),f=Be(u,C,M),f!==null&&(Oi(f,u,M),Ve(f,u,M))},enqueueForceUpdate:function(u,f){u=u._reactInternals;var y=lr(),M=Le(y);M.tag=2,f!=null&&(M.callback=f),f=Be(u,M,y),f!==null&&(Oi(f,u,y),Ve(f,u,y))}},HS=typeof reportError=="function"?reportError:function(u){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var f=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof u=="object"&&u!==null&&typeof u.message=="string"?String(u.message):String(u),error:u});if(!window.dispatchEvent(f))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",u);return}console.error(u)},VS=Error(r(461)),oi=!1,Uv={dehydrated:null,treeContext:null,retryLane:0},zd=_(null),Ho=null,Zs=null,NU=typeof AbortController<"u"?AbortController:function(){var u=[],f=this.signal={aborted:!1,addEventListener:function(y,M){u.push(M)}};this.abort=function(){f.aborted=!0,u.forEach(function(y){return y()})}},PU=cr.unstable_scheduleCallback,zU=cr.unstable_NormalPriority,Ln={$$typeof:za,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0},WS=wt.S;wt.S=function(u,f){typeof f=="object"&&f!==null&&typeof f.then=="function"&&me(u,f),WS!==null&&WS(u,f)};var Vo=_(null),Ks=!1,In=!1,Ov=!1,XS=typeof WeakSet=="function"?WeakSet:Set,li=null,jS=!1,jn=null,dr=!1,Zr=null,dc=8192,FU={getCacheForType:function(u){var f=Si(Ln),y=f.data.get(u);return y===void 0&&(y=u(),f.data.set(u,y)),y}},Fd=0,Bd=1,kd=2,Gd=3,Hd=4;if(typeof Symbol=="function"&&Symbol.for){var ah=Symbol.for;Fd=ah("selector.component"),Bd=ah("selector.has_pseudo_class"),kd=ah("selector.role"),Gd=ah("selector.test_id"),Hd=ah("selector.text")}var BU=typeof WeakMap=="function"?WeakMap:Map,cn=0,fn=null,Ft=null,Vt=0,dn=0,pr=null,Js=!1,pc=!1,Lv=!1,Qs=0,Nn=0,Wa=0,Wo=0,Iv=0,Rr=0,mc=0,oh=null,ms=null,Nv=!1,Pv=0,lh=1/0,Vd=null,Xa=null,Wd=!1,Xo=null,ch=0,zv=0,Fv=null,uh=0,Bv=null;return zt.attemptContinuousHydration=function(u){if(u.tag===13){var f=pe(u,67108864);f!==null&&Oi(f,u,67108864),sv(u,67108864)}},zt.attemptHydrationAtCurrentPriority=function(u){if(u.tag===13){var f=lr(),y=pe(u,f);y!==null&&Oi(y,u,f),sv(u,f)}},zt.attemptSynchronousHydration=function(u){switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var f=S(u.pendingLanes);if(f!==0){for(u.pendingLanes|=2,u.entangledLanes|=2;f;){var y=1<<31-ur(f);u.entanglements[1]|=y,f&=~y}be(u),(cn&6)===0&&(lh=qr()+500,ue(0))}}break;case 13:f=pe(u,2),f!==null&&Oi(f,u,2),Xb(),sv(u,2)}},zt.batchedUpdates=function(u,f){return u(f)},zt.createComponentSelector=function(u){return{$$typeof:Fd,value:u}},zt.createContainer=function(u,f,y,M,C,N,Z,le,we,Fe){return sS(u,f,!1,null,y,M,N,Z,le,we,Fe,null)},zt.createHasPseudoClassSelector=function(u){return{$$typeof:Bd,value:u}},zt.createHydrationContainer=function(u,f,y,M,C,N,Z,le,we,Fe,Ke,ct,ht){return u=sS(y,M,!0,u,C,N,le,we,Fe,Ke,ct,ht),u.context=aS(null),y=u.current,M=lr(),C=Le(M),C.callback=f??null,Be(y,C,M),u.current.lanes=M,L(u,M),be(u),u},zt.createPortal=function(u,f,y){var M=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Kl,key:M==null?null:""+M,children:u,containerInfo:f,implementation:y}},zt.createRoleSelector=function(u){return{$$typeof:kd,value:u}},zt.createTestNameSelector=function(u){return{$$typeof:Gd,value:u}},zt.createTextSelector=function(u){return{$$typeof:Hd,value:u}},zt.defaultOnCaughtError=function(u){console.error(u)},zt.defaultOnRecoverableError=function(u){HS(u)},zt.defaultOnUncaughtError=function(u){HS(u)},zt.deferredUpdates=function(u){var f=wt.T,y=No();try{return ji(32),wt.T=null,u()}finally{ji(y),wt.T=f}},zt.discreteUpdates=function(u,f,y,M,C){var N=wt.T,Z=No();try{return ji(2),wt.T=null,u(f,y,M,C)}finally{ji(Z),wt.T=N,cn===0&&(lh=qr()+500)}},zt.findAllNodes=K0,zt.findBoundingRects=function(u,f){if(!Qu)throw Error(r(363));f=K0(u,f),u=[];for(var y=0;y<f.length;y++)u.push(U3(f[y]));for(f=u.length-1;0<f;f--){y=u[f];for(var M=y.x,C=M+y.width,N=y.y,Z=N+y.height,le=f-1;0<=le;le--)if(f!==le){var we=u[le],Fe=we.x,Ke=Fe+we.width,ct=we.y,ht=ct+we.height;if(M>=Fe&&N>=ct&&C<=Ke&&Z<=ht){u.splice(f,1);break}else if(M!==Fe||y.width!==we.width||ht<N||ct>Z){if(!(N!==ct||y.height!==we.height||Ke<M||Fe>C)){Fe>M&&(we.width+=Fe-M,we.x=M),Ke<C&&(we.width=C-Fe),u.splice(f,1);break}}else{ct>N&&(we.height+=ct-N,we.y=N),ht<Z&&(we.height=Z-ct),u.splice(f,1);break}}}return u},zt.findHostInstance=oS,zt.findHostInstanceWithNoPortals=function(u){return u=m(u),u=u!==null?x(u):null,u===null?null:Ju(u.stateNode)},zt.findHostInstanceWithWarning=function(u){return oS(u)},zt.flushPassiveEffects=Lo,zt.flushSyncFromReconciler=function(u){var f=cn;cn|=1;var y=wt.T,M=No();try{if(ji(2),wt.T=null,u)return u()}finally{ji(M),wt.T=y,cn=f,(cn&6)===0&&ue(0)}},zt.flushSyncWork=Xb,zt.focusWithin=function(u,f){if(!Qu)throw Error(r(363));for(u=q0(u),f=Gb(u,f),f=Array.from(f),u=0;u<f.length;){var y=f[u++],M=y.tag;if(!$u(y)){if((M===5||M===26||M===27)&&I3(y.stateNode))return!0;for(y=y.child;y!==null;)f.push(y),y=y.sibling}}return!1},zt.getFindAllNodesFailureDescription=function(u,f){if(!Qu)throw Error(r(363));var y=0,M=[];u=[q0(u),0];for(var C=0;C<u.length;){var N=u[C++],Z=N.tag,le=u[C++],we=f[le];if((Z!==5&&Z!==26&&Z!==27||!$u(N))&&(Y0(N,we)&&(M.push(Z0(we)),le++,le>y&&(y=le)),le<f.length))for(N=N.child;N!==null;)u.push(N,le),N=N.sibling}if(y<f.length){for(u=[];y<f.length;y++)u.push(Z0(f[y]));return`findAllNodes was able to match part of the selector:
|
|
3840
3840
|
`+(M.join(" > ")+`
|
|
3841
3841
|
|
|
3842
3842
|
No matching component was found for:
|
|
3843
|
-
`)+u.join(" > ")}return null},zt.getPublicRootInstance=function(u){if(u=u.current,!u.child)return null;switch(u.child.tag){case 27:case 5:return Ju(u.child.stateNode);default:return u.child.stateNode}},zt.injectIntoDevTools=function(){var u={bundleType:0,version:h3,rendererPackageName:f3,currentDispatcherRef:wt,findFiberByHostInstance:yS,reconcilerVersion:"19.0.0"};if(mS!==null&&(u.rendererConfig=mS),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")u=!1;else{var f=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(f.isDisabled||!f.supportsFiber)u=!0;else{try{eh=f.inject(u),hr=f}catch{}u=!!f.checkDCE}}return u},zt.isAlreadyRendering=function(){return!1},zt.observeVisibleRects=function(u,f,y,M){if(!Qu)throw Error(r(363));u=K0(u,f);var C=N3(u,y,M).disconnect;return{disconnect:function(){C()}}},zt.shouldError=function(){return null},zt.shouldSuspend=function(){return!1},zt.startHostTransition=function(u,f,y,M){if(u.tag!==5)throw Error(r(476));var C=To(u).queue;zu(u,C,f,Ql,y===null?n:function(){var N=To(u).next.queue;return ks(u,N,{},lr()),y(M)})},zt.updateContainer=function(u,f,y,M){var C=f.current,N=lr();return lS(C,N,u,f,y,M),N},zt.updateContainerSync=function(u,f,y,M){return f.tag===0&&Lo(),lS(f.current,2,u,f,y,M),2},zt},i.exports.default=i.exports,Object.defineProperty(i.exports,"__esModule",{value:!0})})(Ny)),Ny.exports}var LM;function V4(){return LM||(LM=1,Iy.exports=H4()),Iy.exports}var W4=V4();const X4=mo(W4);var Fy={exports:{}},By={};var IM;function j4(){return IM||(IM=1,(function(i){function e(z,O){var B=z.length;z.push(O);e:for(;0<B;){var G=B-1>>>1,X=z[G];if(0<r(X,O))z[G]=O,z[B]=X,B=G;else break e}}function t(z){return z.length===0?null:z[0]}function n(z){if(z.length===0)return null;var O=z[0],B=z.pop();if(B!==O){z[0]=B;e:for(var G=0,X=z.length,k=X>>>1;G<k;){var Y=2*(G+1)-1,Q=z[Y],te=Y+1,ee=z[te];if(0>r(Q,B))te<X&&0>r(ee,Q)?(z[G]=ee,z[te]=B,G=te):(z[G]=Q,z[Y]=B,G=Y);else if(te<X&&0>r(ee,B))z[G]=ee,z[te]=B,G=te;else break e}}return O}function r(z,O){var B=z.sortIndex-O.sortIndex;return B!==0?B:z.id-O.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;i.unstable_now=function(){return s.now()}}else{var a=Date,o=a.now();i.unstable_now=function(){return a.now()-o}}var l=[],c=[],h=1,d=null,p=3,m=!1,v=!1,x=!1,_=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;function E(z){for(var O=t(c);O!==null;){if(O.callback===null)n(c);else if(O.startTime<=z)n(c),O.sortIndex=O.expirationTime,e(l,O);else break;O=t(c)}}function S(z){if(x=!1,E(z),!v)if(t(l)!==null)v=!0,V();else{var O=t(c);O!==null&&H(S,O.startTime-z)}}var w=!1,T=-1,R=5,U=-1;function A(){return!(i.unstable_now()-U<R)}function D(){if(w){var z=i.unstable_now();U=z;var O=!0;try{e:{v=!1,x&&(x=!1,g(T),T=-1),m=!0;var B=p;try{t:{for(E(z),d=t(l);d!==null&&!(d.expirationTime>z&&A());){var G=d.callback;if(typeof G=="function"){d.callback=null,p=d.priorityLevel;var X=G(d.expirationTime<=z);if(z=i.unstable_now(),typeof X=="function"){d.callback=X,E(z),O=!0;break t}d===t(l)&&n(l),E(z)}else n(l);d=t(l)}if(d!==null)O=!0;else{var k=t(c);k!==null&&H(S,k.startTime-z),O=!1}}break e}finally{d=null,p=B,m=!1}O=void 0}}finally{O?L():w=!1}}}var L;if(typeof b=="function")L=function(){b(D)};else if(typeof MessageChannel<"u"){var P=new MessageChannel,I=P.port2;P.port1.onmessage=D,L=function(){I.postMessage(null)}}else L=function(){_(D,0)};function V(){w||(w=!0,L())}function H(z,O){T=_(function(){z(i.unstable_now())},O)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(z){z.callback=null},i.unstable_continueExecution=function(){v||m||(v=!0,V())},i.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<z?Math.floor(1e3/z):5},i.unstable_getCurrentPriorityLevel=function(){return p},i.unstable_getFirstCallbackNode=function(){return t(l)},i.unstable_next=function(z){switch(p){case 1:case 2:case 3:var O=3;break;default:O=p}var B=p;p=O;try{return z()}finally{p=B}},i.unstable_pauseExecution=function(){},i.unstable_requestPaint=function(){},i.unstable_runWithPriority=function(z,O){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var B=p;p=z;try{return O()}finally{p=B}},i.unstable_scheduleCallback=function(z,O,B){var G=i.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?G+B:G):B=G,z){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=B+X,z={id:h++,callback:O,priorityLevel:z,startTime:B,expirationTime:X,sortIndex:-1},B>G?(z.sortIndex=B,e(c,z),t(l)===null&&z===t(c)&&(x?(g(T),T=-1):x=!0,H(S,B-G))):(z.sortIndex=X,e(l,z),v||m||(v=!0,V())),z},i.unstable_shouldYield=A,i.unstable_wrapCallback=function(z){var O=p;return function(){var B=p;p=O;try{return z.apply(this,arguments)}finally{p=B}}}})(By)),By}var NM;function q4(){return NM||(NM=1,Fy.exports=j4()),Fy.exports}var PM=q4();function T1(i,e,t){if(!i)return;if(t(i)===!0)return i;let n=e?i.return:i.child;for(;n;){const r=T1(n,e,t);if(r)return r;n=e?null:n.sibling}}function bC(i){try{return Object.defineProperties(i,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return i}}const A1=bC(K.createContext(null));let SC=class extends K.Component{render(){return K.createElement(A1.Provider,{value:this._reactInternals},this.props.children)}};function EC(){const i=K.useContext(A1);if(i===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=K.useId();return K.useMemo(()=>{for(const t of[i,i?.alternate]){if(!t)continue;const n=T1(t,!1,r=>{let s=r.memoizedState;for(;s;){if(s.memoizedState===e)return!0;s=s.next}});if(n)return n}},[i,e])}const Y4=Symbol.for("react.context"),Z4=i=>i!==null&&typeof i=="object"&&"$$typeof"in i&&i.$$typeof===Y4;function K4(){const i=EC(),[e]=K.useState(()=>new Map);e.clear();let t=i;for(;t;){const n=t.type;Z4(n)&&n!==A1&&!e.has(n)&&e.set(n,K.use(bC(n))),t=t.return}return e}function J4(){const i=K4();return K.useMemo(()=>Array.from(i.keys()).reduce((e,t)=>n=>K.createElement(e,null,K.createElement(t.Provider,{...n,value:i.get(t)})),e=>K.createElement(SC,{...e})),[i])}function MC(i){let e=i.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const wC=i=>i&&i.isOrthographicCamera,Q4=i=>i&&i.hasOwnProperty("current"),$4=i=>i!=null&&(typeof i=="string"||typeof i=="number"||i.isColor),rd=((i,e)=>typeof window<"u"&&(((i=window.document)==null?void 0:i.createElement)||((e=window.navigator)==null?void 0:e.product)==="ReactNative"))()?K.useLayoutEffect:K.useEffect;function TC(i){const e=K.useRef(i);return rd(()=>void(e.current=i),[i]),e}function e5(){const i=EC(),e=J4();return K.useMemo(()=>({children:t})=>{const r=!!T1(i,!0,s=>s.type===K.StrictMode)?K.StrictMode:K.Fragment;return he.jsx(r,{children:he.jsx(e,{children:t})})},[i,e])}function t5({set:i}){return rd(()=>(i(new Promise(()=>null)),()=>i(!1)),[i]),null}const n5=(i=>(i=class extends K.Component{constructor(...t){super(...t),this.state={error:!1}}componentDidCatch(t){this.props.set(t)}render(){return this.state.error?null:this.props.children}},i.getDerivedStateFromError=()=>({error:!0}),i))();function AC(i){var e;const t=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(i)?Math.min(Math.max(i[0],t),i[1]):i}function zc(i){var e;return(e=i.__r3f)==null?void 0:e.root.getState()}const wn={obj:i=>i===Object(i)&&!wn.arr(i)&&typeof i!="function",fun:i=>typeof i=="function",str:i=>typeof i=="string",num:i=>typeof i=="number",boo:i=>typeof i=="boolean",und:i=>i===void 0,nul:i=>i===null,arr:i=>Array.isArray(i),equ(i,e,{arrays:t="shallow",objects:n="reference",strict:r=!0}={}){if(typeof i!=typeof e||!!i!=!!e)return!1;if(wn.str(i)||wn.num(i)||wn.boo(i))return i===e;const s=wn.obj(i);if(s&&n==="reference")return i===e;const a=wn.arr(i);if(a&&t==="reference")return i===e;if((a||s)&&i===e)return!0;let o;for(o in i)if(!(o in e))return!1;if(s&&t==="shallow"&&n==="shallow"){for(o in r?e:i)if(!wn.equ(i[o],e[o],{strict:r,objects:"reference"}))return!1}else for(o in r?e:i)if(i[o]!==e[o])return!1;if(wn.und(o)){if(a&&i.length===0&&e.length===0||s&&Object.keys(i).length===0&&Object.keys(e).length===0)return!0;if(i!==e)return!1}return!0}};function i5(i){i.type!=="Scene"&&(i.dispose==null||i.dispose());for(const e in i){const t=i[e];t?.type!=="Scene"&&(t==null||t.dispose==null||t.dispose())}}const CC=["children","key","ref"];function r5(i){const e={};for(const t in i)CC.includes(t)||(e[t]=i[t]);return e}function ag(i,e,t,n){const r=i;let s=r?.__r3f;return s||(s={root:e,type:t,parent:null,children:[],props:r5(n),object:r,eventCount:0,handlers:{},isHidden:!1},r&&(r.__r3f=s)),s}function Pf(i,e){let t=i[e];if(!e.includes("-"))return{root:i,key:e,target:t};t=i;for(const r of e.split("-")){var n;e=r,i=t,t=(n=t)==null?void 0:n[e]}return{root:i,key:e,target:t}}const zM=/-\d+$/;function og(i,e){if(wn.str(e.props.attach)){if(zM.test(e.props.attach)){const r=e.props.attach.replace(zM,""),{root:s,key:a}=Pf(i.object,r);Array.isArray(s[a])||(s[a]=[])}const{root:t,key:n}=Pf(i.object,e.props.attach);e.previousAttach=t[n],t[n]=e.object}else wn.fun(e.props.attach)&&(e.previousAttach=e.props.attach(i.object,e.object))}function lg(i,e){if(wn.str(e.props.attach)){const{root:t,key:n}=Pf(i.object,e.props.attach),r=e.previousAttach;r===void 0?delete t[n]:t[n]=r}else e.previousAttach==null||e.previousAttach(i.object,e.object);delete e.previousAttach}const rx=[...CC,"args","dispose","attach","object","onUpdate","dispose"],FM=new Map;function s5(i){let e=FM.get(i.constructor);try{e||(e=new i.constructor,FM.set(i.constructor,e))}catch{}return e}function a5(i,e){const t={};for(const n in e)if(!rx.includes(n)&&!wn.equ(e[n],i.props[n])){t[n]=e[n];for(const r in e)r.startsWith(`${n}-`)&&(t[r]=e[r])}for(const n in i.props){if(rx.includes(n)||e.hasOwnProperty(n))continue;const{root:r,key:s}=Pf(i.object,n);if(r.constructor&&r.constructor.length===0){const a=s5(r);wn.und(a)||(t[s]=a[s])}else t[s]=0}return t}const o5=["map","emissiveMap","sheenColorMap","specularColorMap","envMap"],l5=/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/;function pa(i,e){var t;const n=i.__r3f,r=n&&MC(n).getState(),s=n?.eventCount;for(const o in e){let l=e[o];if(rx.includes(o))continue;if(n&&l5.test(o)){typeof l=="function"?n.handlers[o]=l:delete n.handlers[o],n.eventCount=Object.keys(n.handlers).length;continue}if(l===void 0)continue;let{root:c,key:h,target:d}=Pf(i,o);if(d instanceof pu&&l instanceof pu)d.mask=l.mask;else if(d instanceof Ye&&$4(l))d.set(l);else if(d!==null&&typeof d=="object"&&typeof d.set=="function"&&typeof d.copy=="function"&&l!=null&&l.constructor&&d.constructor===l.constructor)d.copy(l);else if(d!==null&&typeof d=="object"&&typeof d.set=="function"&&Array.isArray(l))typeof d.fromArray=="function"?d.fromArray(l):d.set(...l);else if(d!==null&&typeof d=="object"&&typeof d.set=="function"&&typeof l=="number")typeof d.setScalar=="function"?d.setScalar(l):d.set(l);else{var a;c[h]=l,r&&!r.linear&&o5.includes(h)&&(a=c[h])!=null&&a.isTexture&&c[h].format===Di&&c[h].type===Gr&&(c[h].colorSpace=Ri)}}if(n!=null&&n.parent&&r!=null&&r.internal&&(t=n.object)!=null&&t.isObject3D&&s!==n.eventCount){const o=n.object,l=r.internal.interaction.indexOf(o);l>-1&&r.internal.interaction.splice(l,1),n.eventCount&&o.raycast!==null&&r.internal.interaction.push(o)}return n&&n.props.attach===void 0&&(n.object.isBufferGeometry?n.props.attach="geometry":n.object.isMaterial&&(n.props.attach="material")),n&&Du(n),i}function Du(i){var e;if(!i.parent)return;i.props.onUpdate==null||i.props.onUpdate(i.object);const t=(e=i.root)==null||e.getState==null?void 0:e.getState();t&&t.internal.frames===0&&t.invalidate()}function c5(i,e){i.manual||(wC(i)?(i.left=e.width/-2,i.right=e.width/2,i.top=e.height/2,i.bottom=e.height/-2):i.aspect=e.width/e.height,i.updateProjectionMatrix())}const Ki=i=>i?.isObject3D;function zp(i){return(i.eventObject||i.object).uuid+"/"+i.index+i.instanceId}function RC(i,e,t,n){const r=t.get(e);r&&(t.delete(e),t.size===0&&(i.delete(n),r.target.releasePointerCapture(n)))}function u5(i,e){const{internal:t}=i.getState();t.interaction=t.interaction.filter(n=>n!==e),t.initialHits=t.initialHits.filter(n=>n!==e),t.hovered.forEach((n,r)=>{(n.eventObject===e||n.object===e)&&t.hovered.delete(r)}),t.capturedMap.forEach((n,r)=>{RC(t.capturedMap,e,n,r)})}function h5(i){function e(l){const{internal:c}=i.getState(),h=l.offsetX-c.initialClick[0],d=l.offsetY-c.initialClick[1];return Math.round(Math.sqrt(h*h+d*d))}function t(l){return l.filter(c=>["Move","Over","Enter","Out","Leave"].some(h=>{var d;return(d=c.__r3f)==null?void 0:d.handlers["onPointer"+h]}))}function n(l,c){const h=i.getState(),d=new Set,p=[],m=c?c(h.internal.interaction):h.internal.interaction;for(let g=0;g<m.length;g++){const b=zc(m[g]);b&&(b.raycaster.camera=void 0)}h.previousRoot||h.events.compute==null||h.events.compute(l,h);function v(g){const b=zc(g);if(!b||!b.events.enabled||b.raycaster.camera===null)return[];if(b.raycaster.camera===void 0){var E;b.events.compute==null||b.events.compute(l,b,(E=b.previousRoot)==null?void 0:E.getState()),b.raycaster.camera===void 0&&(b.raycaster.camera=null)}return b.raycaster.camera?b.raycaster.intersectObject(g,!0):[]}let x=m.flatMap(v).sort((g,b)=>{const E=zc(g.object),S=zc(b.object);return!E||!S?g.distance-b.distance:S.events.priority-E.events.priority||g.distance-b.distance}).filter(g=>{const b=zp(g);return d.has(b)?!1:(d.add(b),!0)});h.events.filter&&(x=h.events.filter(x,h));for(const g of x){let b=g.object;for(;b;){var _;(_=b.__r3f)!=null&&_.eventCount&&p.push({...g,eventObject:b}),b=b.parent}}if("pointerId"in l&&h.internal.capturedMap.has(l.pointerId))for(let g of h.internal.capturedMap.get(l.pointerId).values())d.has(zp(g.intersection))||p.push(g.intersection);return p}function r(l,c,h,d){if(l.length){const p={stopped:!1};for(const m of l){let v=zc(m.object);if(v||m.object.traverseAncestors(x=>{const _=zc(x);if(_)return v=_,!1}),v){const{raycaster:x,pointer:_,camera:g,internal:b}=v,E=new j(_.x,_.y,0).unproject(g),S=A=>{var D,L;return(D=(L=b.capturedMap.get(A))==null?void 0:L.has(m.eventObject))!=null?D:!1},w=A=>{const D={intersection:m,target:c.target};b.capturedMap.has(A)?b.capturedMap.get(A).set(m.eventObject,D):b.capturedMap.set(A,new Map([[m.eventObject,D]])),c.target.setPointerCapture(A)},T=A=>{const D=b.capturedMap.get(A);D&&RC(b.capturedMap,m.eventObject,D,A)};let R={};for(let A in c){let D=c[A];typeof D!="function"&&(R[A]=D)}let U={...m,...R,pointer:_,intersections:l,stopped:p.stopped,delta:h,unprojectedPoint:E,ray:x.ray,camera:g,stopPropagation(){const A="pointerId"in c&&b.capturedMap.get(c.pointerId);if((!A||A.has(m.eventObject))&&(U.stopped=p.stopped=!0,b.hovered.size&&Array.from(b.hovered.values()).find(D=>D.eventObject===m.eventObject))){const D=l.slice(0,l.indexOf(m));s([...D,m])}},target:{hasPointerCapture:S,setPointerCapture:w,releasePointerCapture:T},currentTarget:{hasPointerCapture:S,setPointerCapture:w,releasePointerCapture:T},nativeEvent:c};if(d(U),p.stopped===!0)break}}}return l}function s(l){const{internal:c}=i.getState();for(const h of c.hovered.values())if(!l.length||!l.find(d=>d.object===h.object&&d.index===h.index&&d.instanceId===h.instanceId)){const p=h.eventObject.__r3f;if(c.hovered.delete(zp(h)),p!=null&&p.eventCount){const m=p.handlers,v={...h,intersections:l};m.onPointerOut==null||m.onPointerOut(v),m.onPointerLeave==null||m.onPointerLeave(v)}}}function a(l,c){for(let h=0;h<c.length;h++){const d=c[h].__r3f;d==null||d.handlers.onPointerMissed==null||d.handlers.onPointerMissed(l)}}function o(l){switch(l){case"onPointerLeave":case"onPointerCancel":return()=>s([]);case"onLostPointerCapture":return c=>{const{internal:h}=i.getState();"pointerId"in c&&h.capturedMap.has(c.pointerId)&&requestAnimationFrame(()=>{h.capturedMap.has(c.pointerId)&&(h.capturedMap.delete(c.pointerId),s([]))})}}return function(h){const{onPointerMissed:d,internal:p}=i.getState();p.lastEvent.current=h;const m=l==="onPointerMove",v=l==="onClick"||l==="onContextMenu"||l==="onDoubleClick",_=n(h,m?t:void 0),g=v?e(h):0;l==="onPointerDown"&&(p.initialClick=[h.offsetX,h.offsetY],p.initialHits=_.map(E=>E.eventObject)),v&&!_.length&&g<=2&&(a(h,p.interaction),d&&d(h)),m&&s(_);function b(E){const S=E.eventObject,w=S.__r3f;if(!(w!=null&&w.eventCount))return;const T=w.handlers;if(m){if(T.onPointerOver||T.onPointerEnter||T.onPointerOut||T.onPointerLeave){const R=zp(E),U=p.hovered.get(R);U?U.stopped&&E.stopPropagation():(p.hovered.set(R,E),T.onPointerOver==null||T.onPointerOver(E),T.onPointerEnter==null||T.onPointerEnter(E))}T.onPointerMove==null||T.onPointerMove(E)}else{const R=T[l];R?(!v||p.initialHits.includes(S))&&(a(h,p.interaction.filter(U=>!p.initialHits.includes(U))),R(E)):v&&p.initialHits.includes(S)&&a(h,p.interaction.filter(U=>!p.initialHits.includes(U)))}}r(_,h,g,b)}}return{handlePointer:o}}const BM=i=>!!(i!=null&&i.render),DC=K.createContext(null),f5=(i,e)=>{const t=N4((o,l)=>{const c=new j,h=new j,d=new j;function p(g=l().camera,b=h,E=l().size){const{width:S,height:w,top:T,left:R}=E,U=S/w;b.isVector3?d.copy(b):d.set(...b);const A=g.getWorldPosition(c).distanceTo(d);if(wC(g))return{width:S/g.zoom,height:w/g.zoom,top:T,left:R,factor:1,distance:A,aspect:U};{const D=g.fov*Math.PI/180,L=2*Math.tan(D/2)*A,P=L*(S/w);return{width:P,height:L,top:T,left:R,factor:S/P,distance:A,aspect:U}}}let m;const v=g=>o(b=>({performance:{...b.performance,current:g}})),x=new ke;return{set:o,get:l,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},scene:null,xr:null,invalidate:(g=1)=>i(l(),g),advance:(g,b)=>e(g,b,l()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new _1,pointer:x,mouse:x,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const g=l();m&&clearTimeout(m),g.performance.current!==g.performance.min&&v(g.performance.min),m=setTimeout(()=>v(l().performance.max),g.performance.debounce)}},size:{width:0,height:0,top:0,left:0},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:p},setEvents:g=>o(b=>({...b,events:{...b.events,...g}})),setSize:(g,b,E=0,S=0)=>{const w=l().camera,T={width:g,height:b,top:E,left:S};o(R=>({size:T,viewport:{...R.viewport,...p(w,h,T)}}))},setDpr:g=>o(b=>{const E=AC(g);return{viewport:{...b.viewport,dpr:E,initialDpr:b.viewport.initialDpr||E}}}),setFrameloop:(g="always")=>{const b=l().clock;b.stop(),b.elapsedTime=0,g!=="never"&&(b.start(),b.elapsedTime=0),o(()=>({frameloop:g}))},previousRoot:void 0,internal:{interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,lastEvent:K.createRef(),active:!1,frames:0,priority:0,subscribe:(g,b,E)=>{const S=l().internal;return S.priority=S.priority+(b>0?1:0),S.subscribers.push({ref:g,priority:b,store:E}),S.subscribers=S.subscribers.sort((w,T)=>w.priority-T.priority),()=>{const w=l().internal;w!=null&&w.subscribers&&(w.priority=w.priority-(b>0?1:0),w.subscribers=w.subscribers.filter(T=>T.ref!==g))}}}}}),n=t.getState();let r=n.size,s=n.viewport.dpr,a=n.camera;return t.subscribe(()=>{const{camera:o,size:l,viewport:c,gl:h,set:d}=t.getState();if(l.width!==r.width||l.height!==r.height||c.dpr!==s){r=l,s=c.dpr,c5(o,l),c.dpr>0&&h.setPixelRatio(c.dpr);const p=typeof HTMLCanvasElement<"u"&&h.domElement instanceof HTMLCanvasElement;h.setSize(l.width,l.height,p)}o!==a&&(a=o,d(p=>({viewport:{...p.viewport,...p.viewport.getCurrentViewport(o)}})))}),t.subscribe(o=>i(o)),t};function UC(){const i=K.useContext(DC);if(!i)throw new Error("R3F: Hooks can only be used within the Canvas component!");return i}function Jn(i=t=>t,e){return UC()(i,e)}function u0(i,e=0){const t=UC(),n=t.getState().internal.subscribe,r=TC(i);return rd(()=>n(r,e,t),[e,n,t]),null}function d5(i){const e=X4(i);return e.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:K.version}),e}const OC=0,vu={},p5=/^three(?=[A-Z])/,h0=i=>`${i[0].toUpperCase()}${i.slice(1)}`;let m5=0;const g5=i=>typeof i=="function";function LC(i){if(g5(i)){const e=`${m5++}`;return vu[e]=i,e}else Object.assign(vu,i)}function IC(i,e){const t=h0(i),n=vu[t];if(i!=="primitive"&&!n)throw new Error(`R3F: ${t} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(i==="primitive"&&!e.object)throw new Error("R3F: Primitives without 'object' are invalid!");if(e.args!==void 0&&!Array.isArray(e.args))throw new Error("R3F: The args prop must be an array!")}function v5(i,e,t){var n;return i=h0(i)in vu?i:i.replace(p5,""),IC(i,e),i==="primitive"&&(n=e.object)!=null&&n.__r3f&&delete e.object.__r3f,ag(e.object,t,i,e)}function y5(i){if(!i.isHidden){var e;i.props.attach&&(e=i.parent)!=null&&e.object?lg(i.parent,i):Ki(i.object)&&(i.object.visible=!1),i.isHidden=!0,Du(i)}}function NC(i){if(i.isHidden){var e;i.props.attach&&(e=i.parent)!=null&&e.object?og(i.parent,i):Ki(i.object)&&i.props.visible!==!1&&(i.object.visible=!0),i.isHidden=!1,Du(i)}}function C1(i,e,t){const n=e.root.getState();if(!(!i.parent&&i.object!==n.scene)){if(!e.object){var r,s;const a=vu[h0(e.type)];e.object=(r=e.props.object)!=null?r:new a(...(s=e.props.args)!=null?s:[]),e.object.__r3f=e}if(pa(e.object,e.props),e.props.attach)og(i,e);else if(Ki(e.object)&&Ki(i.object)){const a=i.object.children.indexOf(t?.object);if(t&&a!==-1){const o=i.object.children.indexOf(e.object);if(o!==-1){i.object.children.splice(o,1);const l=o<a?a-1:a;i.object.children.splice(l,0,e.object)}else e.object.parent=i.object,i.object.children.splice(a,0,e.object),e.object.dispatchEvent({type:"added"}),i.object.dispatchEvent({type:"childadded",child:e.object})}else i.object.add(e.object)}for(const a of e.children)C1(e,a);Du(e)}}function ky(i,e){e&&(e.parent=i,i.children.push(e),C1(i,e))}function kM(i,e,t){if(!e||!t)return;e.parent=i;const n=i.children.indexOf(t);n!==-1?i.children.splice(n,0,e):i.children.push(e),C1(i,e,t)}function PC(i){if(typeof i.dispose=="function"){const e=()=>{try{i.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT<"u"?e():PM.unstable_scheduleCallback(PM.unstable_IdlePriority,e)}}function sx(i,e,t){if(!e)return;e.parent=null;const n=i.children.indexOf(e);n!==-1&&i.children.splice(n,1),e.props.attach?lg(i,e):Ki(e.object)&&Ki(i.object)&&(i.object.remove(e.object),u5(MC(e),e.object));const r=e.props.dispose!==null&&t!==!1;for(let s=e.children.length-1;s>=0;s--){const a=e.children[s];sx(e,a,r)}e.children.length=0,delete e.object.__r3f,r&&e.type!=="primitive"&&e.object.type!=="Scene"&&PC(e.object),t===void 0&&Du(e)}function _5(i,e){for(const t of[i,i.alternate])if(t!==null)if(typeof t.ref=="function"){t.refCleanup==null||t.refCleanup();const n=t.ref(e);typeof n=="function"&&(t.refCleanup=n)}else t.ref&&(t.ref.current=e)}const lm=[];function x5(){for(const[t]of lm){const n=t.parent;if(n){t.props.attach?lg(n,t):Ki(t.object)&&Ki(n.object)&&n.object.remove(t.object);for(const r of t.children)r.props.attach?lg(t,r):Ki(r.object)&&Ki(t.object)&&t.object.remove(r.object)}t.isHidden&&NC(t),t.object.__r3f&&delete t.object.__r3f,t.type!=="primitive"&&PC(t.object)}for(const[t,n,r]of lm){t.props=n;const s=t.parent;if(s){var i,e;const a=vu[h0(t.type)];t.object=(i=t.props.object)!=null?i:new a(...(e=t.props.args)!=null?e:[]),t.object.__r3f=t,_5(r,t.object),pa(t.object,t.props),t.props.attach?og(s,t):Ki(t.object)&&Ki(s.object)&&s.object.add(t.object);for(const o of t.children)o.props.attach?og(t,o):Ki(o.object)&&Ki(t.object)&&t.object.add(o.object);Du(t)}}lm.length=0}const Gy=()=>{},GM={};let Fp=OC;const b5=0,S5=4,ax=d5({isPrimaryRenderer:!1,warnsIfNotActing:!1,supportsMutation:!0,supportsPersistence:!1,supportsHydration:!1,createInstance:v5,removeChild:sx,appendChild:ky,appendInitialChild:ky,insertBefore:kM,appendChildToContainer(i,e){const t=i.getState().scene.__r3f;!e||!t||ky(t,e)},removeChildFromContainer(i,e){const t=i.getState().scene.__r3f;!e||!t||sx(t,e)},insertInContainerBefore(i,e,t){const n=i.getState().scene.__r3f;!e||!t||!n||kM(n,e,t)},getRootHostContext:()=>GM,getChildHostContext:()=>GM,commitUpdate(i,e,t,n,r){var s,a,o;IC(e,n);let l=!1;if((i.type==="primitive"&&t.object!==n.object||((s=n.args)==null?void 0:s.length)!==((a=t.args)==null?void 0:a.length)||(o=n.args)!=null&&o.some((h,d)=>{var p;return h!==((p=t.args)==null?void 0:p[d])}))&&(l=!0),l)lm.push([i,{...n},r]);else{const h=a5(i,n);Object.keys(h).length&&(Object.assign(i.props,h),pa(i.object,h))}(r.sibling===null||(r.flags&S5)===b5)&&x5()},finalizeInitialChildren:()=>!1,commitMount(){},getPublicInstance:i=>i?.object,prepareForCommit:()=>null,preparePortalMount:i=>ag(i.getState().scene,i,"",{}),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance:y5,unhideInstance:NC,createTextInstance:Gy,hideTextInstance:Gy,unhideTextInstance:Gy,scheduleTimeout:typeof setTimeout=="function"?setTimeout:void 0,cancelTimeout:typeof clearTimeout=="function"?clearTimeout:void 0,noTimeout:-1,getInstanceFromNode:()=>null,beforeActiveInstanceBlur(){},afterActiveInstanceBlur(){},detachDeletedInstance(){},prepareScopeUpdate(){},getInstanceFromScope:()=>null,shouldAttemptEagerTransition:()=>!1,trackSchedulerEvent:()=>{},resolveEventType:()=>null,resolveEventTimeStamp:()=>-1.1,requestPostPaintCallback(){},maySuspendCommit:()=>!1,preloadInstance:()=>!0,startSuspendingCommit(){},suspendInstance(){},waitForCommitToBeReady:()=>null,NotPendingTransition:null,HostTransitionContext:K.createContext(null),setCurrentUpdatePriority(i){Fp=i},getCurrentUpdatePriority(){return Fp},resolveUpdatePriority(){var i;if(Fp!==OC)return Fp;switch(typeof window<"u"&&((i=window.event)==null?void 0:i.type)){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return rm.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return rm.ContinuousEventPriority;default:return rm.DefaultEventPriority}},resetFormInstance(){}}),Dl=new Map,Fc={objects:"shallow",strict:!1};function E5(i,e){if(!e&&typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement&&i.parentElement){const{width:t,height:n,top:r,left:s}=i.parentElement.getBoundingClientRect();return{width:t,height:n,top:r,left:s}}else if(!e&&typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas)return{width:i.width,height:i.height,top:0,left:0};return{width:0,height:0,top:0,left:0,...e}}function M5(i){const e=Dl.get(i),t=e?.fiber,n=e?.store;e&&console.warn("R3F.createRoot should only be called once!");const r=typeof reportError=="function"?reportError:console.error,s=n||f5(cx,VM),a=t||ax.createContainer(s,rm.ConcurrentRoot,null,!1,null,"",r,r,r,null);e||Dl.set(i,{fiber:a,store:s});let o,l,c=!1,h=null;return{async configure(d={}){let p;h=new Promise(k=>p=k);let{gl:m,size:v,scene:x,events:_,onCreated:g,shadows:b=!1,linear:E=!1,flat:S=!1,legacy:w=!1,orthographic:T=!1,frameloop:R="always",dpr:U=[1,2],performance:A,raycaster:D,camera:L,onPointerMissed:P}=d,I=s.getState(),V=I.gl;if(!I.gl){const k={canvas:i,powerPreference:"high-performance",antialias:!0,alpha:!0},Y=typeof m=="function"?await m(k):m;BM(Y)?V=Y:V=new _C({...k,...m}),I.set({gl:V})}let H=I.raycaster;H||I.set({raycaster:H=new E1});const{params:z,...O}=D||{};if(wn.equ(O,H,Fc)||pa(H,{...O}),wn.equ(z,H.params,Fc)||pa(H,{params:{...H.params,...z}}),!I.camera||I.camera===l&&!wn.equ(l,L,Fc)){l=L;const k=L?.isCamera,Y=k?L:T?new Pl(0,0,0,0,.1,1e3):new Kn(75,0,.1,1e3);k||(Y.position.z=5,L&&(pa(Y,L),Y.manual||("aspect"in L||"left"in L||"right"in L||"bottom"in L||"top"in L)&&(Y.manual=!0,Y.updateProjectionMatrix())),!I.camera&&!(L!=null&&L.rotation)&&Y.lookAt(0,0,0)),I.set({camera:Y}),H.camera=Y}if(!I.scene){let k;x!=null&&x.isScene?(k=x,ag(k,s,"",{})):(k=new Gg,ag(k,s,"",{}),x&&pa(k,x)),I.set({scene:k})}_&&!I.events.handlers&&I.set({events:_(s)});const B=E5(i,v);if(wn.equ(B,I.size,Fc)||I.setSize(B.width,B.height,B.top,B.left),U&&I.viewport.dpr!==AC(U)&&I.setDpr(U),I.frameloop!==R&&I.setFrameloop(R),I.onPointerMissed||I.set({onPointerMissed:P}),A&&!wn.equ(A,I.performance,Fc)&&I.set(k=>({performance:{...k.performance,...A}})),!I.xr){var G;const k=(te,ee)=>{const ie=s.getState();ie.frameloop!=="never"&&VM(te,!0,ie,ee)},Y=()=>{const te=s.getState();te.gl.xr.enabled=te.gl.xr.isPresenting,te.gl.xr.setAnimationLoop(te.gl.xr.isPresenting?k:null),te.gl.xr.isPresenting||cx(te)},Q={connect(){const te=s.getState().gl;te.xr.addEventListener("sessionstart",Y),te.xr.addEventListener("sessionend",Y)},disconnect(){const te=s.getState().gl;te.xr.removeEventListener("sessionstart",Y),te.xr.removeEventListener("sessionend",Y)}};typeof((G=V.xr)==null?void 0:G.addEventListener)=="function"&&Q.connect(),I.set({xr:Q})}if(V.shadowMap){const k=V.shadowMap.enabled,Y=V.shadowMap.type;if(V.shadowMap.enabled=!!b,wn.boo(b))V.shadowMap.type=nf;else if(wn.str(b)){var X;const Q={basic:wA,percentage:Ag,soft:nf,variance:is};V.shadowMap.type=(X=Q[b])!=null?X:nf}else wn.obj(b)&&Object.assign(V.shadowMap,b);(k!==V.shadowMap.enabled||Y!==V.shadowMap.type)&&(V.shadowMap.needsUpdate=!0)}return Gt.enabled=!w,c||(V.outputColorSpace=E?ho:Ri,V.toneMapping=S?As:zx),I.legacy!==w&&I.set(()=>({legacy:w})),I.linear!==E&&I.set(()=>({linear:E})),I.flat!==S&&I.set(()=>({flat:S})),m&&!wn.fun(m)&&!BM(m)&&!wn.equ(m,V,Fc)&&pa(V,m),o=g,c=!0,p(),this},render(d){return!c&&!h&&this.configure(),h.then(()=>{ax.updateContainer(he.jsx(w5,{store:s,children:d,onCreated:o,rootElement:i}),a,null,()=>{})}),s},unmount(){zC(i)}}}function w5({store:i,children:e,onCreated:t,rootElement:n}){return rd(()=>{const r=i.getState();r.set(s=>({internal:{...s.internal,active:!0}})),t&&t(r),i.getState().events.connected||r.events.connect==null||r.events.connect(n)},[]),he.jsx(DC.Provider,{value:i,children:e})}function zC(i,e){const t=Dl.get(i),n=t?.fiber;if(n){const r=t?.store.getState();r&&(r.internal.active=!1),ax.updateContainer(null,n,null,()=>{r&&setTimeout(()=>{try{var s,a,o,l;r.events.disconnect==null||r.events.disconnect(),(s=r.gl)==null||(a=s.renderLists)==null||a.dispose==null||a.dispose(),(o=r.gl)==null||o.forceContextLoss==null||o.forceContextLoss(),(l=r.gl)!=null&&l.xr&&r.xr.disconnect(),i5(r.scene),Dl.delete(i)}catch{}},500)})}}function T5(i,e){const t={callback:i};return e.add(t),()=>void e.delete(t)}const FC=new Set,A5=new Set,C5=new Set,R5=i=>T5(i,FC);function Hy(i,e){if(i.size)for(const{callback:t}of i.values())t(e)}function ff(i,e){switch(i){case"before":return Hy(FC,e);case"after":return Hy(A5,e);case"tail":return Hy(C5,e)}}let Vy,Wy;function ox(i,e,t){let n=e.clock.getDelta();e.frameloop==="never"&&typeof i=="number"&&(n=i-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=i),Vy=e.internal.subscribers;for(let r=0;r<Vy.length;r++)Wy=Vy[r],Wy.ref.current(Wy.store.getState(),n,t);return!e.internal.priority&&e.gl.render&&e.gl.render(e.scene,e.camera),e.internal.frames=Math.max(0,e.internal.frames-1),e.frameloop==="always"?1:e.internal.frames}let cg=!1,lx=!1,Xy,HM,Bc;function BC(i){HM=requestAnimationFrame(BC),cg=!0,Xy=0,ff("before",i),lx=!0;for(const t of Dl.values()){var e;Bc=t.store.getState(),Bc.internal.active&&(Bc.frameloop==="always"||Bc.internal.frames>0)&&!((e=Bc.gl.xr)!=null&&e.isPresenting)&&(Xy+=ox(i,Bc))}if(lx=!1,ff("after",i),Xy===0)return ff("tail",i),cg=!1,cancelAnimationFrame(HM)}function cx(i,e=1){var t;if(!i)return Dl.forEach(n=>cx(n.store.getState(),e));(t=i.gl.xr)!=null&&t.isPresenting||!i.internal.active||i.frameloop==="never"||(e>1?i.internal.frames=Math.min(60,i.internal.frames+e):lx?i.internal.frames=2:i.internal.frames=1,cg||(cg=!0,requestAnimationFrame(BC)))}function VM(i,e=!0,t,n){if(e&&ff("before",i),t)ox(i,t,n);else for(const r of Dl.values())ox(i,r.store.getState());e&&ff("after",i)}const jy={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function D5(i){const{handlePointer:e}=h5(i);return{priority:1,enabled:!0,compute(t,n,r){n.pointer.set(t.offsetX/n.size.width*2-1,-(t.offsetY/n.size.height)*2+1),n.raycaster.setFromCamera(n.pointer,n.camera)},connected:void 0,handlers:Object.keys(jy).reduce((t,n)=>({...t,[n]:e(n)}),{}),update:()=>{var t;const{events:n,internal:r}=i.getState();(t=r.lastEvent)!=null&&t.current&&n.handlers&&n.handlers.onPointerMove(r.lastEvent.current)},connect:t=>{const{set:n,events:r}=i.getState();if(r.disconnect==null||r.disconnect(),n(s=>({events:{...s.events,connected:t}})),r.handlers)for(const s in r.handlers){const a=r.handlers[s],[o,l]=jy[s];t.addEventListener(o,a,{passive:l})}},disconnect:()=>{const{set:t,events:n}=i.getState();if(n.connected){if(n.handlers)for(const r in n.handlers){const s=n.handlers[r],[a]=jy[r];n.connected.removeEventListener(a,s)}t(r=>({events:{...r.events,connected:void 0}}))}}}}function WM(i,e){let t;return(...n)=>{window.clearTimeout(t),t=window.setTimeout(()=>i(...n),e)}}function U5({debounce:i,scroll:e,polyfill:t,offsetSize:n}={debounce:0,scroll:!1,offsetSize:!1}){const r=t||(typeof window>"u"?class{}:window.ResizeObserver);if(!r)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[s,a]=K.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),o=K.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:s,orientationHandler:null}),l=i?typeof i=="number"?i:i.scroll:null,c=i?typeof i=="number"?i:i.resize:null,h=K.useRef(!1);K.useEffect(()=>(h.current=!0,()=>void(h.current=!1)));const[d,p,m]=K.useMemo(()=>{const g=()=>{if(!o.current.element)return;const{left:b,top:E,width:S,height:w,bottom:T,right:R,x:U,y:A}=o.current.element.getBoundingClientRect(),D={left:b,top:E,width:S,height:w,bottom:T,right:R,x:U,y:A};o.current.element instanceof HTMLElement&&n&&(D.height=o.current.element.offsetHeight,D.width=o.current.element.offsetWidth),Object.freeze(D),h.current&&!N5(o.current.lastBounds,D)&&a(o.current.lastBounds=D)};return[g,c?WM(g,c):g,l?WM(g,l):g]},[a,n,l,c]);function v(){o.current.scrollContainers&&(o.current.scrollContainers.forEach(g=>g.removeEventListener("scroll",m,!0)),o.current.scrollContainers=null),o.current.resizeObserver&&(o.current.resizeObserver.disconnect(),o.current.resizeObserver=null),o.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",o.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",o.current.orientationHandler))}function x(){o.current.element&&(o.current.resizeObserver=new r(m),o.current.resizeObserver.observe(o.current.element),e&&o.current.scrollContainers&&o.current.scrollContainers.forEach(g=>g.addEventListener("scroll",m,{capture:!0,passive:!0})),o.current.orientationHandler=()=>{m()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",o.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",o.current.orientationHandler))}const _=g=>{!g||g===o.current.element||(v(),o.current.element=g,o.current.scrollContainers=kC(g),x())};return L5(m,!!e),O5(p),K.useEffect(()=>{v(),x()},[e,m,p]),K.useEffect(()=>v,[]),[_,s,d]}function O5(i){K.useEffect(()=>{const e=i;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[i])}function L5(i,e){K.useEffect(()=>{if(e){const t=i;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[i,e])}function kC(i){const e=[];if(!i||i===document.body)return e;const{overflow:t,overflowX:n,overflowY:r}=window.getComputedStyle(i);return[t,n,r].some(s=>s==="auto"||s==="scroll")&&e.push(i),[...e,...kC(i.parentElement)]}const I5=["x","y","top","bottom","left","right","width","height"],N5=(i,e)=>I5.every(t=>i[t]===e[t]);function P5({ref:i,children:e,fallback:t,resize:n,style:r,gl:s,events:a=D5,eventSource:o,eventPrefix:l,shadows:c,linear:h,flat:d,legacy:p,orthographic:m,frameloop:v,dpr:x,performance:_,raycaster:g,camera:b,scene:E,onPointerMissed:S,onCreated:w,...T}){K.useMemo(()=>LC(xC),[]);const R=e5(),[U,A]=U5({scroll:!0,debounce:{scroll:50,resize:0},...n}),D=K.useRef(null),L=K.useRef(null);K.useImperativeHandle(i,()=>D.current);const P=TC(S),[I,V]=K.useState(!1),[H,z]=K.useState(!1);if(I)throw I;if(H)throw H;const O=K.useRef(null);rd(()=>{const G=D.current;if(A.width>0&&A.height>0&&G){O.current||(O.current=M5(G));async function X(){await O.current.configure({gl:s,scene:E,events:a,shadows:c,linear:h,flat:d,legacy:p,orthographic:m,frameloop:v,dpr:x,performance:_,raycaster:g,camera:b,size:A,onPointerMissed:(...k)=>P.current==null?void 0:P.current(...k),onCreated:k=>{k.events.connect==null||k.events.connect(o?Q4(o)?o.current:o:L.current),l&&k.setEvents({compute:(Y,Q)=>{const te=Y[l+"X"],ee=Y[l+"Y"];Q.pointer.set(te/Q.size.width*2-1,-(ee/Q.size.height)*2+1),Q.raycaster.setFromCamera(Q.pointer,Q.camera)}}),w?.(k)}}),O.current.render(he.jsx(R,{children:he.jsx(n5,{set:z,children:he.jsx(K.Suspense,{fallback:he.jsx(t5,{set:V}),children:e??null})})}))}X()}}),K.useEffect(()=>{const G=D.current;if(G)return()=>zC(G)},[]);const B=o?"none":"auto";return he.jsx("div",{ref:L,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:B,...r},...T,children:he.jsx("div",{ref:U,style:{width:"100%",height:"100%"},children:he.jsx("canvas",{ref:D,style:{display:"block"},children:t})})})}function z5(i){return he.jsx(SC,{children:he.jsx(P5,{...i})})}const Mn={LEFT:1,RIGHT:2,MIDDLE:4},Re=Object.freeze({NONE:0,ROTATE:1,TRUCK:2,SCREEN_PAN:4,OFFSET:8,DOLLY:16,ZOOM:32,TOUCH_ROTATE:64,TOUCH_TRUCK:128,TOUCH_SCREEN_PAN:256,TOUCH_OFFSET:512,TOUCH_DOLLY:1024,TOUCH_ZOOM:2048,TOUCH_DOLLY_TRUCK:4096,TOUCH_DOLLY_SCREEN_PAN:8192,TOUCH_DOLLY_OFFSET:16384,TOUCH_DOLLY_ROTATE:32768,TOUCH_ZOOM_TRUCK:65536,TOUCH_ZOOM_OFFSET:131072,TOUCH_ZOOM_SCREEN_PAN:262144,TOUCH_ZOOM_ROTATE:524288}),kc={NONE:0,IN:1,OUT:-1};function ol(i){return i.isPerspectiveCamera}function io(i){return i.isOrthographicCamera}const eo=Math.PI*2,XM=Math.PI/2,GC=1e-5,wh=Math.PI/180;function ns(i,e,t){return Math.max(e,Math.min(t,i))}function pn(i,e=GC){return Math.abs(i)<e}function nn(i,e,t=GC){return pn(i-e,t)}function jM(i,e){return Math.round(i/e)*e}function Th(i){return isFinite(i)?i:i<0?-Number.MAX_VALUE:Number.MAX_VALUE}function Ah(i){return Math.abs(i)<Number.MAX_VALUE?i:i*(1/0)}function Bp(i,e,t,n,r=1/0,s){n=Math.max(1e-4,n);const a=2/n,o=a*s,l=1/(1+o+.48*o*o+.235*o*o*o);let c=i-e;const h=e,d=r*n;c=ns(c,-d,d),e=i-c;const p=(t.value+a*c)*s;t.value=(t.value-a*p)*l;let m=e+(c+p)*l;return h-i>0==m>h&&(m=h,t.value=(m-h)/s),m}function qM(i,e,t,n,r=1/0,s,a){n=Math.max(1e-4,n);const o=2/n,l=o*s,c=1/(1+l+.48*l*l+.235*l*l*l);let h=e.x,d=e.y,p=e.z,m=i.x-h,v=i.y-d,x=i.z-p;const _=h,g=d,b=p,E=r*n,S=E*E,w=m*m+v*v+x*x;if(w>S){const H=Math.sqrt(w);m=m/H*E,v=v/H*E,x=x/H*E}h=i.x-m,d=i.y-v,p=i.z-x;const T=(t.x+o*m)*s,R=(t.y+o*v)*s,U=(t.z+o*x)*s;t.x=(t.x-o*T)*c,t.y=(t.y-o*R)*c,t.z=(t.z-o*U)*c,a.x=h+(m+T)*c,a.y=d+(v+R)*c,a.z=p+(x+U)*c;const A=_-i.x,D=g-i.y,L=b-i.z,P=a.x-_,I=a.y-g,V=a.z-b;return A*P+D*I+L*V>0&&(a.x=_,a.y=g,a.z=b,t.x=(a.x-_)/s,t.y=(a.y-g)/s,t.z=(a.z-b)/s),a}function qy(i,e){e.set(0,0),i.forEach(t=>{e.x+=t.clientX,e.y+=t.clientY}),e.x/=i.length,e.y/=i.length}function Yy(i,e){return io(i)?(console.warn(`${e} is not supported in OrthographicCamera`),!0):!1}let F5=class{_listeners={};addEventListener(e,t){const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){const n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){const r=this._listeners[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}removeAllEventListeners(e){if(!e){this._listeners={};return}Array.isArray(this._listeners[e])&&(this._listeners[e].length=0)}dispatchEvent(e){const n=this._listeners[e.type];if(n!==void 0){e.target=this;const r=n.slice(0);for(let s=0,a=r.length;s<a;s++)r[s].call(this,e)}}};const B5="3.1.2",kp=1/8,k5=/Mac/.test(globalThis?.navigator?.platform);let Mt,YM,Gp,Zy,Yi,Lt,Kt,Gc,Ch,ys,_s,ll,ZM,KM,vr,Hc,Vc,JM,Ky,QM,Jy,Qy,Hp,ni=class ux extends F5{static install(e){Mt=e.THREE,YM=Object.freeze(new Mt.Vector3(0,0,0)),Gp=Object.freeze(new Mt.Vector3(0,1,0)),Zy=Object.freeze(new Mt.Vector3(0,0,1)),Yi=new Mt.Vector2,Lt=new Mt.Vector3,Kt=new Mt.Vector3,Gc=new Mt.Vector3,Ch=new Mt.Vector3,ys=new Mt.Vector3,_s=new Mt.Vector3,ll=new Mt.Vector3,ZM=new Mt.Vector3,KM=new Mt.Vector3,vr=new Mt.Spherical,Hc=new Mt.Spherical,Vc=new Mt.Box3,JM=new Mt.Box3,Ky=new Mt.Sphere,QM=new Mt.Quaternion,Jy=new Mt.Quaternion,Qy=new Mt.Matrix4,Hp=new Mt.Raycaster}static get ACTION(){return Re}minPolarAngle=0;maxPolarAngle=Math.PI;minAzimuthAngle=-1/0;maxAzimuthAngle=1/0;minDistance=Number.EPSILON;maxDistance=1/0;infinityDolly=!1;minZoom=.01;maxZoom=1/0;smoothTime=.25;draggingSmoothTime=.125;maxSpeed=1/0;azimuthRotateSpeed=1;polarRotateSpeed=1;dollySpeed=1;dollyDragInverted=!1;truckSpeed=2;dollyToCursor=!1;dragToOffset=!1;boundaryFriction=0;restThreshold=.01;colliderMeshes=[];mouseButtons;touches;cancel=()=>{};lockPointer;unlockPointer;_enabled=!0;_camera;_yAxisUpSpace;_yAxisUpSpaceInverse;_state=Re.NONE;_domElement;_viewport=null;_target;_targetEnd;_focalOffset;_focalOffsetEnd;_spherical;_sphericalEnd;_lastDistance;_zoom;_zoomEnd;_lastZoom;_cameraUp0;_target0;_position0;_zoom0;_focalOffset0;_dollyControlCoord;_changedDolly=0;_changedZoom=0;_nearPlaneCorners;_hasRested=!0;_boundary;_boundaryEnclosesCamera=!1;_needsUpdate=!0;_updatedLastTime=!1;_elementRect=new DOMRect;_isDragging=!1;_dragNeedsUpdate=!0;_activePointers=[];_lockedPointer=null;_interactiveArea=new DOMRect(0,0,1,1);_isUserControllingRotate=!1;_isUserControllingDolly=!1;_isUserControllingTruck=!1;_isUserControllingOffset=!1;_isUserControllingZoom=!1;_lastDollyDirection=kc.NONE;_thetaVelocity={value:0};_phiVelocity={value:0};_radiusVelocity={value:0};_targetVelocity=new Mt.Vector3;_focalOffsetVelocity=new Mt.Vector3;_zoomVelocity={value:0};set verticalDragToForward(e){console.warn("camera-controls: `verticalDragToForward` was removed. Use `mouseButtons.left = CameraControls.ACTION.SCREEN_PAN` instead.")}constructor(e,t){super(),typeof Mt>"u"&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=e,this._yAxisUpSpace=new Mt.Quaternion().setFromUnitVectors(this._camera.up,Gp),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=Re.NONE,this._target=new Mt.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new Mt.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=new Mt.Spherical().setFromVector3(Lt.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)),this._sphericalEnd=this._spherical.clone(),this._lastDistance=this._spherical.radius,this._zoom=this._camera.zoom,this._zoomEnd=this._zoom,this._lastZoom=this._zoom,this._nearPlaneCorners=[new Mt.Vector3,new Mt.Vector3,new Mt.Vector3,new Mt.Vector3],this._updateNearPlaneCorners(),this._boundary=new Mt.Box3(new Mt.Vector3(-1/0,-1/0,-1/0),new Mt.Vector3(1/0,1/0,1/0)),this._cameraUp0=this._camera.up.clone(),this._target0=this._target.clone(),this._position0=this._camera.position.clone(),this._zoom0=this._zoom,this._focalOffset0=this._focalOffset.clone(),this._dollyControlCoord=new Mt.Vector2,this.mouseButtons={left:Re.ROTATE,middle:Re.DOLLY,right:Re.TRUCK,wheel:ol(this._camera)?Re.DOLLY:io(this._camera)?Re.ZOOM:Re.NONE},this.touches={one:Re.TOUCH_ROTATE,two:ol(this._camera)?Re.TOUCH_DOLLY_TRUCK:io(this._camera)?Re.TOUCH_ZOOM_TRUCK:Re.NONE,three:Re.TOUCH_TRUCK};const n=new Mt.Vector2,r=new Mt.Vector2,s=new Mt.Vector2,a=g=>{if(!this._enabled||!this._domElement)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const S=this._domElement.getBoundingClientRect(),w=g.clientX/S.width,T=g.clientY/S.height;if(w<this._interactiveArea.left||w>this._interactiveArea.right||T<this._interactiveArea.top||T>this._interactiveArea.bottom)return}const b=g.pointerType!=="mouse"?null:(g.buttons&Mn.LEFT)===Mn.LEFT?Mn.LEFT:(g.buttons&Mn.MIDDLE)===Mn.MIDDLE?Mn.MIDDLE:(g.buttons&Mn.RIGHT)===Mn.RIGHT?Mn.RIGHT:null;if(b!==null){const S=this._findPointerByMouseButton(b);S&&this._disposePointer(S)}if((g.buttons&Mn.LEFT)===Mn.LEFT&&this._lockedPointer)return;const E={pointerId:g.pointerId,clientX:g.clientX,clientY:g.clientY,deltaX:0,deltaY:0,mouseButton:b};this._activePointers.push(E),this._domElement.ownerDocument.removeEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",l),this._domElement.ownerDocument.addEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",l),this._isDragging=!0,p(g)},o=g=>{g.cancelable&&g.preventDefault();const b=g.pointerId,E=this._lockedPointer||this._findPointerById(b);if(E){if(E.clientX=g.clientX,E.clientY=g.clientY,E.deltaX=g.movementX,E.deltaY=g.movementY,this._state=0,g.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else(!this._isDragging&&this._lockedPointer||this._isDragging&&(g.buttons&Mn.LEFT)===Mn.LEFT)&&(this._state=this._state|this.mouseButtons.left),this._isDragging&&(g.buttons&Mn.MIDDLE)===Mn.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),this._isDragging&&(g.buttons&Mn.RIGHT)===Mn.RIGHT&&(this._state=this._state|this.mouseButtons.right);m()}},l=g=>{const b=this._findPointerById(g.pointerId);if(!(b&&b===this._lockedPointer)){if(b&&this._disposePointer(b),g.pointerType==="touch")switch(this._activePointers.length){case 0:this._state=Re.NONE;break;case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else this._state=Re.NONE;v()}};let c=-1;const h=g=>{if(!this._domElement||!this._enabled||this.mouseButtons.wheel===Re.NONE)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const R=this._domElement.getBoundingClientRect(),U=g.clientX/R.width,A=g.clientY/R.height;if(U<this._interactiveArea.left||U>this._interactiveArea.right||A<this._interactiveArea.top||A>this._interactiveArea.bottom)return}if(g.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===Re.ROTATE||this.mouseButtons.wheel===Re.TRUCK){const R=performance.now();c-R<1e3&&this._getClientRect(this._elementRect),c=R}const b=k5?-1:-3,E=g.deltaMode===1&&!g.ctrlKey?g.deltaY/b:g.deltaY/(b*10),S=this.dollyToCursor?(g.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,w=this.dollyToCursor?(g.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(g.ctrlKey?Re.ZOOM:this.mouseButtons.wheel){case Re.ROTATE:{this._rotateInternal(g.deltaX,g.deltaY),this._isUserControllingRotate=!0;break}case Re.TRUCK:{this._truckInternal(g.deltaX,g.deltaY,!1,!1),this._isUserControllingTruck=!0;break}case Re.SCREEN_PAN:{this._truckInternal(g.deltaX,g.deltaY,!1,!0),this._isUserControllingTruck=!0;break}case Re.OFFSET:{this._truckInternal(g.deltaX,g.deltaY,!0,!1),this._isUserControllingOffset=!0;break}case Re.DOLLY:{this._dollyInternal(-E,S,w),this._isUserControllingDolly=!0;break}case Re.ZOOM:{this._zoomInternal(-E,S,w),this._isUserControllingZoom=!0;break}}this.dispatchEvent({type:"control"})},d=g=>{if(!(!this._domElement||!this._enabled)){if(this.mouseButtons.right===ux.ACTION.NONE){const b=g instanceof PointerEvent?g.pointerId:0,E=this._findPointerById(b);E&&this._disposePointer(E),this._domElement.ownerDocument.removeEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",l);return}g.preventDefault()}},p=g=>{if(!this._enabled)return;if(qy(this._activePointers,Yi),this._getClientRect(this._elementRect),n.copy(Yi),r.copy(Yi),this._activePointers.length>=2){const E=Yi.x-this._activePointers[1].clientX,S=Yi.y-this._activePointers[1].clientY,w=Math.sqrt(E*E+S*S);s.set(0,w);const T=(this._activePointers[0].clientX+this._activePointers[1].clientX)*.5,R=(this._activePointers[0].clientY+this._activePointers[1].clientY)*.5;r.set(T,R)}if(this._state=0,!g)this._lockedPointer&&(this._state=this._state|this.mouseButtons.left);else if("pointerType"in g&&g.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else!this._lockedPointer&&(g.buttons&Mn.LEFT)===Mn.LEFT&&(this._state=this._state|this.mouseButtons.left),(g.buttons&Mn.MIDDLE)===Mn.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(g.buttons&Mn.RIGHT)===Mn.RIGHT&&(this._state=this._state|this.mouseButtons.right);((this._state&Re.ROTATE)===Re.ROTATE||(this._state&Re.TOUCH_ROTATE)===Re.TOUCH_ROTATE||(this._state&Re.TOUCH_DOLLY_ROTATE)===Re.TOUCH_DOLLY_ROTATE||(this._state&Re.TOUCH_ZOOM_ROTATE)===Re.TOUCH_ZOOM_ROTATE)&&(this._sphericalEnd.theta=this._spherical.theta,this._sphericalEnd.phi=this._spherical.phi,this._thetaVelocity.value=0,this._phiVelocity.value=0),((this._state&Re.TRUCK)===Re.TRUCK||(this._state&Re.SCREEN_PAN)===Re.SCREEN_PAN||(this._state&Re.TOUCH_TRUCK)===Re.TOUCH_TRUCK||(this._state&Re.TOUCH_SCREEN_PAN)===Re.TOUCH_SCREEN_PAN||(this._state&Re.TOUCH_DOLLY_TRUCK)===Re.TOUCH_DOLLY_TRUCK||(this._state&Re.TOUCH_DOLLY_SCREEN_PAN)===Re.TOUCH_DOLLY_SCREEN_PAN||(this._state&Re.TOUCH_ZOOM_TRUCK)===Re.TOUCH_ZOOM_TRUCK||(this._state&Re.TOUCH_ZOOM_SCREEN_PAN)===Re.TOUCH_DOLLY_SCREEN_PAN)&&(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),((this._state&Re.DOLLY)===Re.DOLLY||(this._state&Re.TOUCH_DOLLY)===Re.TOUCH_DOLLY||(this._state&Re.TOUCH_DOLLY_TRUCK)===Re.TOUCH_DOLLY_TRUCK||(this._state&Re.TOUCH_DOLLY_SCREEN_PAN)===Re.TOUCH_DOLLY_SCREEN_PAN||(this._state&Re.TOUCH_DOLLY_OFFSET)===Re.TOUCH_DOLLY_OFFSET||(this._state&Re.TOUCH_DOLLY_ROTATE)===Re.TOUCH_DOLLY_ROTATE)&&(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),((this._state&Re.ZOOM)===Re.ZOOM||(this._state&Re.TOUCH_ZOOM)===Re.TOUCH_ZOOM||(this._state&Re.TOUCH_ZOOM_TRUCK)===Re.TOUCH_ZOOM_TRUCK||(this._state&Re.TOUCH_ZOOM_SCREEN_PAN)===Re.TOUCH_ZOOM_SCREEN_PAN||(this._state&Re.TOUCH_ZOOM_OFFSET)===Re.TOUCH_ZOOM_OFFSET||(this._state&Re.TOUCH_ZOOM_ROTATE)===Re.TOUCH_ZOOM_ROTATE)&&(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),((this._state&Re.OFFSET)===Re.OFFSET||(this._state&Re.TOUCH_OFFSET)===Re.TOUCH_OFFSET||(this._state&Re.TOUCH_DOLLY_OFFSET)===Re.TOUCH_DOLLY_OFFSET||(this._state&Re.TOUCH_ZOOM_OFFSET)===Re.TOUCH_ZOOM_OFFSET)&&(this._focalOffsetEnd.copy(this._focalOffset),this._focalOffsetVelocity.set(0,0,0)),this.dispatchEvent({type:"controlstart"})},m=()=>{if(!this._enabled||!this._dragNeedsUpdate)return;this._dragNeedsUpdate=!1,qy(this._activePointers,Yi);const b=this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,E=b?-b.deltaX:r.x-Yi.x,S=b?-b.deltaY:r.y-Yi.y;if(r.copy(Yi),((this._state&Re.ROTATE)===Re.ROTATE||(this._state&Re.TOUCH_ROTATE)===Re.TOUCH_ROTATE||(this._state&Re.TOUCH_DOLLY_ROTATE)===Re.TOUCH_DOLLY_ROTATE||(this._state&Re.TOUCH_ZOOM_ROTATE)===Re.TOUCH_ZOOM_ROTATE)&&(this._rotateInternal(E,S),this._isUserControllingRotate=!0),(this._state&Re.DOLLY)===Re.DOLLY||(this._state&Re.ZOOM)===Re.ZOOM){const w=this.dollyToCursor?(n.x-this._elementRect.x)/this._elementRect.width*2-1:0,T=this.dollyToCursor?(n.y-this._elementRect.y)/this._elementRect.height*-2+1:0,R=this.dollyDragInverted?-1:1;(this._state&Re.DOLLY)===Re.DOLLY?(this._dollyInternal(R*S*kp,w,T),this._isUserControllingDolly=!0):(this._zoomInternal(R*S*kp,w,T),this._isUserControllingZoom=!0)}if((this._state&Re.TOUCH_DOLLY)===Re.TOUCH_DOLLY||(this._state&Re.TOUCH_ZOOM)===Re.TOUCH_ZOOM||(this._state&Re.TOUCH_DOLLY_TRUCK)===Re.TOUCH_DOLLY_TRUCK||(this._state&Re.TOUCH_ZOOM_TRUCK)===Re.TOUCH_ZOOM_TRUCK||(this._state&Re.TOUCH_DOLLY_SCREEN_PAN)===Re.TOUCH_DOLLY_SCREEN_PAN||(this._state&Re.TOUCH_ZOOM_SCREEN_PAN)===Re.TOUCH_ZOOM_SCREEN_PAN||(this._state&Re.TOUCH_DOLLY_OFFSET)===Re.TOUCH_DOLLY_OFFSET||(this._state&Re.TOUCH_ZOOM_OFFSET)===Re.TOUCH_ZOOM_OFFSET||(this._state&Re.TOUCH_DOLLY_ROTATE)===Re.TOUCH_DOLLY_ROTATE||(this._state&Re.TOUCH_ZOOM_ROTATE)===Re.TOUCH_ZOOM_ROTATE){const w=Yi.x-this._activePointers[1].clientX,T=Yi.y-this._activePointers[1].clientY,R=Math.sqrt(w*w+T*T),U=s.y-R;s.set(0,R);const A=this.dollyToCursor?(r.x-this._elementRect.x)/this._elementRect.width*2-1:0,D=this.dollyToCursor?(r.y-this._elementRect.y)/this._elementRect.height*-2+1:0;(this._state&Re.TOUCH_DOLLY)===Re.TOUCH_DOLLY||(this._state&Re.TOUCH_DOLLY_ROTATE)===Re.TOUCH_DOLLY_ROTATE||(this._state&Re.TOUCH_DOLLY_TRUCK)===Re.TOUCH_DOLLY_TRUCK||(this._state&Re.TOUCH_DOLLY_SCREEN_PAN)===Re.TOUCH_DOLLY_SCREEN_PAN||(this._state&Re.TOUCH_DOLLY_OFFSET)===Re.TOUCH_DOLLY_OFFSET?(this._dollyInternal(U*kp,A,D),this._isUserControllingDolly=!0):(this._zoomInternal(U*kp,A,D),this._isUserControllingZoom=!0)}((this._state&Re.TRUCK)===Re.TRUCK||(this._state&Re.TOUCH_TRUCK)===Re.TOUCH_TRUCK||(this._state&Re.TOUCH_DOLLY_TRUCK)===Re.TOUCH_DOLLY_TRUCK||(this._state&Re.TOUCH_ZOOM_TRUCK)===Re.TOUCH_ZOOM_TRUCK)&&(this._truckInternal(E,S,!1,!1),this._isUserControllingTruck=!0),((this._state&Re.SCREEN_PAN)===Re.SCREEN_PAN||(this._state&Re.TOUCH_SCREEN_PAN)===Re.TOUCH_SCREEN_PAN||(this._state&Re.TOUCH_DOLLY_SCREEN_PAN)===Re.TOUCH_DOLLY_SCREEN_PAN||(this._state&Re.TOUCH_ZOOM_SCREEN_PAN)===Re.TOUCH_ZOOM_SCREEN_PAN)&&(this._truckInternal(E,S,!1,!0),this._isUserControllingTruck=!0),((this._state&Re.OFFSET)===Re.OFFSET||(this._state&Re.TOUCH_OFFSET)===Re.TOUCH_OFFSET||(this._state&Re.TOUCH_DOLLY_OFFSET)===Re.TOUCH_DOLLY_OFFSET||(this._state&Re.TOUCH_ZOOM_OFFSET)===Re.TOUCH_ZOOM_OFFSET)&&(this._truckInternal(E,S,!0,!1),this._isUserControllingOffset=!0),this.dispatchEvent({type:"control"})},v=()=>{qy(this._activePointers,Yi),r.copy(Yi),this._dragNeedsUpdate=!1,(this._activePointers.length===0||this._activePointers.length===1&&this._activePointers[0]===this._lockedPointer)&&(this._isDragging=!1),this._activePointers.length===0&&this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",l),this.dispatchEvent({type:"controlend"}))};this.lockPointer=()=>{!this._enabled||!this._domElement||(this.cancel(),this._lockedPointer={pointerId:-1,clientX:0,clientY:0,deltaX:0,deltaY:0,mouseButton:null},this._activePointers.push(this._lockedPointer),this._domElement.ownerDocument.removeEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",l),this._domElement.requestPointerLock(),this._domElement.ownerDocument.addEventListener("pointerlockchange",x),this._domElement.ownerDocument.addEventListener("pointerlockerror",_),this._domElement.ownerDocument.addEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",l),p())},this.unlockPointer=()=>{this._lockedPointer!==null&&(this._disposePointer(this._lockedPointer),this._lockedPointer=null),this._domElement?.ownerDocument.exitPointerLock(),this._domElement?.ownerDocument.removeEventListener("pointerlockchange",x),this._domElement?.ownerDocument.removeEventListener("pointerlockerror",_),this.cancel()};const x=()=>{this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement||this.unlockPointer()},_=()=>{this.unlockPointer()};this._addAllEventListeners=g=>{this._domElement=g,this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none",this._domElement.addEventListener("pointerdown",a),this._domElement.addEventListener("pointercancel",l),this._domElement.addEventListener("wheel",h,{passive:!1}),this._domElement.addEventListener("contextmenu",d)},this._removeAllEventListeners=()=>{this._domElement&&(this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect="",this._domElement.removeEventListener("pointerdown",a),this._domElement.removeEventListener("pointercancel",l),this._domElement.removeEventListener("wheel",h,{passive:!1}),this._domElement.removeEventListener("contextmenu",d),this._domElement.ownerDocument.removeEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",l),this._domElement.ownerDocument.removeEventListener("pointerlockchange",x),this._domElement.ownerDocument.removeEventListener("pointerlockerror",_))},this.cancel=()=>{this._state!==Re.NONE&&(this._state=Re.NONE,this._activePointers.length=0,v())},t&&this.connect(t),this.update(0)}get camera(){return this._camera}set camera(e){this._camera=e,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._domElement&&(e?(this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none"):(this.cancel(),this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect=""))}get active(){return!this._hasRested}get currentAction(){return this._state}get distance(){return this._spherical.radius}set distance(e){this._spherical.radius===e&&this._sphericalEnd.radius===e||(this._spherical.radius=e,this._sphericalEnd.radius=e,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(e){this._spherical.theta===e&&this._sphericalEnd.theta===e||(this._spherical.theta=e,this._sphericalEnd.theta=e,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(e){this._spherical.phi===e&&this._sphericalEnd.phi===e||(this._spherical.phi=e,this._sphericalEnd.phi=e,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(e){this._boundaryEnclosesCamera=e,this._needsUpdate=!0}set interactiveArea(e){this._interactiveArea.width=ns(e.width,0,1),this._interactiveArea.height=ns(e.height,0,1),this._interactiveArea.x=ns(e.x,0,1-this._interactiveArea.width),this._interactiveArea.y=ns(e.y,0,1-this._interactiveArea.height)}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}rotate(e,t,n=!1){return this.rotateTo(this._sphericalEnd.theta+e,this._sphericalEnd.phi+t,n)}rotateAzimuthTo(e,t=!1){return this.rotateTo(e,this._sphericalEnd.phi,t)}rotatePolarTo(e,t=!1){return this.rotateTo(this._sphericalEnd.theta,e,t)}rotateTo(e,t,n=!1){this._isUserControllingRotate=!1;const r=ns(e,this.minAzimuthAngle,this.maxAzimuthAngle),s=ns(t,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=r,this._sphericalEnd.phi=s,this._sphericalEnd.makeSafe(),this._needsUpdate=!0,n||(this._spherical.theta=this._sphericalEnd.theta,this._spherical.phi=this._sphericalEnd.phi);const a=!n||nn(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&nn(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(a)}dolly(e,t=!1){return this.dollyTo(this._sphericalEnd.radius-e,t)}dollyTo(e,t=!1){return this._isUserControllingDolly=!1,this._lastDollyDirection=kc.NONE,this._changedDolly=0,this._dollyToNoClamp(ns(e,this.minDistance,this.maxDistance),t)}_dollyToNoClamp(e,t=!1){const n=this._sphericalEnd.radius;if(this.colliderMeshes.length>=1){const a=this._collisionTest(),o=nn(a,this._spherical.radius);if(!(n>e)&&o)return Promise.resolve();this._sphericalEnd.radius=Math.min(e,a)}else this._sphericalEnd.radius=e;this._needsUpdate=!0,t||(this._spherical.radius=this._sphericalEnd.radius);const s=!t||nn(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(s)}dollyInFixed(e,t=!1){this._targetEnd.add(this._getCameraDirection(Ch).multiplyScalar(e)),t||this._target.copy(this._targetEnd);const n=!t||nn(this._target.x,this._targetEnd.x,this.restThreshold)&&nn(this._target.y,this._targetEnd.y,this.restThreshold)&&nn(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(n)}zoom(e,t=!1){return this.zoomTo(this._zoomEnd+e,t)}zoomTo(e,t=!1){this._isUserControllingZoom=!1,this._zoomEnd=ns(e,this.minZoom,this.maxZoom),this._needsUpdate=!0,t||(this._zoom=this._zoomEnd);const n=!t||nn(this._zoom,this._zoomEnd,this.restThreshold);return this._changedZoom=0,this._createOnRestPromise(n)}pan(e,t,n=!1){return console.warn("`pan` has been renamed to `truck`"),this.truck(e,t,n)}truck(e,t,n=!1){this._camera.updateMatrix(),ys.setFromMatrixColumn(this._camera.matrix,0),_s.setFromMatrixColumn(this._camera.matrix,1),ys.multiplyScalar(e),_s.multiplyScalar(-t);const r=Lt.copy(ys).add(_s),s=Kt.copy(this._targetEnd).add(r);return this.moveTo(s.x,s.y,s.z,n)}forward(e,t=!1){Lt.setFromMatrixColumn(this._camera.matrix,0),Lt.crossVectors(this._camera.up,Lt),Lt.multiplyScalar(e);const n=Kt.copy(this._targetEnd).add(Lt);return this.moveTo(n.x,n.y,n.z,t)}elevate(e,t=!1){return Lt.copy(this._camera.up).multiplyScalar(e),this.moveTo(this._targetEnd.x+Lt.x,this._targetEnd.y+Lt.y,this._targetEnd.z+Lt.z,t)}moveTo(e,t,n,r=!1){this._isUserControllingTruck=!1;const s=Lt.set(e,t,n).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,s,this.boundaryFriction),this._needsUpdate=!0,r||this._target.copy(this._targetEnd);const a=!r||nn(this._target.x,this._targetEnd.x,this.restThreshold)&&nn(this._target.y,this._targetEnd.y,this.restThreshold)&&nn(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(a)}lookInDirectionOf(e,t,n,r=!1){const o=Lt.set(e,t,n).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius).add(this._targetEnd);return this.setPosition(o.x,o.y,o.z,r)}fitToBox(e,t,{cover:n=!1,paddingLeft:r=0,paddingRight:s=0,paddingBottom:a=0,paddingTop:o=0}={}){const l=[],c=e.isBox3?Vc.copy(e):Vc.setFromObject(e);c.isEmpty()&&(console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"),Promise.resolve());const h=jM(this._sphericalEnd.theta,XM),d=jM(this._sphericalEnd.phi,XM);l.push(this.rotateTo(h,d,t));const p=Lt.setFromSpherical(this._sphericalEnd).normalize(),m=QM.setFromUnitVectors(p,Zy),v=nn(Math.abs(p.y),1);v&&m.multiply(Jy.setFromAxisAngle(Gp,h)),m.multiply(this._yAxisUpSpaceInverse);const x=JM.makeEmpty();Kt.copy(c.min).applyQuaternion(m),x.expandByPoint(Kt),Kt.copy(c.min).setX(c.max.x).applyQuaternion(m),x.expandByPoint(Kt),Kt.copy(c.min).setY(c.max.y).applyQuaternion(m),x.expandByPoint(Kt),Kt.copy(c.max).setZ(c.min.z).applyQuaternion(m),x.expandByPoint(Kt),Kt.copy(c.min).setZ(c.max.z).applyQuaternion(m),x.expandByPoint(Kt),Kt.copy(c.max).setY(c.min.y).applyQuaternion(m),x.expandByPoint(Kt),Kt.copy(c.max).setX(c.min.x).applyQuaternion(m),x.expandByPoint(Kt),Kt.copy(c.max).applyQuaternion(m),x.expandByPoint(Kt),x.min.x-=r,x.min.y-=a,x.max.x+=s,x.max.y+=o,m.setFromUnitVectors(Zy,p),v&&m.premultiply(Jy.invert()),m.premultiply(this._yAxisUpSpace);const _=x.getSize(Lt),g=x.getCenter(Kt).applyQuaternion(m);if(ol(this._camera)){const b=this.getDistanceToFitBox(_.x,_.y,_.z,n);l.push(this.moveTo(g.x,g.y,g.z,t)),l.push(this.dollyTo(b,t)),l.push(this.setFocalOffset(0,0,0,t))}else if(io(this._camera)){const b=this._camera,E=b.right-b.left,S=b.top-b.bottom,w=n?Math.max(E/_.x,S/_.y):Math.min(E/_.x,S/_.y);l.push(this.moveTo(g.x,g.y,g.z,t)),l.push(this.zoomTo(w,t)),l.push(this.setFocalOffset(0,0,0,t))}return Promise.all(l)}fitToSphere(e,t){const n=[],s="isObject3D"in e?ux.createBoundingSphere(e,Ky):Ky.copy(e);if(n.push(this.moveTo(s.center.x,s.center.y,s.center.z,t)),ol(this._camera)){const a=this.getDistanceToFitSphere(s.radius);n.push(this.dollyTo(a,t))}else if(io(this._camera)){const a=this._camera.right-this._camera.left,o=this._camera.top-this._camera.bottom,l=2*s.radius,c=Math.min(a/l,o/l);n.push(this.zoomTo(c,t))}return n.push(this.setFocalOffset(0,0,0,t)),Promise.all(n)}setLookAt(e,t,n,r,s,a,o=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=kc.NONE,this._changedDolly=0;const l=Kt.set(r,s,a),c=Lt.set(e,t,n);this._targetEnd.copy(l),this._sphericalEnd.setFromVector3(c.sub(l).applyQuaternion(this._yAxisUpSpace)),this._needsUpdate=!0,o||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const h=!o||nn(this._target.x,this._targetEnd.x,this.restThreshold)&&nn(this._target.y,this._targetEnd.y,this.restThreshold)&&nn(this._target.z,this._targetEnd.z,this.restThreshold)&&nn(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&nn(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&nn(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(h)}lerp(e,t,n,r=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=kc.NONE,this._changedDolly=0;const s=Lt.set(...e.target);if("spherical"in e)vr.set(...e.spherical);else{const d=Kt.set(...e.position);vr.setFromVector3(d.sub(s).applyQuaternion(this._yAxisUpSpace))}const a=Gc.set(...t.target);if("spherical"in t)Hc.set(...t.spherical);else{const d=Kt.set(...t.position);Hc.setFromVector3(d.sub(a).applyQuaternion(this._yAxisUpSpace))}this._targetEnd.copy(s.lerp(a,n));const o=Hc.theta-vr.theta,l=Hc.phi-vr.phi,c=Hc.radius-vr.radius;this._sphericalEnd.set(vr.radius+c*n,vr.phi+l*n,vr.theta+o*n),this._needsUpdate=!0,r||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const h=!r||nn(this._target.x,this._targetEnd.x,this.restThreshold)&&nn(this._target.y,this._targetEnd.y,this.restThreshold)&&nn(this._target.z,this._targetEnd.z,this.restThreshold)&&nn(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&nn(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&nn(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(h)}lerpLookAt(e,t,n,r,s,a,o,l,c,h,d,p,m,v=!1){return this.lerp({position:[e,t,n],target:[r,s,a]},{position:[o,l,c],target:[h,d,p]},m,v)}setPosition(e,t,n,r=!1){return this.setLookAt(e,t,n,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,r)}setTarget(e,t,n,r=!1){const s=this.getPosition(Lt),a=this.setLookAt(s.x,s.y,s.z,e,t,n,r);return this._sphericalEnd.phi=ns(this._sphericalEnd.phi,this.minPolarAngle,this.maxPolarAngle),a}setFocalOffset(e,t,n,r=!1){this._isUserControllingOffset=!1,this._focalOffsetEnd.set(e,t,n),this._needsUpdate=!0,r||this._focalOffset.copy(this._focalOffsetEnd);const s=!r||nn(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&&nn(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&&nn(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(s)}setOrbitPoint(e,t,n){this._camera.updateMatrixWorld(),ys.setFromMatrixColumn(this._camera.matrixWorldInverse,0),_s.setFromMatrixColumn(this._camera.matrixWorldInverse,1),ll.setFromMatrixColumn(this._camera.matrixWorldInverse,2);const r=Lt.set(e,t,n),s=r.distanceTo(this._camera.position),a=r.sub(this._camera.position);ys.multiplyScalar(a.x),_s.multiplyScalar(a.y),ll.multiplyScalar(a.z),Lt.copy(ys).add(_s).add(ll),Lt.z=Lt.z+s,this.dollyTo(s,!1),this.setFocalOffset(-Lt.x,Lt.y,-Lt.z,!1),this.moveTo(e,t,n,!1)}setBoundary(e){if(!e){this._boundary.min.set(-1/0,-1/0,-1/0),this._boundary.max.set(1/0,1/0,1/0),this._needsUpdate=!0;return}this._boundary.copy(e),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(e,t,n,r){if(e===null){this._viewport=null;return}this._viewport=this._viewport||new Mt.Vector4,typeof e=="number"?this._viewport.set(e,t,n,r):this._viewport.copy(e)}getDistanceToFitBox(e,t,n,r=!1){if(Yy(this._camera,"getDistanceToFitBox"))return this._spherical.radius;const s=e/t,a=this._camera.getEffectiveFOV()*wh,o=this._camera.aspect;return((r?s>o:s<o)?t:e/o)*.5/Math.tan(a*.5)+n*.5}getDistanceToFitSphere(e){if(Yy(this._camera,"getDistanceToFitSphere"))return this._spherical.radius;const t=this._camera.getEffectiveFOV()*wh,n=Math.atan(Math.tan(t*.5)*this._camera.aspect)*2,r=1<this._camera.aspect?t:n;return e/Math.sin(r*.5)}getTarget(e,t=!0){return(e&&e.isVector3?e:new Mt.Vector3).copy(t?this._targetEnd:this._target)}getPosition(e,t=!0){return(e&&e.isVector3?e:new Mt.Vector3).setFromSpherical(t?this._sphericalEnd:this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(t?this._targetEnd:this._target)}getSpherical(e,t=!0){return(e||new Mt.Spherical).copy(t?this._sphericalEnd:this._spherical)}getFocalOffset(e,t=!0){return(e&&e.isVector3?e:new Mt.Vector3).copy(t?this._focalOffsetEnd:this._focalOffset)}normalizeRotations(){return this._sphericalEnd.theta=(this._sphericalEnd.theta%eo+eo)%eo,this._sphericalEnd.theta>Math.PI&&(this._sphericalEnd.theta-=eo),this._spherical.theta+=eo*Math.round((this._sphericalEnd.theta-this._spherical.theta)/eo),this}stop(){this._focalOffset.copy(this._focalOffsetEnd),this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd),this._zoom=this._zoomEnd}reset(e=!1){if(!nn(this._camera.up.x,this._cameraUp0.x)||!nn(this._camera.up.y,this._cameraUp0.y)||!nn(this._camera.up.z,this._cameraUp0.z)){this._camera.up.copy(this._cameraUp0);const n=this.getPosition(Lt);this.updateCameraUp(),this.setPosition(n.x,n.y,n.z)}const t=[this.setLookAt(this._position0.x,this._position0.y,this._position0.z,this._target0.x,this._target0.y,this._target0.z,e),this.setFocalOffset(this._focalOffset0.x,this._focalOffset0.y,this._focalOffset0.z,e),this.zoomTo(this._zoom0,e)];return Promise.all(t)}saveState(){this._cameraUp0.copy(this._camera.up),this.getTarget(this._target0),this.getPosition(this._position0),this._zoom0=this._zoom,this._focalOffset0.copy(this._focalOffset)}updateCameraUp(){this._yAxisUpSpace.setFromUnitVectors(this._camera.up,Gp),this._yAxisUpSpaceInverse.copy(this._yAxisUpSpace).invert()}applyCameraUp(){const e=Lt.subVectors(this._target,this._camera.position).normalize(),t=Kt.crossVectors(e,this._camera.up);this._camera.up.crossVectors(t,e).normalize(),this._camera.updateMatrixWorld();const n=this.getPosition(Lt);this.updateCameraUp(),this.setPosition(n.x,n.y,n.z)}update(e){const t=this._sphericalEnd.theta-this._spherical.theta,n=this._sphericalEnd.phi-this._spherical.phi,r=this._sphericalEnd.radius-this._spherical.radius,s=ZM.subVectors(this._targetEnd,this._target),a=KM.subVectors(this._focalOffsetEnd,this._focalOffset),o=this._zoomEnd-this._zoom;if(pn(t))this._thetaVelocity.value=0,this._spherical.theta=this._sphericalEnd.theta;else{const d=this._isUserControllingRotate?this.draggingSmoothTime:this.smoothTime;this._spherical.theta=Bp(this._spherical.theta,this._sphericalEnd.theta,this._thetaVelocity,d,1/0,e),this._needsUpdate=!0}if(pn(n))this._phiVelocity.value=0,this._spherical.phi=this._sphericalEnd.phi;else{const d=this._isUserControllingRotate?this.draggingSmoothTime:this.smoothTime;this._spherical.phi=Bp(this._spherical.phi,this._sphericalEnd.phi,this._phiVelocity,d,1/0,e),this._needsUpdate=!0}if(pn(r))this._radiusVelocity.value=0,this._spherical.radius=this._sphericalEnd.radius;else{const d=this._isUserControllingDolly?this.draggingSmoothTime:this.smoothTime;this._spherical.radius=Bp(this._spherical.radius,this._sphericalEnd.radius,this._radiusVelocity,d,this.maxSpeed,e),this._needsUpdate=!0}if(pn(s.x)&&pn(s.y)&&pn(s.z))this._targetVelocity.set(0,0,0),this._target.copy(this._targetEnd);else{const d=this._isUserControllingTruck?this.draggingSmoothTime:this.smoothTime;qM(this._target,this._targetEnd,this._targetVelocity,d,this.maxSpeed,e,this._target),this._needsUpdate=!0}if(pn(a.x)&&pn(a.y)&&pn(a.z))this._focalOffsetVelocity.set(0,0,0),this._focalOffset.copy(this._focalOffsetEnd);else{const d=this._isUserControllingOffset?this.draggingSmoothTime:this.smoothTime;qM(this._focalOffset,this._focalOffsetEnd,this._focalOffsetVelocity,d,this.maxSpeed,e,this._focalOffset),this._needsUpdate=!0}if(pn(o))this._zoomVelocity.value=0,this._zoom=this._zoomEnd;else{const d=this._isUserControllingZoom?this.draggingSmoothTime:this.smoothTime;this._zoom=Bp(this._zoom,this._zoomEnd,this._zoomVelocity,d,1/0,e)}if(this.dollyToCursor){if(ol(this._camera)&&this._changedDolly!==0){const d=this._spherical.radius-this._lastDistance,p=this._camera,m=this._getCameraDirection(Ch),v=Lt.copy(m).cross(p.up).normalize();v.lengthSq()===0&&(v.x=1);const x=Kt.crossVectors(v,m),_=this._sphericalEnd.radius*Math.tan(p.getEffectiveFOV()*wh*.5),b=(this._sphericalEnd.radius-d-this._sphericalEnd.radius)/this._sphericalEnd.radius,E=Gc.copy(this._targetEnd).add(v.multiplyScalar(this._dollyControlCoord.x*_*p.aspect)).add(x.multiplyScalar(this._dollyControlCoord.y*_)),S=Lt.copy(this._targetEnd).lerp(E,b),w=this._lastDollyDirection===kc.IN&&this._spherical.radius<=this.minDistance,T=this._lastDollyDirection===kc.OUT&&this.maxDistance<=this._spherical.radius;if(this.infinityDolly&&(w||T)){this._sphericalEnd.radius-=d,this._spherical.radius-=d;const U=Kt.copy(m).multiplyScalar(-d);S.add(U)}this._boundary.clampPoint(S,S);const R=Kt.subVectors(S,this._targetEnd);this._targetEnd.copy(S),this._target.add(R),this._changedDolly-=d,pn(this._changedDolly)&&(this._changedDolly=0)}else if(io(this._camera)&&this._changedZoom!==0){const d=this._zoom-this._lastZoom,p=this._camera,m=Lt.set(this._dollyControlCoord.x,this._dollyControlCoord.y,(p.near+p.far)/(p.near-p.far)).unproject(p),v=Kt.set(0,0,-1).applyQuaternion(p.quaternion),x=Gc.copy(m).add(v.multiplyScalar(-m.dot(p.up))),g=-(this._zoom-d-this._zoom)/this._zoom,b=this._getCameraDirection(Ch),E=this._targetEnd.dot(b),S=Lt.copy(this._targetEnd).lerp(x,g),w=S.dot(b),T=b.multiplyScalar(w-E);S.sub(T),this._boundary.clampPoint(S,S);const R=Kt.subVectors(S,this._targetEnd);this._targetEnd.copy(S),this._target.add(R),this._changedZoom-=d,pn(this._changedZoom)&&(this._changedZoom=0)}}this._camera.zoom!==this._zoom&&(this._camera.zoom=this._zoom,this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0),this._dragNeedsUpdate=!0;const l=this._collisionTest();this._spherical.radius=Math.min(this._spherical.radius,l),this._spherical.makeSafe(),this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target),this._camera.lookAt(this._target),(!pn(this._focalOffset.x)||!pn(this._focalOffset.y)||!pn(this._focalOffset.z))&&(this._camera.matrix.compose(this._camera.position,this._camera.quaternion,this._camera.scale),ys.setFromMatrixColumn(this._camera.matrix,0),_s.setFromMatrixColumn(this._camera.matrix,1),ll.setFromMatrixColumn(this._camera.matrix,2),ys.multiplyScalar(this._focalOffset.x),_s.multiplyScalar(-this._focalOffset.y),ll.multiplyScalar(this._focalOffset.z),Lt.copy(ys).add(_s).add(ll),this._camera.position.add(Lt),this._camera.updateMatrixWorld()),this._boundaryEnclosesCamera&&this._encloseToBoundary(this._camera.position.copy(this._target),Lt.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse),1);const h=this._needsUpdate;return h&&!this._updatedLastTime?(this._hasRested=!1,this.dispatchEvent({type:"wake"}),this.dispatchEvent({type:"update"})):h?(this.dispatchEvent({type:"update"}),pn(t,this.restThreshold)&&pn(n,this.restThreshold)&&pn(r,this.restThreshold)&&pn(s.x,this.restThreshold)&&pn(s.y,this.restThreshold)&&pn(s.z,this.restThreshold)&&pn(a.x,this.restThreshold)&&pn(a.y,this.restThreshold)&&pn(a.z,this.restThreshold)&&pn(o,this.restThreshold)&&!this._hasRested&&(this._hasRested=!0,this.dispatchEvent({type:"rest"}))):!h&&this._updatedLastTime&&this.dispatchEvent({type:"sleep"}),this._lastDistance=this._spherical.radius,this._lastZoom=this._zoom,this._updatedLastTime=h,this._needsUpdate=!1,h}toJSON(){return JSON.stringify({enabled:this._enabled,minDistance:this.minDistance,maxDistance:Th(this.maxDistance),minZoom:this.minZoom,maxZoom:Th(this.maxZoom),minPolarAngle:this.minPolarAngle,maxPolarAngle:Th(this.maxPolarAngle),minAzimuthAngle:Th(this.minAzimuthAngle),maxAzimuthAngle:Th(this.maxAzimuthAngle),smoothTime:this.smoothTime,draggingSmoothTime:this.draggingSmoothTime,dollySpeed:this.dollySpeed,truckSpeed:this.truckSpeed,dollyToCursor:this.dollyToCursor,target:this._targetEnd.toArray(),position:Lt.setFromSpherical(this._sphericalEnd).add(this._targetEnd).toArray(),zoom:this._zoomEnd,focalOffset:this._focalOffsetEnd.toArray(),target0:this._target0.toArray(),position0:this._position0.toArray(),zoom0:this._zoom0,focalOffset0:this._focalOffset0.toArray()})}fromJSON(e,t=!1){const n=JSON.parse(e);this.enabled=n.enabled,this.minDistance=n.minDistance,this.maxDistance=Ah(n.maxDistance),this.minZoom=n.minZoom,this.maxZoom=Ah(n.maxZoom),this.minPolarAngle=n.minPolarAngle,this.maxPolarAngle=Ah(n.maxPolarAngle),this.minAzimuthAngle=Ah(n.minAzimuthAngle),this.maxAzimuthAngle=Ah(n.maxAzimuthAngle),this.smoothTime=n.smoothTime,this.draggingSmoothTime=n.draggingSmoothTime,this.dollySpeed=n.dollySpeed,this.truckSpeed=n.truckSpeed,this.dollyToCursor=n.dollyToCursor,this._target0.fromArray(n.target0),this._position0.fromArray(n.position0),this._zoom0=n.zoom0,this._focalOffset0.fromArray(n.focalOffset0),this.moveTo(n.target[0],n.target[1],n.target[2],t),vr.setFromVector3(Lt.fromArray(n.position).sub(this._targetEnd).applyQuaternion(this._yAxisUpSpace)),this.rotateTo(vr.theta,vr.phi,t),this.dollyTo(vr.radius,t),this.zoomTo(n.zoom,t),this.setFocalOffset(n.focalOffset[0],n.focalOffset[1],n.focalOffset[2],t),this._needsUpdate=!0}connect(e){if(this._domElement){console.warn("camera-controls is already connected.");return}e.setAttribute("data-camera-controls-version",B5),this._addAllEventListeners(e),this._getClientRect(this._elementRect)}disconnect(){this.cancel(),this._removeAllEventListeners(),this._domElement&&(this._domElement.removeAttribute("data-camera-controls-version"),this._domElement=void 0)}dispose(){this.removeAllEventListeners(),this.disconnect()}_getTargetDirection(e){return e.setFromSpherical(this._spherical).divideScalar(this._spherical.radius).applyQuaternion(this._yAxisUpSpaceInverse)}_getCameraDirection(e){return this._getTargetDirection(e).negate()}_findPointerById(e){return this._activePointers.find(t=>t.pointerId===e)}_findPointerByMouseButton(e){return this._activePointers.find(t=>t.mouseButton===e)}_disposePointer(e){this._activePointers.splice(this._activePointers.indexOf(e),1)}_encloseToBoundary(e,t,n){const r=t.lengthSq();if(r===0)return e;const s=Kt.copy(t).add(e),o=this._boundary.clampPoint(s,Gc).sub(s),l=o.lengthSq();if(l===0)return e.add(t);if(l===r)return e;if(n===0)return e.add(t).add(o);{const c=1+n*l/t.dot(o);return e.add(Kt.copy(t).multiplyScalar(c)).add(o.multiplyScalar(1-n))}}_updateNearPlaneCorners(){if(ol(this._camera)){const e=this._camera,t=e.near,n=e.getEffectiveFOV()*wh,r=Math.tan(n*.5)*t,s=r*e.aspect;this._nearPlaneCorners[0].set(-s,-r,0),this._nearPlaneCorners[1].set(s,-r,0),this._nearPlaneCorners[2].set(s,r,0),this._nearPlaneCorners[3].set(-s,r,0)}else if(io(this._camera)){const e=this._camera,t=1/e.zoom,n=e.left*t,r=e.right*t,s=e.top*t,a=e.bottom*t;this._nearPlaneCorners[0].set(n,s,0),this._nearPlaneCorners[1].set(r,s,0),this._nearPlaneCorners[2].set(r,a,0),this._nearPlaneCorners[3].set(n,a,0)}}_truckInternal=(e,t,n,r)=>{let s,a;if(ol(this._camera)){const o=Lt.copy(this._camera.position).sub(this._target),l=this._camera.getEffectiveFOV()*wh,c=o.length()*Math.tan(l*.5);s=this.truckSpeed*e*c/this._elementRect.height,a=this.truckSpeed*t*c/this._elementRect.height}else if(io(this._camera)){const o=this._camera;s=this.truckSpeed*e*(o.right-o.left)/o.zoom/this._elementRect.width,a=this.truckSpeed*t*(o.top-o.bottom)/o.zoom/this._elementRect.height}else return;r?(n?this.setFocalOffset(this._focalOffsetEnd.x+s,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(s,0,!0),this.forward(-a,!0)):n?this.setFocalOffset(this._focalOffsetEnd.x+s,this._focalOffsetEnd.y+a,this._focalOffsetEnd.z,!0):this.truck(s,a,!0)};_rotateInternal=(e,t)=>{const n=eo*this.azimuthRotateSpeed*e/this._elementRect.height,r=eo*this.polarRotateSpeed*t/this._elementRect.height;this.rotate(n,r,!0)};_dollyInternal=(e,t,n)=>{const r=Math.pow(.95,-e*this.dollySpeed),s=this._sphericalEnd.radius,a=this._sphericalEnd.radius*r,o=ns(a,this.minDistance,this.maxDistance),l=o-a;this.infinityDolly&&this.dollyToCursor?this._dollyToNoClamp(a,!0):this.infinityDolly&&!this.dollyToCursor?(this.dollyInFixed(l,!0),this._dollyToNoClamp(o,!0)):this._dollyToNoClamp(o,!0),this.dollyToCursor&&(this._changedDolly+=(this.infinityDolly?a:o)-s,this._dollyControlCoord.set(t,n)),this._lastDollyDirection=Math.sign(-e)};_zoomInternal=(e,t,n)=>{const r=Math.pow(.95,e*this.dollySpeed),s=this._zoom,a=this._zoom*r;this.zoomTo(a,!0),this.dollyToCursor&&(this._changedZoom+=a-s,this._dollyControlCoord.set(t,n))};_collisionTest(){let e=1/0;if(!(this.colliderMeshes.length>=1)||Yy(this._camera,"_collisionTest"))return e;const n=this._getTargetDirection(Ch);Qy.lookAt(YM,n,this._camera.up);for(let r=0;r<4;r++){const s=Kt.copy(this._nearPlaneCorners[r]);s.applyMatrix4(Qy);const a=Gc.addVectors(this._target,s);Hp.set(a,n),Hp.far=this._spherical.radius+1;const o=Hp.intersectObjects(this.colliderMeshes);o.length!==0&&o[0].distance<e&&(e=o[0].distance)}return e}_getClientRect(e){if(!this._domElement)return;const t=this._domElement.getBoundingClientRect();return e.x=t.left,e.y=t.top,this._viewport?(e.x+=this._viewport.x,e.y+=t.height-this._viewport.w-this._viewport.y,e.width=this._viewport.z,e.height=this._viewport.w):(e.width=t.width,e.height=t.height),e}_createOnRestPromise(e){return e?Promise.resolve():(this._hasRested=!1,this.dispatchEvent({type:"transitionstart"}),new Promise(t=>{const n=()=>{this.removeEventListener("rest",n),t()};this.addEventListener("rest",n)}))}_addAllEventListeners(e){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead."),0}set dampingFactor(e){console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead.")}get draggingDampingFactor(){return console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead."),0}set draggingDampingFactor(e){console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.")}static createBoundingSphere(e,t=new Mt.Sphere){const n=t,r=n.center;Vc.makeEmpty(),e.traverseVisible(a=>{a.isMesh&&Vc.expandByObject(a)}),Vc.getCenter(r);let s=0;return e.traverseVisible(a=>{if(!a.isMesh)return;const o=a;if(!o.geometry)return;const l=o.geometry.clone();l.applyMatrix4(o.matrixWorld);const h=l.attributes.position;for(let d=0,p=h.count;d<p;d++)Lt.fromBufferAttribute(h,d),s=Math.max(s,r.distanceToSquared(Lt))}),n.radius=Math.sqrt(s),n}};var df;(function(i){i.HOLD_START="holdStart",i.HOLD_END="holdEnd",i.HOLDING="holding"})(df||(df={}));class G5{constructor(){this._listeners={}}addEventListener(e,t){const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}removeEventListener(e,t){const r=this._listeners[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}dispatchEvent(e){const n=this._listeners[e.type];if(n!==void 0){e.target=this;const r=n.slice(0);for(let s=0,a=r.length;s<a;s++)r[s].call(this,e)}}}class H5 extends G5{constructor(e){super(),this._enabled=!0,this._holding=!1,this._intervalId=-1,this._deltaTime=0,this._elapsedTime=0,this._lastTime=0,this._holdStart=t=>{if(!this._enabled||this._holding)return;this._deltaTime=0,this._elapsedTime=0,this._lastTime=performance.now(),this.dispatchEvent({type:df.HOLD_START,deltaTime:this._deltaTime,elapsedTime:this._elapsedTime,originalEvent:t}),this._holding=!0;const n=()=>{this._intervalId=this.holdIntervalDelay?window.setTimeout(n,this.holdIntervalDelay):window.requestAnimationFrame(n);const r=performance.now();this._deltaTime=r-this._lastTime,this._elapsedTime+=this._deltaTime,this._lastTime=performance.now(),this.dispatchEvent({type:df.HOLDING,deltaTime:this._deltaTime,elapsedTime:this._elapsedTime,originalEvent:t})};this._intervalId=this.holdIntervalDelay?window.setTimeout(n,this.holdIntervalDelay):window.requestAnimationFrame(n)},this._holdEnd=t=>{if(!this._enabled||!this._holding)return;const n=performance.now();this._deltaTime=n-this._lastTime,this._elapsedTime+=this._deltaTime,this._lastTime=performance.now(),this.dispatchEvent({type:df.HOLD_END,deltaTime:this._deltaTime,elapsedTime:this._elapsedTime,originalEvent:t}),window.clearTimeout(this._intervalId),window.cancelAnimationFrame(this._intervalId),this._holding=!1},this.holdIntervalDelay=e}get enabled(){return this._enabled}set enabled(e){this._enabled!==e&&(this._enabled=e,this._enabled||this._holdEnd())}get holding(){return this._holding}}class Vp extends H5{constructor(e,t){if(typeof e!="string"){console.error("KeyboardKeyHold: the first argument has to be a KeyboardEvent.code string.");return}super(t),this._holdStart=this._holdStart.bind(this),this._holdEnd=this._holdEnd.bind(this);const n=s=>{V5(s)||s.code===e&&this._holdStart(s)},r=s=>{s.code===e&&this._holdEnd(s)};document.addEventListener("keydown",n),document.addEventListener("keyup",r),window.addEventListener("blur",this._holdEnd)}}function V5(i){const e=i.target;return e.tagName==="INPUT"||e.tagName==="SELECT"||e.tagName==="TEXTAREA"||e.isContentEditable}var Wp={exports:{}},$M;function W5(){if($M)return Wp.exports;$M=1;var i=typeof Reflect=="object"?Reflect:null,e=i&&typeof i.apply=="function"?i.apply:function(w,T,R){return Function.prototype.apply.call(w,T,R)},t;i&&typeof i.ownKeys=="function"?t=i.ownKeys:Object.getOwnPropertySymbols?t=function(w){return Object.getOwnPropertyNames(w).concat(Object.getOwnPropertySymbols(w))}:t=function(w){return Object.getOwnPropertyNames(w)};function n(S){console&&console.warn&&console.warn(S)}var r=Number.isNaN||function(w){return w!==w};function s(){s.init.call(this)}Wp.exports=s,Wp.exports.once=g,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function o(S){if(typeof S!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof S)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(S){if(typeof S!="number"||S<0||r(S))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+S+".");a=S}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(w){if(typeof w!="number"||w<0||r(w))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+w+".");return this._maxListeners=w,this};function l(S){return S._maxListeners===void 0?s.defaultMaxListeners:S._maxListeners}s.prototype.getMaxListeners=function(){return l(this)},s.prototype.emit=function(w){for(var T=[],R=1;R<arguments.length;R++)T.push(arguments[R]);var U=w==="error",A=this._events;if(A!==void 0)U=U&&A.error===void 0;else if(!U)return!1;if(U){var D;if(T.length>0&&(D=T[0]),D instanceof Error)throw D;var L=new Error("Unhandled error."+(D?" ("+D.message+")":""));throw L.context=D,L}var P=A[w];if(P===void 0)return!1;if(typeof P=="function")e(P,this,T);else for(var I=P.length,V=v(P,I),R=0;R<I;++R)e(V[R],this,T);return!0};function c(S,w,T,R){var U,A,D;if(o(T),A=S._events,A===void 0?(A=S._events=Object.create(null),S._eventsCount=0):(A.newListener!==void 0&&(S.emit("newListener",w,T.listener?T.listener:T),A=S._events),D=A[w]),D===void 0)D=A[w]=T,++S._eventsCount;else if(typeof D=="function"?D=A[w]=R?[T,D]:[D,T]:R?D.unshift(T):D.push(T),U=l(S),U>0&&D.length>U&&!D.warned){D.warned=!0;var L=new Error("Possible EventEmitter memory leak detected. "+D.length+" "+String(w)+" listeners added. Use emitter.setMaxListeners() to increase limit");L.name="MaxListenersExceededWarning",L.emitter=S,L.type=w,L.count=D.length,n(L)}return S}s.prototype.addListener=function(w,T){return c(this,w,T,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(w,T){return c(this,w,T,!0)};function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(S,w,T){var R={fired:!1,wrapFn:void 0,target:S,type:w,listener:T},U=h.bind(R);return U.listener=T,R.wrapFn=U,U}s.prototype.once=function(w,T){return o(T),this.on(w,d(this,w,T)),this},s.prototype.prependOnceListener=function(w,T){return o(T),this.prependListener(w,d(this,w,T)),this},s.prototype.removeListener=function(w,T){var R,U,A,D,L;if(o(T),U=this._events,U===void 0)return this;if(R=U[w],R===void 0)return this;if(R===T||R.listener===T)--this._eventsCount===0?this._events=Object.create(null):(delete U[w],U.removeListener&&this.emit("removeListener",w,R.listener||T));else if(typeof R!="function"){for(A=-1,D=R.length-1;D>=0;D--)if(R[D]===T||R[D].listener===T){L=R[D].listener,A=D;break}if(A<0)return this;A===0?R.shift():x(R,A),R.length===1&&(U[w]=R[0]),U.removeListener!==void 0&&this.emit("removeListener",w,L||T)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(w){var T,R,U;if(R=this._events,R===void 0)return this;if(R.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):R[w]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete R[w]),this;if(arguments.length===0){var A=Object.keys(R),D;for(U=0;U<A.length;++U)D=A[U],D!=="removeListener"&&this.removeAllListeners(D);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(T=R[w],typeof T=="function")this.removeListener(w,T);else if(T!==void 0)for(U=T.length-1;U>=0;U--)this.removeListener(w,T[U]);return this};function p(S,w,T){var R=S._events;if(R===void 0)return[];var U=R[w];return U===void 0?[]:typeof U=="function"?T?[U.listener||U]:[U]:T?_(U):v(U,U.length)}s.prototype.listeners=function(w){return p(this,w,!0)},s.prototype.rawListeners=function(w){return p(this,w,!1)},s.listenerCount=function(S,w){return typeof S.listenerCount=="function"?S.listenerCount(w):m.call(S,w)},s.prototype.listenerCount=m;function m(S){var w=this._events;if(w!==void 0){var T=w[S];if(typeof T=="function")return 1;if(T!==void 0)return T.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function v(S,w){for(var T=new Array(w),R=0;R<w;++R)T[R]=S[R];return T}function x(S,w){for(;w+1<S.length;w++)S[w]=S[w+1];S.pop()}function _(S){for(var w=new Array(S.length),T=0;T<w.length;++T)w[T]=S[T].listener||S[T];return w}function g(S,w){return new Promise(function(T,R){function U(D){S.removeListener(w,A),R(D)}function A(){typeof S.removeListener=="function"&&S.removeListener("error",U),T([].slice.call(arguments))}E(S,w,A,{once:!0}),w!=="error"&&b(S,U,{once:!0})})}function b(S,w,T){typeof S.on=="function"&&E(S,"error",w,T)}function E(S,w,T,R){if(typeof S.on=="function")R.once?S.once(w,T):S.on(w,T);else if(typeof S.addEventListener=="function")S.addEventListener(w,function U(A){R.once&&S.removeEventListener(w,U),T(A)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof S)}return Wp.exports}var X5=W5();function j5(){const i=arguments[0];for(let e=1,t=arguments.length;e<t;e++)if(arguments[e])for(const n in arguments[e])i[n]=arguments[e][n];return i}let ii=j5;typeof Object.assign=="function"&&(ii=Object.assign);function kr(i,e,t,n){const r=i._nodes.get(e);let s=null;return r&&(n==="mixed"?s=r.out&&r.out[t]||r.undirected&&r.undirected[t]:n==="directed"?s=r.out&&r.out[t]:s=r.undirected&&r.undirected[t]),s}function gi(i){return typeof i=="object"&&i!==null}function HC(i){let e;for(e in i)return!1;return!0}function Or(i,e,t){Object.defineProperty(i,e,{enumerable:!1,configurable:!1,writable:!0,value:t})}function $r(i,e,t){const n={enumerable:!0,configurable:!0};typeof t=="function"?n.get=t:(n.value=t,n.writable=!1),Object.defineProperty(i,e,n)}function ew(i){return!(!gi(i)||i.attributes&&!Array.isArray(i.attributes))}function q5(){let i=Math.floor(Math.random()*256)&255;return()=>i++}function va(){const i=arguments;let e=null,t=-1;return{[Symbol.iterator](){return this},next(){let n=null;do{if(e===null){if(t++,t>=i.length)return{done:!0};e=i[t][Symbol.iterator]()}if(n=e.next(),n.done){e=null;continue}break}while(!0);return n}}}function Uu(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}class R1 extends Error{constructor(e){super(),this.name="GraphError",this.message=e}}class ut extends R1{constructor(e){super(e),this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,ut.prototype.constructor)}}class et extends R1{constructor(e){super(e),this.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,et.prototype.constructor)}}class xt extends R1{constructor(e){super(e),this.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,xt.prototype.constructor)}}function VC(i,e){this.key=i,this.attributes=e,this.clear()}VC.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}};function WC(i,e){this.key=i,this.attributes=e,this.clear()}WC.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function XC(i,e){this.key=i,this.attributes=e,this.clear()}XC.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function Ou(i,e,t,n,r){this.key=e,this.attributes=r,this.undirected=i,this.source=t,this.target=n}Ou.prototype.attach=function(){let i="out",e="in";this.undirected&&(i=e="undirected");const t=this.source.key,n=this.target.key;this.source[i][n]=this,!(this.undirected&&t===n)&&(this.target[e][t]=this)};Ou.prototype.attachMulti=function(){let i="out",e="in";const t=this.source.key,n=this.target.key;this.undirected&&(i=e="undirected");const r=this.source[i],s=r[n];if(typeof s>"u"){r[n]=this,this.undirected&&t===n||(this.target[e][t]=this);return}s.previous=this,this.next=s,r[n]=this,this.target[e][t]=this};Ou.prototype.detach=function(){const i=this.source.key,e=this.target.key;let t="out",n="in";this.undirected&&(t=n="undirected"),delete this.source[t][e],delete this.target[n][i]};Ou.prototype.detachMulti=function(){const i=this.source.key,e=this.target.key;let t="out",n="in";this.undirected&&(t=n="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[t][e],delete this.target[n][i]):(this.next.previous=void 0,this.source[t][e]=this.next,this.target[n][i]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};const jC=0,qC=1,Y5=2,YC=3;function Ta(i,e,t,n,r,s,a){let o,l,c,h;if(n=""+n,t===jC){if(o=i._nodes.get(n),!o)throw new et(`Graph.${e}: could not find the "${n}" node in the graph.`);c=r,h=s}else if(t===YC){if(r=""+r,l=i._edges.get(r),!l)throw new et(`Graph.${e}: could not find the "${r}" edge in the graph.`);const d=l.source.key,p=l.target.key;if(n===d)o=l.target;else if(n===p)o=l.source;else throw new et(`Graph.${e}: the "${n}" node is not attached to the "${r}" edge (${d}, ${p}).`);c=s,h=a}else{if(l=i._edges.get(n),!l)throw new et(`Graph.${e}: could not find the "${n}" edge in the graph.`);t===qC?o=l.source:o=l.target,c=r,h=s}return[o,c,h]}function Z5(i,e,t){i.prototype[e]=function(n,r,s){const[a,o]=Ta(this,e,t,n,r,s);return a.attributes[o]}}function K5(i,e,t){i.prototype[e]=function(n,r){const[s]=Ta(this,e,t,n,r);return s.attributes}}function J5(i,e,t){i.prototype[e]=function(n,r,s){const[a,o]=Ta(this,e,t,n,r,s);return a.attributes.hasOwnProperty(o)}}function Q5(i,e,t){i.prototype[e]=function(n,r,s,a){const[o,l,c]=Ta(this,e,t,n,r,s,a);return o.attributes[l]=c,this.emit("nodeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:l}),this}}function $5(i,e,t){i.prototype[e]=function(n,r,s,a){const[o,l,c]=Ta(this,e,t,n,r,s,a);if(typeof c!="function")throw new ut(`Graph.${e}: updater should be a function.`);const h=o.attributes,d=c(h[l]);return h[l]=d,this.emit("nodeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:l}),this}}function ek(i,e,t){i.prototype[e]=function(n,r,s){const[a,o]=Ta(this,e,t,n,r,s);return delete a.attributes[o],this.emit("nodeAttributesUpdated",{key:a.key,type:"remove",attributes:a.attributes,name:o}),this}}function tk(i,e,t){i.prototype[e]=function(n,r,s){const[a,o]=Ta(this,e,t,n,r,s);if(!gi(o))throw new ut(`Graph.${e}: provided attributes are not a plain object.`);return a.attributes=o,this.emit("nodeAttributesUpdated",{key:a.key,type:"replace",attributes:a.attributes}),this}}function nk(i,e,t){i.prototype[e]=function(n,r,s){const[a,o]=Ta(this,e,t,n,r,s);if(!gi(o))throw new ut(`Graph.${e}: provided attributes are not a plain object.`);return ii(a.attributes,o),this.emit("nodeAttributesUpdated",{key:a.key,type:"merge",attributes:a.attributes,data:o}),this}}function ik(i,e,t){i.prototype[e]=function(n,r,s){const[a,o]=Ta(this,e,t,n,r,s);if(typeof o!="function")throw new ut(`Graph.${e}: provided updater is not a function.`);return a.attributes=o(a.attributes),this.emit("nodeAttributesUpdated",{key:a.key,type:"update",attributes:a.attributes}),this}}const rk=[{name:i=>`get${i}Attribute`,attacher:Z5},{name:i=>`get${i}Attributes`,attacher:K5},{name:i=>`has${i}Attribute`,attacher:J5},{name:i=>`set${i}Attribute`,attacher:Q5},{name:i=>`update${i}Attribute`,attacher:$5},{name:i=>`remove${i}Attribute`,attacher:ek},{name:i=>`replace${i}Attributes`,attacher:tk},{name:i=>`merge${i}Attributes`,attacher:nk},{name:i=>`update${i}Attributes`,attacher:ik}];function sk(i){rk.forEach(function({name:e,attacher:t}){t(i,e("Node"),jC),t(i,e("Source"),qC),t(i,e("Target"),Y5),t(i,e("Opposite"),YC)})}function ak(i,e,t){i.prototype[e]=function(n,r){let s;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new xt(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new xt(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+n,o=""+r;if(r=arguments[2],s=kr(this,a,o,t),!s)throw new et(`Graph.${e}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(t!=="mixed")throw new xt(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,s=this._edges.get(n),!s)throw new et(`Graph.${e}: could not find the "${n}" edge in the graph.`)}return s.attributes[r]}}function ok(i,e,t){i.prototype[e]=function(n){let r;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new xt(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new xt(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+n,a=""+arguments[1];if(r=kr(this,s,a,t),!r)throw new et(`Graph.${e}: could not find an edge for the given path ("${s}" - "${a}").`)}else{if(t!=="mixed")throw new xt(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,r=this._edges.get(n),!r)throw new et(`Graph.${e}: could not find the "${n}" edge in the graph.`)}return r.attributes}}function lk(i,e,t){i.prototype[e]=function(n,r){let s;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new xt(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new xt(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+n,o=""+r;if(r=arguments[2],s=kr(this,a,o,t),!s)throw new et(`Graph.${e}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(t!=="mixed")throw new xt(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,s=this._edges.get(n),!s)throw new et(`Graph.${e}: could not find the "${n}" edge in the graph.`)}return s.attributes.hasOwnProperty(r)}}function ck(i,e,t){i.prototype[e]=function(n,r,s){let a;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new xt(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new xt(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+n,l=""+r;if(r=arguments[2],s=arguments[3],a=kr(this,o,l,t),!a)throw new et(`Graph.${e}: could not find an edge for the given path ("${o}" - "${l}").`)}else{if(t!=="mixed")throw new xt(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,a=this._edges.get(n),!a)throw new et(`Graph.${e}: could not find the "${n}" edge in the graph.`)}return a.attributes[r]=s,this.emit("edgeAttributesUpdated",{key:a.key,type:"set",attributes:a.attributes,name:r}),this}}function uk(i,e,t){i.prototype[e]=function(n,r,s){let a;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new xt(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new xt(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+n,l=""+r;if(r=arguments[2],s=arguments[3],a=kr(this,o,l,t),!a)throw new et(`Graph.${e}: could not find an edge for the given path ("${o}" - "${l}").`)}else{if(t!=="mixed")throw new xt(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,a=this._edges.get(n),!a)throw new et(`Graph.${e}: could not find the "${n}" edge in the graph.`)}if(typeof s!="function")throw new ut(`Graph.${e}: updater should be a function.`);return a.attributes[r]=s(a.attributes[r]),this.emit("edgeAttributesUpdated",{key:a.key,type:"set",attributes:a.attributes,name:r}),this}}function hk(i,e,t){i.prototype[e]=function(n,r){let s;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new xt(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new xt(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+n,o=""+r;if(r=arguments[2],s=kr(this,a,o,t),!s)throw new et(`Graph.${e}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(t!=="mixed")throw new xt(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,s=this._edges.get(n),!s)throw new et(`Graph.${e}: could not find the "${n}" edge in the graph.`)}return delete s.attributes[r],this.emit("edgeAttributesUpdated",{key:s.key,type:"remove",attributes:s.attributes,name:r}),this}}function fk(i,e,t){i.prototype[e]=function(n,r){let s;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new xt(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new xt(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+n,o=""+r;if(r=arguments[2],s=kr(this,a,o,t),!s)throw new et(`Graph.${e}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(t!=="mixed")throw new xt(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,s=this._edges.get(n),!s)throw new et(`Graph.${e}: could not find the "${n}" edge in the graph.`)}if(!gi(r))throw new ut(`Graph.${e}: provided attributes are not a plain object.`);return s.attributes=r,this.emit("edgeAttributesUpdated",{key:s.key,type:"replace",attributes:s.attributes}),this}}function dk(i,e,t){i.prototype[e]=function(n,r){let s;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new xt(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new xt(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+n,o=""+r;if(r=arguments[2],s=kr(this,a,o,t),!s)throw new et(`Graph.${e}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(t!=="mixed")throw new xt(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,s=this._edges.get(n),!s)throw new et(`Graph.${e}: could not find the "${n}" edge in the graph.`)}if(!gi(r))throw new ut(`Graph.${e}: provided attributes are not a plain object.`);return ii(s.attributes,r),this.emit("edgeAttributesUpdated",{key:s.key,type:"merge",attributes:s.attributes,data:r}),this}}function pk(i,e,t){i.prototype[e]=function(n,r){let s;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new xt(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new xt(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+n,o=""+r;if(r=arguments[2],s=kr(this,a,o,t),!s)throw new et(`Graph.${e}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(t!=="mixed")throw new xt(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,s=this._edges.get(n),!s)throw new et(`Graph.${e}: could not find the "${n}" edge in the graph.`)}if(typeof r!="function")throw new ut(`Graph.${e}: provided updater is not a function.`);return s.attributes=r(s.attributes),this.emit("edgeAttributesUpdated",{key:s.key,type:"update",attributes:s.attributes}),this}}const mk=[{name:i=>`get${i}Attribute`,attacher:ak},{name:i=>`get${i}Attributes`,attacher:ok},{name:i=>`has${i}Attribute`,attacher:lk},{name:i=>`set${i}Attribute`,attacher:ck},{name:i=>`update${i}Attribute`,attacher:uk},{name:i=>`remove${i}Attribute`,attacher:hk},{name:i=>`replace${i}Attributes`,attacher:fk},{name:i=>`merge${i}Attributes`,attacher:dk},{name:i=>`update${i}Attributes`,attacher:pk}];function gk(i){mk.forEach(function({name:e,attacher:t}){t(i,e("Edge"),"mixed"),t(i,e("DirectedEdge"),"directed"),t(i,e("UndirectedEdge"),"undirected")})}const vk=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function yk(i,e,t,n){let r=!1;for(const s in e){if(s===n)continue;const a=e[s];if(r=t(a.key,a.attributes,a.source.key,a.target.key,a.source.attributes,a.target.attributes,a.undirected),i&&r)return a.key}}function _k(i,e,t,n){let r,s,a,o=!1;for(const l in e)if(l!==n){r=e[l];do{if(s=r.source,a=r.target,o=t(r.key,r.attributes,s.key,a.key,s.attributes,a.attributes,r.undirected),i&&o)return r.key;r=r.next}while(r!==void 0)}}function $y(i,e){const t=Object.keys(i),n=t.length;let r,s=0;return{[Symbol.iterator](){return this},next(){do if(r)r=r.next;else{if(s>=n)return{done:!0};const a=t[s++];if(a===e){r=void 0;continue}r=i[a]}while(!r);return{done:!1,value:{edge:r.key,attributes:r.attributes,source:r.source.key,target:r.target.key,sourceAttributes:r.source.attributes,targetAttributes:r.target.attributes,undirected:r.undirected}}}}}function xk(i,e,t,n){const r=e[t];if(!r)return;const s=r.source,a=r.target;if(n(r.key,r.attributes,s.key,a.key,s.attributes,a.attributes,r.undirected)&&i)return r.key}function bk(i,e,t,n){let r=e[t];if(!r)return;let s=!1;do{if(s=n(r.key,r.attributes,r.source.key,r.target.key,r.source.attributes,r.target.attributes,r.undirected),i&&s)return r.key;r=r.next}while(r!==void 0)}function e_(i,e){let t=i[e];if(t.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!t)return{done:!0};const r={edge:t.key,attributes:t.attributes,source:t.source.key,target:t.target.key,sourceAttributes:t.source.attributes,targetAttributes:t.target.attributes,undirected:t.undirected};return t=t.next,{done:!1,value:r}}};let n=!1;return{[Symbol.iterator](){return this},next(){return n===!0?{done:!0}:(n=!0,{done:!1,value:{edge:t.key,attributes:t.attributes,source:t.source.key,target:t.target.key,sourceAttributes:t.source.attributes,targetAttributes:t.target.attributes,undirected:t.undirected}})}}}function Sk(i,e){if(i.size===0)return[];if(e==="mixed"||e===i.type)return Array.from(i._edges.keys());const t=e==="undirected"?i.undirectedSize:i.directedSize,n=new Array(t),r=e==="undirected",s=i._edges.values();let a=0,o,l;for(;o=s.next(),o.done!==!0;)l=o.value,l.undirected===r&&(n[a++]=l.key);return n}function ZC(i,e,t,n){if(e.size===0)return;const r=t!=="mixed"&&t!==e.type,s=t==="undirected";let a,o,l=!1;const c=e._edges.values();for(;a=c.next(),a.done!==!0;){if(o=a.value,r&&o.undirected!==s)continue;const{key:h,attributes:d,source:p,target:m}=o;if(l=n(h,d,p.key,m.key,p.attributes,m.attributes,o.undirected),i&&l)return h}}function Ek(i,e){if(i.size===0)return Uu();const t=e!=="mixed"&&e!==i.type,n=e==="undirected",r=i._edges.values();return{[Symbol.iterator](){return this},next(){let s,a;for(;;){if(s=r.next(),s.done)return s;if(a=s.value,!(t&&a.undirected!==n))break}return{value:{edge:a.key,attributes:a.attributes,source:a.source.key,target:a.target.key,sourceAttributes:a.source.attributes,targetAttributes:a.target.attributes,undirected:a.undirected},done:!1}}}}function D1(i,e,t,n,r,s){const a=e?_k:yk;let o;if(t!=="undirected"&&(n!=="out"&&(o=a(i,r.in,s),i&&o)||n!=="in"&&(o=a(i,r.out,s,n?void 0:r.key),i&&o))||t!=="directed"&&(o=a(i,r.undirected,s),i&&o))return o}function Mk(i,e,t,n){const r=[];return D1(!1,i,e,t,n,function(s){r.push(s)}),r}function wk(i,e,t){let n=Uu();return i!=="undirected"&&(e!=="out"&&typeof t.in<"u"&&(n=va(n,$y(t.in))),e!=="in"&&typeof t.out<"u"&&(n=va(n,$y(t.out,e?void 0:t.key)))),i!=="directed"&&typeof t.undirected<"u"&&(n=va(n,$y(t.undirected))),n}function U1(i,e,t,n,r,s,a){const o=t?bk:xk;let l;if(e!=="undirected"&&(typeof r.in<"u"&&n!=="out"&&(l=o(i,r.in,s,a),i&&l)||typeof r.out<"u"&&n!=="in"&&(n||r.key!==s)&&(l=o(i,r.out,s,a),i&&l))||e!=="directed"&&typeof r.undirected<"u"&&(l=o(i,r.undirected,s,a),i&&l))return l}function Tk(i,e,t,n,r){const s=[];return U1(!1,i,e,t,n,r,function(a){s.push(a)}),s}function Ak(i,e,t,n){let r=Uu();return i!=="undirected"&&(typeof t.in<"u"&&e!=="out"&&n in t.in&&(r=va(r,e_(t.in,n))),typeof t.out<"u"&&e!=="in"&&n in t.out&&(e||t.key!==n)&&(r=va(r,e_(t.out,n)))),i!=="directed"&&typeof t.undirected<"u"&&n in t.undirected&&(r=va(r,e_(t.undirected,n))),r}function Ck(i,e){const{name:t,type:n,direction:r}=e;i.prototype[t]=function(s,a){if(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)return[];if(!arguments.length)return Sk(this,n);if(arguments.length===1){s=""+s;const o=this._nodes.get(s);if(typeof o>"u")throw new et(`Graph.${t}: could not find the "${s}" node in the graph.`);return Mk(this.multi,n==="mixed"?this.type:n,r,o)}if(arguments.length===2){s=""+s,a=""+a;const o=this._nodes.get(s);if(!o)throw new et(`Graph.${t}: could not find the "${s}" source node in the graph.`);if(!this._nodes.has(a))throw new et(`Graph.${t}: could not find the "${a}" target node in the graph.`);return Tk(n,this.multi,r,o,a)}throw new ut(`Graph.${t}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function Rk(i,e){const{name:t,type:n,direction:r}=e,s="forEach"+t[0].toUpperCase()+t.slice(1,-1);i.prototype[s]=function(c,h,d){if(!(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)){if(arguments.length===1)return d=c,ZC(!1,this,n,d);if(arguments.length===2){c=""+c,d=h;const p=this._nodes.get(c);if(typeof p>"u")throw new et(`Graph.${s}: could not find the "${c}" node in the graph.`);return D1(!1,this.multi,n==="mixed"?this.type:n,r,p,d)}if(arguments.length===3){c=""+c,h=""+h;const p=this._nodes.get(c);if(!p)throw new et(`Graph.${s}: could not find the "${c}" source node in the graph.`);if(!this._nodes.has(h))throw new et(`Graph.${s}: could not find the "${h}" target node in the graph.`);return U1(!1,n,this.multi,r,p,h,d)}throw new ut(`Graph.${s}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};const a="map"+t[0].toUpperCase()+t.slice(1);i.prototype[a]=function(){const c=Array.prototype.slice.call(arguments),h=c.pop();let d;if(c.length===0){let p=0;n!=="directed"&&(p+=this.undirectedSize),n!=="undirected"&&(p+=this.directedSize),d=new Array(p);let m=0;c.push((v,x,_,g,b,E,S)=>{d[m++]=h(v,x,_,g,b,E,S)})}else d=[],c.push((p,m,v,x,_,g,b)=>{d.push(h(p,m,v,x,_,g,b))});return this[s].apply(this,c),d};const o="filter"+t[0].toUpperCase()+t.slice(1);i.prototype[o]=function(){const c=Array.prototype.slice.call(arguments),h=c.pop(),d=[];return c.push((p,m,v,x,_,g,b)=>{h(p,m,v,x,_,g,b)&&d.push(p)}),this[s].apply(this,c),d};const l="reduce"+t[0].toUpperCase()+t.slice(1);i.prototype[l]=function(){let c=Array.prototype.slice.call(arguments);if(c.length<2||c.length>4)throw new ut(`Graph.${l}: invalid number of arguments (expecting 2, 3 or 4 and got ${c.length}).`);if(typeof c[c.length-1]=="function"&&typeof c[c.length-2]!="function")throw new ut(`Graph.${l}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let h,d;c.length===2?(h=c[0],d=c[1],c=[]):c.length===3?(h=c[1],d=c[2],c=[c[0]]):c.length===4&&(h=c[2],d=c[3],c=[c[0],c[1]]);let p=d;return c.push((m,v,x,_,g,b,E)=>{p=h(p,m,v,x,_,g,b,E)}),this[s].apply(this,c),p}}function Dk(i,e){const{name:t,type:n,direction:r}=e,s="find"+t[0].toUpperCase()+t.slice(1,-1);i.prototype[s]=function(l,c,h){if(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)return!1;if(arguments.length===1)return h=l,ZC(!0,this,n,h);if(arguments.length===2){l=""+l,h=c;const d=this._nodes.get(l);if(typeof d>"u")throw new et(`Graph.${s}: could not find the "${l}" node in the graph.`);return D1(!0,this.multi,n==="mixed"?this.type:n,r,d,h)}if(arguments.length===3){l=""+l,c=""+c;const d=this._nodes.get(l);if(!d)throw new et(`Graph.${s}: could not find the "${l}" source node in the graph.`);if(!this._nodes.has(c))throw new et(`Graph.${s}: could not find the "${c}" target node in the graph.`);return U1(!0,n,this.multi,r,d,c,h)}throw new ut(`Graph.${s}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};const a="some"+t[0].toUpperCase()+t.slice(1,-1);i.prototype[a]=function(){const l=Array.prototype.slice.call(arguments),c=l.pop();return l.push((d,p,m,v,x,_,g)=>c(d,p,m,v,x,_,g)),!!this[s].apply(this,l)};const o="every"+t[0].toUpperCase()+t.slice(1,-1);i.prototype[o]=function(){const l=Array.prototype.slice.call(arguments),c=l.pop();return l.push((d,p,m,v,x,_,g)=>!c(d,p,m,v,x,_,g)),!this[s].apply(this,l)}}function Uk(i,e){const{name:t,type:n,direction:r}=e,s=t.slice(0,-1)+"Entries";i.prototype[s]=function(a,o){if(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)return Uu();if(!arguments.length)return Ek(this,n);if(arguments.length===1){a=""+a;const l=this._nodes.get(a);if(!l)throw new et(`Graph.${s}: could not find the "${a}" node in the graph.`);return wk(n,r,l)}if(arguments.length===2){a=""+a,o=""+o;const l=this._nodes.get(a);if(!l)throw new et(`Graph.${s}: could not find the "${a}" source node in the graph.`);if(!this._nodes.has(o))throw new et(`Graph.${s}: could not find the "${o}" target node in the graph.`);return Ak(n,r,l,o)}throw new ut(`Graph.${s}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function Ok(i){vk.forEach(e=>{Ck(i,e),Rk(i,e),Dk(i,e),Uk(i,e)})}const Lk=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function f0(){this.A=null,this.B=null}f0.prototype.wrap=function(i){this.A===null?this.A=i:this.B===null&&(this.B=i)};f0.prototype.has=function(i){return this.A!==null&&i in this.A||this.B!==null&&i in this.B};function Rh(i,e,t,n,r){for(const s in n){const a=n[s],o=a.source,l=a.target,c=o===t?l:o;if(e&&e.has(c.key))continue;const h=r(c.key,c.attributes);if(i&&h)return c.key}}function O1(i,e,t,n,r){if(e!=="mixed"){if(e==="undirected")return Rh(i,null,n,n.undirected,r);if(typeof t=="string")return Rh(i,null,n,n[t],r)}const s=new f0;let a;if(e!=="undirected"){if(t!=="out"){if(a=Rh(i,null,n,n.in,r),i&&a)return a;s.wrap(n.in)}if(t!=="in"){if(a=Rh(i,s,n,n.out,r),i&&a)return a;s.wrap(n.out)}}if(e!=="directed"&&(a=Rh(i,s,n,n.undirected,r),i&&a))return a}function Ik(i,e,t){if(i!=="mixed"){if(i==="undirected")return Object.keys(t.undirected);if(typeof e=="string")return Object.keys(t[e])}const n=[];return O1(!1,i,e,t,function(r){n.push(r)}),n}function Dh(i,e,t){const n=Object.keys(t),r=n.length;let s=0;return{[Symbol.iterator](){return this},next(){let a=null;do{if(s>=r)return i&&i.wrap(t),{done:!0};const o=t[n[s++]],l=o.source,c=o.target;if(a=l===e?c:l,i&&i.has(a.key)){a=null;continue}}while(a===null);return{done:!1,value:{neighbor:a.key,attributes:a.attributes}}}}}function Nk(i,e,t){if(i!=="mixed"){if(i==="undirected")return Dh(null,t,t.undirected);if(typeof e=="string")return Dh(null,t,t[e])}let n=Uu();const r=new f0;return i!=="undirected"&&(e!=="out"&&(n=va(n,Dh(r,t,t.in))),e!=="in"&&(n=va(n,Dh(r,t,t.out)))),i!=="directed"&&(n=va(n,Dh(r,t,t.undirected))),n}function Pk(i,e){const{name:t,type:n,direction:r}=e;i.prototype[t]=function(s){if(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)return[];s=""+s;const a=this._nodes.get(s);if(typeof a>"u")throw new et(`Graph.${t}: could not find the "${s}" node in the graph.`);return Ik(n==="mixed"?this.type:n,r,a)}}function zk(i,e){const{name:t,type:n,direction:r}=e,s="forEach"+t[0].toUpperCase()+t.slice(1,-1);i.prototype[s]=function(c,h){if(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)return;c=""+c;const d=this._nodes.get(c);if(typeof d>"u")throw new et(`Graph.${s}: could not find the "${c}" node in the graph.`);O1(!1,n==="mixed"?this.type:n,r,d,h)};const a="map"+t[0].toUpperCase()+t.slice(1);i.prototype[a]=function(c,h){const d=[];return this[s](c,(p,m)=>{d.push(h(p,m))}),d};const o="filter"+t[0].toUpperCase()+t.slice(1);i.prototype[o]=function(c,h){const d=[];return this[s](c,(p,m)=>{h(p,m)&&d.push(p)}),d};const l="reduce"+t[0].toUpperCase()+t.slice(1);i.prototype[l]=function(c,h,d){if(arguments.length<3)throw new ut(`Graph.${l}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let p=d;return this[s](c,(m,v)=>{p=h(p,m,v)}),p}}function Fk(i,e){const{name:t,type:n,direction:r}=e,s=t[0].toUpperCase()+t.slice(1,-1),a="find"+s;i.prototype[a]=function(c,h){if(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)return;c=""+c;const d=this._nodes.get(c);if(typeof d>"u")throw new et(`Graph.${a}: could not find the "${c}" node in the graph.`);return O1(!0,n==="mixed"?this.type:n,r,d,h)};const o="some"+s;i.prototype[o]=function(c,h){return!!this[a](c,h)};const l="every"+s;i.prototype[l]=function(c,h){return!this[a](c,(p,m)=>!h(p,m))}}function Bk(i,e){const{name:t,type:n,direction:r}=e,s=t.slice(0,-1)+"Entries";i.prototype[s]=function(a){if(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)return Uu();a=""+a;const o=this._nodes.get(a);if(typeof o>"u")throw new et(`Graph.${s}: could not find the "${a}" node in the graph.`);return Nk(n==="mixed"?this.type:n,r,o)}}function kk(i){Lk.forEach(e=>{Pk(i,e),zk(i,e),Fk(i,e),Bk(i,e)})}function Xp(i,e,t,n,r){const s=n._nodes.values(),a=n.type;let o,l,c,h,d,p;for(;o=s.next(),o.done!==!0;){let m=!1;if(l=o.value,a!=="undirected"){h=l.out;for(c in h){d=h[c];do p=d.target,m=!0,r(l.key,p.key,l.attributes,p.attributes,d.key,d.attributes,d.undirected),d=d.next;while(d)}}if(a!=="directed"){h=l.undirected;for(c in h)if(!(e&&l.key>c)){d=h[c];do p=d.target,p.key!==c&&(p=d.source),m=!0,r(l.key,p.key,l.attributes,p.attributes,d.key,d.attributes,d.undirected),d=d.next;while(d)}}t&&!m&&r(l.key,null,l.attributes,null,null,null,null)}}function Gk(i,e){const t={key:i};return HC(e.attributes)||(t.attributes=ii({},e.attributes)),t}function Hk(i,e,t){const n={key:e,source:t.source.key,target:t.target.key};return HC(t.attributes)||(n.attributes=ii({},t.attributes)),i==="mixed"&&t.undirected&&(n.undirected=!0),n}function Vk(i){if(!gi(i))throw new ut('Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if(!("key"in i))throw new ut("Graph.import: serialized node is missing its key.");if("attributes"in i&&(!gi(i.attributes)||i.attributes===null))throw new ut("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function Wk(i){if(!gi(i))throw new ut('Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if(!("source"in i))throw new ut("Graph.import: serialized edge is missing its source.");if(!("target"in i))throw new ut("Graph.import: serialized edge is missing its target.");if("attributes"in i&&(!gi(i.attributes)||i.attributes===null))throw new ut("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in i&&typeof i.undirected!="boolean")throw new ut("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}const Xk=q5(),jk=new Set(["directed","undirected","mixed"]),tw=new Set(["domain","_events","_eventsCount","_maxListeners"]),qk=[{name:i=>`${i}Edge`,generateKey:!0},{name:i=>`${i}DirectedEdge`,generateKey:!0,type:"directed"},{name:i=>`${i}UndirectedEdge`,generateKey:!0,type:"undirected"},{name:i=>`${i}EdgeWithKey`},{name:i=>`${i}DirectedEdgeWithKey`,type:"directed"},{name:i=>`${i}UndirectedEdgeWithKey`,type:"undirected"}],Yk={allowSelfLoops:!0,multi:!1,type:"mixed"};function Zk(i,e,t){if(t&&!gi(t))throw new ut(`Graph.addNode: invalid attributes. Expecting an object but got "${t}"`);if(e=""+e,t=t||{},i._nodes.has(e))throw new xt(`Graph.addNode: the "${e}" node already exist in the graph.`);const n=new i.NodeDataClass(e,t);return i._nodes.set(e,n),i.emit("nodeAdded",{key:e,attributes:t}),n}function nw(i,e,t){const n=new i.NodeDataClass(e,t);return i._nodes.set(e,n),i.emit("nodeAdded",{key:e,attributes:t}),n}function KC(i,e,t,n,r,s,a,o){if(!n&&i.type==="undirected")throw new xt(`Graph.${e}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(n&&i.type==="directed")throw new xt(`Graph.${e}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(o&&!gi(o))throw new ut(`Graph.${e}: invalid attributes. Expecting an object but got "${o}"`);if(s=""+s,a=""+a,o=o||{},!i.allowSelfLoops&&s===a)throw new xt(`Graph.${e}: source & target are the same ("${s}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);const l=i._nodes.get(s),c=i._nodes.get(a);if(!l)throw new et(`Graph.${e}: source node "${s}" not found.`);if(!c)throw new et(`Graph.${e}: target node "${a}" not found.`);const h={key:null,undirected:n,source:s,target:a,attributes:o};if(t)r=i._edgeKeyGenerator();else if(r=""+r,i._edges.has(r))throw new xt(`Graph.${e}: the "${r}" edge already exists in the graph.`);if(!i.multi&&(n?typeof l.undirected[a]<"u":typeof l.out[a]<"u"))throw new xt(`Graph.${e}: an edge linking "${s}" to "${a}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);const d=new Ou(n,r,l,c,o);i._edges.set(r,d);const p=s===a;return n?(l.undirectedDegree++,c.undirectedDegree++,p&&(l.undirectedLoops++,i._undirectedSelfLoopCount++)):(l.outDegree++,c.inDegree++,p&&(l.directedLoops++,i._directedSelfLoopCount++)),i.multi?d.attachMulti():d.attach(),n?i._undirectedSize++:i._directedSize++,h.key=r,i.emit("edgeAdded",h),r}function Kk(i,e,t,n,r,s,a,o,l){if(!n&&i.type==="undirected")throw new xt(`Graph.${e}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(n&&i.type==="directed")throw new xt(`Graph.${e}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(o){if(l){if(typeof o!="function")throw new ut(`Graph.${e}: invalid updater function. Expecting a function but got "${o}"`)}else if(!gi(o))throw new ut(`Graph.${e}: invalid attributes. Expecting an object but got "${o}"`)}s=""+s,a=""+a;let c;if(l&&(c=o,o=void 0),!i.allowSelfLoops&&s===a)throw new xt(`Graph.${e}: source & target are the same ("${s}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let h=i._nodes.get(s),d=i._nodes.get(a),p,m;if(!t&&(p=i._edges.get(r),p)){if((p.source.key!==s||p.target.key!==a)&&(!n||p.source.key!==a||p.target.key!==s))throw new xt(`Graph.${e}: inconsistency detected when attempting to merge the "${r}" edge with "${s}" source & "${a}" target vs. ("${p.source.key}", "${p.target.key}").`);m=p}if(!m&&!i.multi&&h&&(m=n?h.undirected[a]:h.out[a]),m){const b=[m.key,!1,!1,!1];if(l?!c:!o)return b;if(l){const E=m.attributes;m.attributes=c(E),i.emit("edgeAttributesUpdated",{type:"replace",key:m.key,attributes:m.attributes})}else ii(m.attributes,o),i.emit("edgeAttributesUpdated",{type:"merge",key:m.key,attributes:m.attributes,data:o});return b}o=o||{},l&&c&&(o=c(o));const v={key:null,undirected:n,source:s,target:a,attributes:o};if(t)r=i._edgeKeyGenerator();else if(r=""+r,i._edges.has(r))throw new xt(`Graph.${e}: the "${r}" edge already exists in the graph.`);let x=!1,_=!1;h||(h=nw(i,s,{}),x=!0,s===a&&(d=h,_=!0)),d||(d=nw(i,a,{}),_=!0),p=new Ou(n,r,h,d,o),i._edges.set(r,p);const g=s===a;return n?(h.undirectedDegree++,d.undirectedDegree++,g&&(h.undirectedLoops++,i._undirectedSelfLoopCount++)):(h.outDegree++,d.inDegree++,g&&(h.directedLoops++,i._directedSelfLoopCount++)),i.multi?p.attachMulti():p.attach(),n?i._undirectedSize++:i._directedSize++,v.key=r,i.emit("edgeAdded",v),[r,!0,x,_]}function Wc(i,e){i._edges.delete(e.key);const{source:t,target:n,attributes:r}=e,s=e.undirected,a=t===n;s?(t.undirectedDegree--,n.undirectedDegree--,a&&(t.undirectedLoops--,i._undirectedSelfLoopCount--)):(t.outDegree--,n.inDegree--,a&&(t.directedLoops--,i._directedSelfLoopCount--)),i.multi?e.detachMulti():e.detach(),s?i._undirectedSize--:i._directedSize--,i.emit("edgeDropped",{key:e.key,attributes:r,source:t.key,target:n.key,undirected:s})}class un extends X5.EventEmitter{constructor(e){if(super(),e=ii({},Yk,e),typeof e.multi!="boolean")throw new ut(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${e.multi}".`);if(!jk.has(e.type))throw new ut(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${e.type}".`);if(typeof e.allowSelfLoops!="boolean")throw new ut(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${e.allowSelfLoops}".`);const t=e.type==="mixed"?VC:e.type==="directed"?WC:XC;Or(this,"NodeDataClass",t);const n="geid_"+Xk()+"_";let r=0;const s=()=>{let a;do a=n+r++;while(this._edges.has(a));return a};Or(this,"_attributes",{}),Or(this,"_nodes",new Map),Or(this,"_edges",new Map),Or(this,"_directedSize",0),Or(this,"_undirectedSize",0),Or(this,"_directedSelfLoopCount",0),Or(this,"_undirectedSelfLoopCount",0),Or(this,"_edgeKeyGenerator",s),Or(this,"_options",e),tw.forEach(a=>Or(this,a,this[a])),$r(this,"order",()=>this._nodes.size),$r(this,"size",()=>this._edges.size),$r(this,"directedSize",()=>this._directedSize),$r(this,"undirectedSize",()=>this._undirectedSize),$r(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),$r(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),$r(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),$r(this,"multi",this._options.multi),$r(this,"type",this._options.type),$r(this,"allowSelfLoops",this._options.allowSelfLoops),$r(this,"implementation",()=>"graphology")}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(e){return this._nodes.has(""+e)}hasDirectedEdge(e,t){if(this.type==="undirected")return!1;if(arguments.length===1){const n=""+e,r=this._edges.get(n);return!!r&&!r.undirected}else if(arguments.length===2){e=""+e,t=""+t;const n=this._nodes.get(e);return n?n.out.hasOwnProperty(t):!1}throw new ut(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(e,t){if(this.type==="directed")return!1;if(arguments.length===1){const n=""+e,r=this._edges.get(n);return!!r&&r.undirected}else if(arguments.length===2){e=""+e,t=""+t;const n=this._nodes.get(e);return n?n.undirected.hasOwnProperty(t):!1}throw new ut(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(e,t){if(arguments.length===1){const n=""+e;return this._edges.has(n)}else if(arguments.length===2){e=""+e,t=""+t;const n=this._nodes.get(e);return n?typeof n.out<"u"&&n.out.hasOwnProperty(t)||typeof n.undirected<"u"&&n.undirected.hasOwnProperty(t):!1}throw new ut(`Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}directedEdge(e,t){if(this.type==="undirected")return;if(e=""+e,t=""+t,this.multi)throw new xt("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");const n=this._nodes.get(e);if(!n)throw new et(`Graph.directedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new et(`Graph.directedEdge: could not find the "${t}" target node in the graph.`);const r=n.out&&n.out[t]||void 0;if(r)return r.key}undirectedEdge(e,t){if(this.type==="directed")return;if(e=""+e,t=""+t,this.multi)throw new xt("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");const n=this._nodes.get(e);if(!n)throw new et(`Graph.undirectedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new et(`Graph.undirectedEdge: could not find the "${t}" target node in the graph.`);const r=n.undirected&&n.undirected[t]||void 0;if(r)return r.key}edge(e,t){if(this.multi)throw new xt("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new et(`Graph.edge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new et(`Graph.edge: could not find the "${t}" target node in the graph.`);const r=n.out&&n.out[t]||n.undirected&&n.undirected[t]||void 0;if(r)return r.key}areDirectedNeighbors(e,t){e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new et(`Graph.areDirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type==="undirected"?!1:t in n.in||t in n.out}areOutNeighbors(e,t){e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new et(`Graph.areOutNeighbors: could not find the "${e}" node in the graph.`);return this.type==="undirected"?!1:t in n.out}areInNeighbors(e,t){e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new et(`Graph.areInNeighbors: could not find the "${e}" node in the graph.`);return this.type==="undirected"?!1:t in n.in}areUndirectedNeighbors(e,t){e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new et(`Graph.areUndirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type==="directed"?!1:t in n.undirected}areNeighbors(e,t){e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new et(`Graph.areNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&(t in n.in||t in n.out)||this.type!=="directed"&&t in n.undirected}areInboundNeighbors(e,t){e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new et(`Graph.areInboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&t in n.in||this.type!=="directed"&&t in n.undirected}areOutboundNeighbors(e,t){e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new et(`Graph.areOutboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&t in n.out||this.type!=="directed"&&t in n.undirected}inDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new et(`Graph.inDegree: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.inDegree}outDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new et(`Graph.outDegree: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.outDegree}directedDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new et(`Graph.directedDegree: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.inDegree+t.outDegree}undirectedDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new et(`Graph.undirectedDegree: could not find the "${e}" node in the graph.`);return this.type==="directed"?0:t.undirectedDegree}inboundDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new et(`Graph.inboundDegree: could not find the "${e}" node in the graph.`);let n=0;return this.type!=="directed"&&(n+=t.undirectedDegree),this.type!=="undirected"&&(n+=t.inDegree),n}outboundDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new et(`Graph.outboundDegree: could not find the "${e}" node in the graph.`);let n=0;return this.type!=="directed"&&(n+=t.undirectedDegree),this.type!=="undirected"&&(n+=t.outDegree),n}degree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new et(`Graph.degree: could not find the "${e}" node in the graph.`);let n=0;return this.type!=="directed"&&(n+=t.undirectedDegree),this.type!=="undirected"&&(n+=t.inDegree+t.outDegree),n}inDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new et(`Graph.inDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.inDegree-t.directedLoops}outDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new et(`Graph.outDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.outDegree-t.directedLoops}directedDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new et(`Graph.directedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.inDegree+t.outDegree-t.directedLoops*2}undirectedDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new et(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="directed"?0:t.undirectedDegree-t.undirectedLoops*2}inboundDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new et(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,r=0;return this.type!=="directed"&&(n+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!=="undirected"&&(n+=t.inDegree,r+=t.directedLoops),n-r}outboundDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new et(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,r=0;return this.type!=="directed"&&(n+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!=="undirected"&&(n+=t.outDegree,r+=t.directedLoops),n-r}degreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new et(`Graph.degreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,r=0;return this.type!=="directed"&&(n+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!=="undirected"&&(n+=t.inDegree+t.outDegree,r+=t.directedLoops*2),n-r}source(e){e=""+e;const t=this._edges.get(e);if(!t)throw new et(`Graph.source: could not find the "${e}" edge in the graph.`);return t.source.key}target(e){e=""+e;const t=this._edges.get(e);if(!t)throw new et(`Graph.target: could not find the "${e}" edge in the graph.`);return t.target.key}extremities(e){e=""+e;const t=this._edges.get(e);if(!t)throw new et(`Graph.extremities: could not find the "${e}" edge in the graph.`);return[t.source.key,t.target.key]}opposite(e,t){e=""+e,t=""+t;const n=this._edges.get(t);if(!n)throw new et(`Graph.opposite: could not find the "${t}" edge in the graph.`);const r=n.source.key,s=n.target.key;if(e===r)return s;if(e===s)return r;throw new et(`Graph.opposite: the "${e}" node is not attached to the "${t}" edge (${r}, ${s}).`)}hasExtremity(e,t){e=""+e,t=""+t;const n=this._edges.get(e);if(!n)throw new et(`Graph.hasExtremity: could not find the "${e}" edge in the graph.`);return n.source.key===t||n.target.key===t}isUndirected(e){e=""+e;const t=this._edges.get(e);if(!t)throw new et(`Graph.isUndirected: could not find the "${e}" edge in the graph.`);return t.undirected}isDirected(e){e=""+e;const t=this._edges.get(e);if(!t)throw new et(`Graph.isDirected: could not find the "${e}" edge in the graph.`);return!t.undirected}isSelfLoop(e){e=""+e;const t=this._edges.get(e);if(!t)throw new et(`Graph.isSelfLoop: could not find the "${e}" edge in the graph.`);return t.source===t.target}addNode(e,t){return Zk(this,e,t).key}mergeNode(e,t){if(t&&!gi(t))throw new ut(`Graph.mergeNode: invalid attributes. Expecting an object but got "${t}"`);e=""+e,t=t||{};let n=this._nodes.get(e);return n?(t&&(ii(n.attributes,t),this.emit("nodeAttributesUpdated",{type:"merge",key:e,attributes:n.attributes,data:t})),[e,!1]):(n=new this.NodeDataClass(e,t),this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:t}),[e,!0])}updateNode(e,t){if(t&&typeof t!="function")throw new ut(`Graph.updateNode: invalid updater function. Expecting a function but got "${t}"`);e=""+e;let n=this._nodes.get(e);if(n){if(t){const s=n.attributes;n.attributes=t(s),this.emit("nodeAttributesUpdated",{type:"replace",key:e,attributes:n.attributes})}return[e,!1]}const r=t?t({}):{};return n=new this.NodeDataClass(e,r),this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:r}),[e,!0]}dropNode(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new et(`Graph.dropNode: could not find the "${e}" node in the graph.`);let n;if(this.type!=="undirected"){for(const r in t.out){n=t.out[r];do Wc(this,n),n=n.next;while(n)}for(const r in t.in){n=t.in[r];do Wc(this,n),n=n.next;while(n)}}if(this.type!=="directed")for(const r in t.undirected){n=t.undirected[r];do Wc(this,n),n=n.next;while(n)}this._nodes.delete(e),this.emit("nodeDropped",{key:e,attributes:t.attributes})}dropEdge(e){let t;if(arguments.length>1){const n=""+arguments[0],r=""+arguments[1];if(t=kr(this,n,r,this.type),!t)throw new et(`Graph.dropEdge: could not find the "${n}" -> "${r}" edge in the graph.`)}else if(e=""+e,t=this._edges.get(e),!t)throw new et(`Graph.dropEdge: could not find the "${e}" edge in the graph.`);return Wc(this,t),this}dropDirectedEdge(e,t){if(arguments.length<2)throw new xt("Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new xt("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");e=""+e,t=""+t;const n=kr(this,e,t,"directed");if(!n)throw new et(`Graph.dropDirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return Wc(this,n),this}dropUndirectedEdge(e,t){if(arguments.length<2)throw new xt("Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new xt("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");const n=kr(this,e,t,"undirected");if(!n)throw new et(`Graph.dropUndirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return Wc(this,n),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")}clearEdges(){const e=this._nodes.values();let t;for(;t=e.next(),t.done!==!0;)t.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")}getAttribute(e){return this._attributes[e]}getAttributes(){return this._attributes}hasAttribute(e){return this._attributes.hasOwnProperty(e)}setAttribute(e,t){return this._attributes[e]=t,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this}updateAttribute(e,t){if(typeof t!="function")throw new ut("Graph.updateAttribute: updater should be a function.");const n=this._attributes[e];return this._attributes[e]=t(n),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this}removeAttribute(e){return delete this._attributes[e],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:e}),this}replaceAttributes(e){if(!gi(e))throw new ut("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=e,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this}mergeAttributes(e){if(!gi(e))throw new ut("Graph.mergeAttributes: provided attributes are not a plain object.");return ii(this._attributes,e),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:e}),this}updateAttributes(e){if(typeof e!="function")throw new ut("Graph.updateAttributes: provided updater is not a function.");return this._attributes=e(this._attributes),this.emit("attributesUpdated",{type:"update",attributes:this._attributes}),this}updateEachNodeAttributes(e,t){if(typeof e!="function")throw new ut("Graph.updateEachNodeAttributes: expecting an updater function.");if(t&&!ew(t))throw new ut("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const n=this._nodes.values();let r,s;for(;r=n.next(),r.done!==!0;)s=r.value,s.attributes=e(s.key,s.attributes);this.emit("eachNodeAttributesUpdated",{hints:t||null})}updateEachEdgeAttributes(e,t){if(typeof e!="function")throw new ut("Graph.updateEachEdgeAttributes: expecting an updater function.");if(t&&!ew(t))throw new ut("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const n=this._edges.values();let r,s,a,o;for(;r=n.next(),r.done!==!0;)s=r.value,a=s.source,o=s.target,s.attributes=e(s.key,s.attributes,a.key,o.key,a.attributes,o.attributes,s.undirected);this.emit("eachEdgeAttributesUpdated",{hints:t||null})}forEachAdjacencyEntry(e){if(typeof e!="function")throw new ut("Graph.forEachAdjacencyEntry: expecting a callback.");Xp(!1,!1,!1,this,e)}forEachAdjacencyEntryWithOrphans(e){if(typeof e!="function")throw new ut("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");Xp(!1,!1,!0,this,e)}forEachAssymetricAdjacencyEntry(e){if(typeof e!="function")throw new ut("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");Xp(!1,!0,!1,this,e)}forEachAssymetricAdjacencyEntryWithOrphans(e){if(typeof e!="function")throw new ut("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");Xp(!1,!0,!0,this,e)}nodes(){return Array.from(this._nodes.keys())}forEachNode(e){if(typeof e!="function")throw new ut("Graph.forEachNode: expecting a callback.");const t=this._nodes.values();let n,r;for(;n=t.next(),n.done!==!0;)r=n.value,e(r.key,r.attributes)}findNode(e){if(typeof e!="function")throw new ut("Graph.findNode: expecting a callback.");const t=this._nodes.values();let n,r;for(;n=t.next(),n.done!==!0;)if(r=n.value,e(r.key,r.attributes))return r.key}mapNodes(e){if(typeof e!="function")throw new ut("Graph.mapNode: expecting a callback.");const t=this._nodes.values();let n,r;const s=new Array(this.order);let a=0;for(;n=t.next(),n.done!==!0;)r=n.value,s[a++]=e(r.key,r.attributes);return s}someNode(e){if(typeof e!="function")throw new ut("Graph.someNode: expecting a callback.");const t=this._nodes.values();let n,r;for(;n=t.next(),n.done!==!0;)if(r=n.value,e(r.key,r.attributes))return!0;return!1}everyNode(e){if(typeof e!="function")throw new ut("Graph.everyNode: expecting a callback.");const t=this._nodes.values();let n,r;for(;n=t.next(),n.done!==!0;)if(r=n.value,!e(r.key,r.attributes))return!1;return!0}filterNodes(e){if(typeof e!="function")throw new ut("Graph.filterNodes: expecting a callback.");const t=this._nodes.values();let n,r;const s=[];for(;n=t.next(),n.done!==!0;)r=n.value,e(r.key,r.attributes)&&s.push(r.key);return s}reduceNodes(e,t){if(typeof e!="function")throw new ut("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new ut("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");let n=t;const r=this._nodes.values();let s,a;for(;s=r.next(),s.done!==!0;)a=s.value,n=e(n,a.key,a.attributes);return n}nodeEntries(){const e=this._nodes.values();return{[Symbol.iterator](){return this},next(){const t=e.next();if(t.done)return t;const n=t.value;return{value:{node:n.key,attributes:n.attributes},done:!1}}}}export(){const e=new Array(this._nodes.size);let t=0;this._nodes.forEach((r,s)=>{e[t++]=Gk(s,r)});const n=new Array(this._edges.size);return t=0,this._edges.forEach((r,s)=>{n[t++]=Hk(this.type,s,r)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:e,edges:n}}import(e,t=!1){if(e instanceof un)return e.forEachNode((l,c)=>{t?this.mergeNode(l,c):this.addNode(l,c)}),e.forEachEdge((l,c,h,d,p,m,v)=>{t?v?this.mergeUndirectedEdgeWithKey(l,h,d,c):this.mergeDirectedEdgeWithKey(l,h,d,c):v?this.addUndirectedEdgeWithKey(l,h,d,c):this.addDirectedEdgeWithKey(l,h,d,c)}),this;if(!gi(e))throw new ut("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(e.attributes){if(!gi(e.attributes))throw new ut("Graph.import: invalid attributes. Expecting a plain object.");t?this.mergeAttributes(e.attributes):this.replaceAttributes(e.attributes)}let n,r,s,a,o;if(e.nodes){if(s=e.nodes,!Array.isArray(s))throw new ut("Graph.import: invalid nodes. Expecting an array.");for(n=0,r=s.length;n<r;n++){a=s[n],Vk(a);const{key:l,attributes:c}=a;t?this.mergeNode(l,c):this.addNode(l,c)}}if(e.edges){let l=!1;if(this.type==="undirected"&&(l=!0),s=e.edges,!Array.isArray(s))throw new ut("Graph.import: invalid edges. Expecting an array.");for(n=0,r=s.length;n<r;n++){o=s[n],Wk(o);const{source:c,target:h,attributes:d,undirected:p=l}=o;let m;"key"in o?(m=t?p?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:p?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey,m.call(this,o.key,c,h,d)):(m=t?p?this.mergeUndirectedEdge:this.mergeDirectedEdge:p?this.addUndirectedEdge:this.addDirectedEdge,m.call(this,c,h,d))}}return this}nullCopy(e){const t=new un(ii({},this._options,e));return t.replaceAttributes(ii({},this.getAttributes())),t}emptyCopy(e){const t=this.nullCopy(e);return this._nodes.forEach((n,r)=>{const s=ii({},n.attributes);n=new t.NodeDataClass(r,s),t._nodes.set(r,n)}),t}copy(e){if(e=e||{},typeof e.type=="string"&&e.type!==this.type&&e.type!=="mixed")throw new xt(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${e.type}" because this would mean losing information about the current graph.`);if(typeof e.multi=="boolean"&&e.multi!==this.multi&&e.multi!==!0)throw new xt("Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.");if(typeof e.allowSelfLoops=="boolean"&&e.allowSelfLoops!==this.allowSelfLoops&&e.allowSelfLoops!==!0)throw new xt("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");const t=this.emptyCopy(e),n=this._edges.values();let r,s;for(;r=n.next(),r.done!==!0;)s=r.value,KC(t,"copy",!1,s.undirected,s.key,s.source.key,s.target.key,ii({},s.attributes));return t}toJSON(){return this.export()}toString(){return"[object Graph]"}inspect(){const e={};this._nodes.forEach((s,a)=>{e[a]=s.attributes});const t={},n={};this._edges.forEach((s,a)=>{const o=s.undirected?"--":"->";let l="",c=s.source.key,h=s.target.key,d;s.undirected&&c>h&&(d=c,c=h,h=d);const p=`(${c})${o}(${h})`;a.startsWith("geid_")?this.multi&&(typeof n[p]>"u"?n[p]=0:n[p]++,l+=`${n[p]}. `):l+=`[${a}]: `,l+=p,t[l]=s.attributes});const r={};for(const s in this)this.hasOwnProperty(s)&&!tw.has(s)&&typeof this[s]!="function"&&typeof s!="symbol"&&(r[s]=this[s]);return r.attributes=this._attributes,r.nodes=e,r.edges=t,Or(r,"constructor",this.constructor),r}}typeof Symbol<"u"&&(un.prototype[Symbol.for("nodejs.util.inspect.custom")]=un.prototype.inspect);qk.forEach(i=>{["add","merge","update"].forEach(e=>{const t=i.name(e),n=e==="add"?KC:Kk;i.generateKey?un.prototype[t]=function(r,s,a){return n(this,t,!0,(i.type||this.type)==="undirected",null,r,s,a,e==="update")}:un.prototype[t]=function(r,s,a,o){return n(this,t,!1,(i.type||this.type)==="undirected",r,s,a,o,e==="update")}})});sk(un);gk(un);Ok(un);kk(un);class JC extends un{constructor(e){const t=ii({type:"directed"},e);if("multi"in t&&t.multi!==!1)throw new ut("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(t.type!=="directed")throw new ut('DirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}class QC extends un{constructor(e){const t=ii({type:"undirected"},e);if("multi"in t&&t.multi!==!1)throw new ut("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(t.type!=="undirected")throw new ut('UndirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}class $C extends un{constructor(e){const t=ii({multi:!0},e);if("multi"in t&&t.multi!==!0)throw new ut("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");super(t)}}class eR extends un{constructor(e){const t=ii({type:"directed",multi:!0},e);if("multi"in t&&t.multi!==!0)throw new ut("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(t.type!=="directed")throw new ut('MultiDirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}class tR extends un{constructor(e){const t=ii({type:"undirected",multi:!0},e);if("multi"in t&&t.multi!==!0)throw new ut("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(t.type!=="undirected")throw new ut('MultiUndirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}function Lu(i){i.from=function(e,t){const n=ii({},e.options,t),r=new i(n);return r.import(e),r}}Lu(un);Lu(JC);Lu(QC);Lu($C);Lu(eR);Lu(tR);un.Graph=un;un.DirectedGraph=JC;un.UndirectedGraph=QC;un.MultiGraph=$C;un.MultiDirectedGraph=eR;un.MultiUndirectedGraph=tR;un.InvalidArgumentsGraphError=ut;un.NotFoundGraphError=et;un.UsageGraphError=xt;const iw=i=>{let e;const t=new Set,n=(c,h)=>{const d=typeof c=="function"?c(e):c;if(!Object.is(d,e)){const p=e;e=h??(typeof d!="object"||d===null)?d:Object.assign({},e,d),t.forEach(m=>m(e,p))}},r=()=>e,o={setState:n,getState:r,getInitialState:()=>l,subscribe:c=>(t.add(c),()=>t.delete(c))},l=e=i(n,r,o);return o},Jk=(i=>i?iw(i):iw),Qk=i=>i;function nR(i,e=Qk){const t=Ms.useSyncExternalStore(i.subscribe,Ms.useCallback(()=>e(i.getState()),[i,e]),Ms.useCallback(()=>e(i.getInitialState()),[i,e]));return Ms.useDebugValue(t),t}const rw=i=>{const e=Jk(i),t=n=>nR(e,n);return Object.assign(t,e),t},$k=(i=>i?rw(i):rw),sw=i=>Symbol.iterator in i,aw=i=>"entries"in i,ow=(i,e)=>{const t=i instanceof Map?i:new Map(i.entries()),n=e instanceof Map?e:new Map(e.entries());if(t.size!==n.size)return!1;for(const[r,s]of t)if(!n.has(r)||!Object.is(s,n.get(r)))return!1;return!0},eG=(i,e)=>{const t=i[Symbol.iterator](),n=e[Symbol.iterator]();let r=t.next(),s=n.next();for(;!r.done&&!s.done;){if(!Object.is(r.value,s.value))return!1;r=t.next(),s=n.next()}return!!r.done&&!!s.done};function tG(i,e){return Object.is(i,e)?!0:typeof i!="object"||i===null||typeof e!="object"||e===null||Object.getPrototypeOf(i)!==Object.getPrototypeOf(e)?!1:sw(i)&&sw(e)?aw(i)&&aw(e)?ow(i,e):eG(i,e):ow({entries:()=>Object.entries(i)},{entries:()=>Object.entries(e)})}function nG(i){const e=Ms.useRef(void 0);return t=>{const n=i(t);return tG(e.current,n)?e.current:e.current=n}}const Jh=(i,e)=>{const t=i[0].index!==null,n=new Set(Object.keys(i[0].attributes)),r=new Set(Object.keys(i[0].morphAttributes)),s={},a={},o=i[0].morphTargetsRelative,l=new Rt;let c=0;if(i.forEach((h,d)=>{let p=0;if(t!==(h.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+d+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(let m in h.attributes){if(!n.has(m))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+d+'. All geometries must have compatible attributes; make sure "'+m+'" attribute exists among all geometries, or in none of them.'),null;s[m]===void 0&&(s[m]=[]),s[m].push(h.attributes[m]),p++}if(p!==n.size)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+d+". Make sure all geometries have the same number of attributes."),null;if(o!==h.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+d+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(let m in h.morphAttributes){if(!r.has(m))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+d+". .morphAttributes must be consistent throughout all geometries."),null;a[m]===void 0&&(a[m]=[]),a[m].push(h.morphAttributes[m])}if(l.userData.mergedUserData=l.userData.mergedUserData||[],l.userData.mergedUserData.push(h.userData),e){let m;if(h.index)m=h.index.count;else if(h.attributes.position!==void 0)m=h.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+d+". The geometry must have either an index or a position attribute"),null;l.addGroup(c,m,d),c+=m}}),t){let h=0;const d=[];i.forEach(p=>{const m=p.index;for(let v=0;v<m.count;++v)d.push(m.getX(v)+h);h+=p.attributes.position.count}),l.setIndex(d)}for(let h in s){const d=lw(s[h]);if(!d)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+h+" attribute."),null;l.setAttribute(h,d)}for(let h in a){const d=a[h][0].length;if(d===0)break;l.morphAttributes=l.morphAttributes||{},l.morphAttributes[h]=[];for(let p=0;p<d;++p){const m=[];for(let x=0;x<a[h].length;++x)m.push(a[h][x][p]);const v=lw(m);if(!v)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+h+" morphAttribute."),null;l.morphAttributes[h].push(v)}}return l},lw=i=>{let e,t,n,r=0;if(i.forEach(s=>{if(e===void 0&&(e=s.array.constructor),e!==s.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(t===void 0&&(t=s.itemSize),t!==s.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(n===void 0&&(n=s.normalized),n!==s.normalized)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;r+=s.array.length}),e&&t){const s=new e(r);let a=0;return i.forEach(o=>{s.set(o.array,a),a+=o.array.length}),new $t(s,t,n)}};function iG(i,e=Math.PI/3){const t=Math.cos(e),n=(1+1e-10)*100,r=[new j,new j,new j],s=new j,a=new j,o=new j,l=new j;function c(x){const _=~~(x.x*n),g=~~(x.y*n),b=~~(x.z*n);return`${_},${g},${b}`}const h=i.index?i.toNonIndexed():i,d=h.attributes.position,p={};for(let x=0,_=d.count/3;x<_;x++){const g=3*x,b=r[0].fromBufferAttribute(d,g+0),E=r[1].fromBufferAttribute(d,g+1),S=r[2].fromBufferAttribute(d,g+2);s.subVectors(S,E),a.subVectors(b,E);const w=new j().crossVectors(s,a).normalize();for(let T=0;T<3;T++){const R=r[T],U=c(R);U in p||(p[U]=[]),p[U].push(w)}}const m=new Float32Array(d.count*3),v=new $t(m,3,!1);for(let x=0,_=d.count/3;x<_;x++){const g=3*x,b=r[0].fromBufferAttribute(d,g+0),E=r[1].fromBufferAttribute(d,g+1),S=r[2].fromBufferAttribute(d,g+2);s.subVectors(S,E),a.subVectors(b,E),o.crossVectors(s,a).normalize();for(let w=0;w<3;w++){const T=r[w],R=c(T),U=p[R];l.set(0,0,0);for(let A=0,D=U.length;A<D;A++){const L=U[A];o.dot(L)>t&&l.add(L)}l.normalize(),v.setXYZ(g+w,l.x,l.y,l.z)}}return h.setAttribute("normal",v),h}const t_=new Ll,n_=new j,Xc=new j,es=new j,aa=new j,xs=new j,oa=new j,la=new j,Uh=new j,Oh=new j,Lh=new j,jp=new j,Ih=new j,Nh=new j,Ph=new j;class cw{constructor(e,t,n){this.camera=e,this.scene=t,this.startPoint=new j,this.endPoint=new j,this.collection=[],this.deep=n||Number.MAX_VALUE}select(e,t){return this.startPoint=e||this.startPoint,this.endPoint=t||this.endPoint,this.collection=[],this.updateFrustum(this.startPoint,this.endPoint),this.searchChildInFrustum(t_,this.scene),this.collection}updateFrustum(e,t){if(e=e||this.startPoint,t=t||this.endPoint,e.x===t.x&&(t.x+=Number.EPSILON),e.y===t.y&&(t.y+=Number.EPSILON),this.camera.updateProjectionMatrix(),this.camera.updateMatrixWorld(),this.camera.isPerspectiveCamera){Xc.copy(e),Xc.x=Math.min(e.x,t.x),Xc.y=Math.max(e.y,t.y),t.x=Math.max(e.x,t.x),t.y=Math.min(e.y,t.y),es.setFromMatrixPosition(this.camera.matrixWorld),aa.copy(Xc),xs.set(t.x,Xc.y,0),oa.copy(t),la.set(Xc.x,t.y,0),aa.unproject(this.camera),xs.unproject(this.camera),oa.unproject(this.camera),la.unproject(this.camera),Ih.copy(aa).sub(es),Nh.copy(xs).sub(es),Ph.copy(oa).sub(es),Ih.normalize(),Nh.normalize(),Ph.normalize(),Ih.multiplyScalar(this.deep),Nh.multiplyScalar(this.deep),Ph.multiplyScalar(this.deep),Ih.add(es),Nh.add(es),Ph.add(es);var n=t_.planes;n[0].setFromCoplanarPoints(es,aa,xs),n[1].setFromCoplanarPoints(es,xs,oa),n[2].setFromCoplanarPoints(oa,la,es),n[3].setFromCoplanarPoints(la,aa,es),n[4].setFromCoplanarPoints(xs,oa,la),n[5].setFromCoplanarPoints(Ph,Nh,Ih),n[5].normal.multiplyScalar(-1)}else if(this.camera.isOrthographicCamera){const r=Math.min(e.x,t.x),s=Math.max(e.y,t.y),a=Math.max(e.x,t.x),o=Math.min(e.y,t.y);aa.set(r,s,-1),xs.set(a,s,-1),oa.set(a,o,-1),la.set(r,o,-1),Uh.set(r,s,1),Oh.set(a,s,1),Lh.set(a,o,1),jp.set(r,o,1),aa.unproject(this.camera),xs.unproject(this.camera),oa.unproject(this.camera),la.unproject(this.camera),Uh.unproject(this.camera),Oh.unproject(this.camera),Lh.unproject(this.camera),jp.unproject(this.camera);var n=t_.planes;n[0].setFromCoplanarPoints(aa,Uh,Oh),n[1].setFromCoplanarPoints(xs,Oh,Lh),n[2].setFromCoplanarPoints(Lh,jp,la),n[3].setFromCoplanarPoints(jp,Uh,aa),n[4].setFromCoplanarPoints(xs,oa,la),n[5].setFromCoplanarPoints(Lh,Oh,Uh),n[5].normal.multiplyScalar(-1)}else console.error("THREE.SelectionBox: Unsupported camera type.")}searchChildInFrustum(e,t){if((t.isMesh||t.isLine||t.isPoints)&&t.material!==void 0&&(t.geometry.boundingSphere===null&&t.geometry.computeBoundingSphere(),n_.copy(t.geometry.boundingSphere.center),n_.applyMatrix4(t.matrixWorld),e.containsPoint(n_)&&this.collection.push(t)),t.children.length>0)for(let n=0;n<t.children.length;n++)this.searchChildInFrustum(e,t.children[n])}}var zh={},i_,uw;function Aa(){return uw||(uw=1,i_=function(e){return e!==null&&typeof e=="object"&&typeof e.addUndirectedEdgeWithKey=="function"&&typeof e.dropNode=="function"&&typeof e.multi=="boolean"}),i_}var hw;function rG(){if(hw)return zh;hw=1;var i=Aa();function e(s,a,o,l){var c=a+"Centrality";if(!i(o))throw new Error("graphology-centrality/"+c+": the given graph is not a valid graphology instance.");if(a!=="degree"&&o.type==="undirected")throw new Error("graphology-centrality/"+c+": cannot compute "+a+" centrality on an undirected graph.");l=l||{};var h=l.nodeCentralityAttribute||c,d=o.order-1,p=o[a].bind(o);if(s){o.updateEachNodeAttributes(function(v,x){return x[h]=p(v)/d,x},{attributes:[h]});return}var m={};return o.forEachNode(function(v){m[v]=p(v)/d}),m}var t=e.bind(null,!1,"degree"),n=e.bind(null,!1,"inDegree"),r=e.bind(null,!1,"outDegree");return t.assign=e.bind(null,!0,"degree"),n.assign=e.bind(null,!0,"inDegree"),r.assign=e.bind(null,!0,"outDegree"),zh.degreeCentrality=t,zh.inDegreeCentrality=n,zh.outDegreeCentrality=r,zh}var sG=rG();function cm(i,e){return i==null||e==null?NaN:i<e?-1:i>e?1:i>=e?0:NaN}function aG(i,e){return i==null||e==null?NaN:e<i?-1:e>i?1:e>=i?0:NaN}function iR(i){let e,t,n;i.length!==2?(e=cm,t=(o,l)=>cm(i(o),l),n=(o,l)=>i(o)-l):(e=i===cm||i===aG?i:oG,t=i,n=i);function r(o,l,c=0,h=o.length){if(c<h){if(e(l,l)!==0)return h;do{const d=c+h>>>1;t(o[d],l)<0?c=d+1:h=d}while(c<h)}return c}function s(o,l,c=0,h=o.length){if(c<h){if(e(l,l)!==0)return h;do{const d=c+h>>>1;t(o[d],l)<=0?c=d+1:h=d}while(c<h)}return c}function a(o,l,c=0,h=o.length){const d=r(o,l,c,h-1);return d>c&&n(o[d-1],l)>-n(o[d],l)?d-1:d}return{left:r,center:a,right:s}}function oG(){return 0}function lG(i){return i===null?NaN:+i}const cG=iR(cm),uG=cG.right;iR(lG).center;const hG=Math.sqrt(50),fG=Math.sqrt(10),dG=Math.sqrt(2);function ug(i,e,t){const n=(e-i)/Math.max(0,t),r=Math.floor(Math.log10(n)),s=n/Math.pow(10,r),a=s>=hG?10:s>=fG?5:s>=dG?2:1;let o,l,c;return r<0?(c=Math.pow(10,-r)/a,o=Math.round(i*c),l=Math.round(e*c),o/c<i&&++o,l/c>e&&--l,c=-c):(c=Math.pow(10,r)*a,o=Math.round(i/c),l=Math.round(e/c),o*c<i&&++o,l*c>e&&--l),l<o&&.5<=t&&t<2?ug(i,e,t*2):[o,l,c]}function pG(i,e,t){if(e=+e,i=+i,t=+t,!(t>0))return[];if(i===e)return[i];const n=e<i,[r,s,a]=n?ug(e,i,t):ug(i,e,t);if(!(s>=r))return[];const o=s-r+1,l=new Array(o);if(n)if(a<0)for(let c=0;c<o;++c)l[c]=(s-c)/-a;else for(let c=0;c<o;++c)l[c]=(s-c)*a;else if(a<0)for(let c=0;c<o;++c)l[c]=(r+c)/-a;else for(let c=0;c<o;++c)l[c]=(r+c)*a;return l}function hx(i,e,t){return e=+e,i=+i,t=+t,ug(i,e,t)[2]}function mG(i,e,t){e=+e,i=+i,t=+t;const n=e<i,r=n?hx(e,i,t):hx(i,e,t);return(n?-1:1)*(r<0?1/-r:r)}function gG(i,e){switch(arguments.length){case 0:break;case 1:this.range(i);break;default:this.range(e).domain(i);break}return this}function L1(i,e,t){i.prototype=e.prototype=t,t.constructor=i}function rR(i,e){var t=Object.create(i.prototype);for(var n in e)t[n]=e[n];return t}function sd(){}var zf=.7,hg=1/zf,su="\\s*([+-]?\\d+)\\s*",Ff="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Rs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",vG=/^#([0-9a-f]{3,8})$/,yG=new RegExp(`^rgb\\(${su},${su},${su}\\)$`),_G=new RegExp(`^rgb\\(${Rs},${Rs},${Rs}\\)$`),xG=new RegExp(`^rgba\\(${su},${su},${su},${Ff}\\)$`),bG=new RegExp(`^rgba\\(${Rs},${Rs},${Rs},${Ff}\\)$`),SG=new RegExp(`^hsl\\(${Ff},${Rs},${Rs}\\)$`),EG=new RegExp(`^hsla\\(${Ff},${Rs},${Rs},${Ff}\\)$`),fw={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};L1(sd,Bf,{copy(i){return Object.assign(new this.constructor,this,i)},displayable(){return this.rgb().displayable()},hex:dw,formatHex:dw,formatHex8:MG,formatHsl:wG,formatRgb:pw,toString:pw});function dw(){return this.rgb().formatHex()}function MG(){return this.rgb().formatHex8()}function wG(){return sR(this).formatHsl()}function pw(){return this.rgb().formatRgb()}function Bf(i){var e,t;return i=(i+"").trim().toLowerCase(),(e=vG.exec(i))?(t=e[1].length,e=parseInt(e[1],16),t===6?mw(e):t===3?new $i(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):t===8?qp(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):t===4?qp(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=yG.exec(i))?new $i(e[1],e[2],e[3],1):(e=_G.exec(i))?new $i(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=xG.exec(i))?qp(e[1],e[2],e[3],e[4]):(e=bG.exec(i))?qp(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=SG.exec(i))?yw(e[1],e[2]/100,e[3]/100,1):(e=EG.exec(i))?yw(e[1],e[2]/100,e[3]/100,e[4]):fw.hasOwnProperty(i)?mw(fw[i]):i==="transparent"?new $i(NaN,NaN,NaN,0):null}function mw(i){return new $i(i>>16&255,i>>8&255,i&255,1)}function qp(i,e,t,n){return n<=0&&(i=e=t=NaN),new $i(i,e,t,n)}function TG(i){return i instanceof sd||(i=Bf(i)),i?(i=i.rgb(),new $i(i.r,i.g,i.b,i.opacity)):new $i}function fx(i,e,t,n){return arguments.length===1?TG(i):new $i(i,e,t,n??1)}function $i(i,e,t,n){this.r=+i,this.g=+e,this.b=+t,this.opacity=+n}L1($i,fx,rR(sd,{brighter(i){return i=i==null?hg:Math.pow(hg,i),new $i(this.r*i,this.g*i,this.b*i,this.opacity)},darker(i){return i=i==null?zf:Math.pow(zf,i),new $i(this.r*i,this.g*i,this.b*i,this.opacity)},rgb(){return this},clamp(){return new $i(El(this.r),El(this.g),El(this.b),fg(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:gw,formatHex:gw,formatHex8:AG,formatRgb:vw,toString:vw}));function gw(){return`#${_l(this.r)}${_l(this.g)}${_l(this.b)}`}function AG(){return`#${_l(this.r)}${_l(this.g)}${_l(this.b)}${_l((isNaN(this.opacity)?1:this.opacity)*255)}`}function vw(){const i=fg(this.opacity);return`${i===1?"rgb(":"rgba("}${El(this.r)}, ${El(this.g)}, ${El(this.b)}${i===1?")":`, ${i})`}`}function fg(i){return isNaN(i)?1:Math.max(0,Math.min(1,i))}function El(i){return Math.max(0,Math.min(255,Math.round(i)||0))}function _l(i){return i=El(i),(i<16?"0":"")+i.toString(16)}function yw(i,e,t,n){return n<=0?i=e=t=NaN:t<=0||t>=1?i=e=NaN:e<=0&&(i=NaN),new as(i,e,t,n)}function sR(i){if(i instanceof as)return new as(i.h,i.s,i.l,i.opacity);if(i instanceof sd||(i=Bf(i)),!i)return new as;if(i instanceof as)return i;i=i.rgb();var e=i.r/255,t=i.g/255,n=i.b/255,r=Math.min(e,t,n),s=Math.max(e,t,n),a=NaN,o=s-r,l=(s+r)/2;return o?(e===s?a=(t-n)/o+(t<n)*6:t===s?a=(n-e)/o+2:a=(e-t)/o+4,o/=l<.5?s+r:2-s-r,a*=60):o=l>0&&l<1?0:a,new as(a,o,l,i.opacity)}function CG(i,e,t,n){return arguments.length===1?sR(i):new as(i,e,t,n??1)}function as(i,e,t,n){this.h=+i,this.s=+e,this.l=+t,this.opacity=+n}L1(as,CG,rR(sd,{brighter(i){return i=i==null?hg:Math.pow(hg,i),new as(this.h,this.s,this.l*i,this.opacity)},darker(i){return i=i==null?zf:Math.pow(zf,i),new as(this.h,this.s,this.l*i,this.opacity)},rgb(){var i=this.h%360+(this.h<0)*360,e=isNaN(i)||isNaN(this.s)?0:this.s,t=this.l,n=t+(t<.5?t:1-t)*e,r=2*t-n;return new $i(r_(i>=240?i-240:i+120,r,n),r_(i,r,n),r_(i<120?i+240:i-120,r,n),this.opacity)},clamp(){return new as(_w(this.h),Yp(this.s),Yp(this.l),fg(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const i=fg(this.opacity);return`${i===1?"hsl(":"hsla("}${_w(this.h)}, ${Yp(this.s)*100}%, ${Yp(this.l)*100}%${i===1?")":`, ${i})`}`}}));function _w(i){return i=(i||0)%360,i<0?i+360:i}function Yp(i){return Math.max(0,Math.min(1,i||0))}function r_(i,e,t){return(i<60?e+(t-e)*i/60:i<180?t:i<240?e+(t-e)*(240-i)/60:e)*255}const I1=i=>()=>i;function RG(i,e){return function(t){return i+t*e}}function DG(i,e,t){return i=Math.pow(i,t),e=Math.pow(e,t)-i,t=1/t,function(n){return Math.pow(i+n*e,t)}}function UG(i){return(i=+i)==1?aR:function(e,t){return t-e?DG(e,t,i):I1(isNaN(e)?t:e)}}function aR(i,e){var t=e-i;return t?RG(i,t):I1(isNaN(i)?e:i)}const xw=(function i(e){var t=UG(e);function n(r,s){var a=t((r=fx(r)).r,(s=fx(s)).r),o=t(r.g,s.g),l=t(r.b,s.b),c=aR(r.opacity,s.opacity);return function(h){return r.r=a(h),r.g=o(h),r.b=l(h),r.opacity=c(h),r+""}}return n.gamma=i,n})(1);function OG(i,e){e||(e=[]);var t=i?Math.min(e.length,i.length):0,n=e.slice(),r;return function(s){for(r=0;r<t;++r)n[r]=i[r]*(1-s)+e[r]*s;return n}}function LG(i){return ArrayBuffer.isView(i)&&!(i instanceof DataView)}function IG(i,e){var t=e?e.length:0,n=i?Math.min(t,i.length):0,r=new Array(n),s=new Array(t),a;for(a=0;a<n;++a)r[a]=N1(i[a],e[a]);for(;a<t;++a)s[a]=e[a];return function(o){for(a=0;a<n;++a)s[a]=r[a](o);return s}}function NG(i,e){var t=new Date;return i=+i,e=+e,function(n){return t.setTime(i*(1-n)+e*n),t}}function dg(i,e){return i=+i,e=+e,function(t){return i*(1-t)+e*t}}function PG(i,e){var t={},n={},r;(i===null||typeof i!="object")&&(i={}),(e===null||typeof e!="object")&&(e={});for(r in e)r in i?t[r]=N1(i[r],e[r]):n[r]=e[r];return function(s){for(r in t)n[r]=t[r](s);return n}}var dx=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,s_=new RegExp(dx.source,"g");function zG(i){return function(){return i}}function FG(i){return function(e){return i(e)+""}}function BG(i,e){var t=dx.lastIndex=s_.lastIndex=0,n,r,s,a=-1,o=[],l=[];for(i=i+"",e=e+"";(n=dx.exec(i))&&(r=s_.exec(e));)(s=r.index)>t&&(s=e.slice(t,s),o[a]?o[a]+=s:o[++a]=s),(n=n[0])===(r=r[0])?o[a]?o[a]+=r:o[++a]=r:(o[++a]=null,l.push({i:a,x:dg(n,r)})),t=s_.lastIndex;return t<e.length&&(s=e.slice(t),o[a]?o[a]+=s:o[++a]=s),o.length<2?l[0]?FG(l[0].x):zG(e):(e=l.length,function(c){for(var h=0,d;h<e;++h)o[(d=l[h]).i]=d.x(c);return o.join("")})}function N1(i,e){var t=typeof e,n;return e==null||t==="boolean"?I1(e):(t==="number"?dg:t==="string"?(n=Bf(e))?(e=n,xw):BG:e instanceof Bf?xw:e instanceof Date?NG:LG(e)?OG:Array.isArray(e)?IG:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?PG:dg)(i,e)}function kG(i,e){return i=+i,e=+e,function(t){return Math.round(i*(1-t)+e*t)}}function GG(i){return function(){return i}}function HG(i){return+i}var bw=[0,1];function nu(i){return i}function px(i,e){return(e-=i=+i)?function(t){return(t-i)/e}:GG(isNaN(e)?NaN:.5)}function VG(i,e){var t;return i>e&&(t=i,i=e,e=t),function(n){return Math.max(i,Math.min(e,n))}}function WG(i,e,t){var n=i[0],r=i[1],s=e[0],a=e[1];return r<n?(n=px(r,n),s=t(a,s)):(n=px(n,r),s=t(s,a)),function(o){return s(n(o))}}function XG(i,e,t){var n=Math.min(i.length,e.length)-1,r=new Array(n),s=new Array(n),a=-1;for(i[n]<i[0]&&(i=i.slice().reverse(),e=e.slice().reverse());++a<n;)r[a]=px(i[a],i[a+1]),s[a]=t(e[a],e[a+1]);return function(o){var l=uG(i,o,1,n)-1;return s[l](r[l](o))}}function jG(i,e){return e.domain(i.domain()).range(i.range()).interpolate(i.interpolate()).clamp(i.clamp()).unknown(i.unknown())}function qG(){var i=bw,e=bw,t=N1,n,r,s,a=nu,o,l,c;function h(){var p=Math.min(i.length,e.length);return a!==nu&&(a=VG(i[0],i[p-1])),o=p>2?XG:WG,l=c=null,d}function d(p){return p==null||isNaN(p=+p)?s:(l||(l=o(i.map(n),e,t)))(n(a(p)))}return d.invert=function(p){return a(r((c||(c=o(e,i.map(n),dg)))(p)))},d.domain=function(p){return arguments.length?(i=Array.from(p,HG),h()):i.slice()},d.range=function(p){return arguments.length?(e=Array.from(p),h()):e.slice()},d.rangeRound=function(p){return e=Array.from(p),t=kG,h()},d.clamp=function(p){return arguments.length?(a=p?!0:nu,h()):a!==nu},d.interpolate=function(p){return arguments.length?(t=p,h()):t},d.unknown=function(p){return arguments.length?(s=p,d):s},function(p,m){return n=p,r=m,h()}}function YG(){return qG()(nu,nu)}function ZG(i){return Math.abs(i=Math.round(i))>=1e21?i.toLocaleString("en").replace(/,/g,""):i.toString(10)}function pg(i,e){if((t=(i=e?i.toExponential(e-1):i.toExponential()).indexOf("e"))<0)return null;var t,n=i.slice(0,t);return[n.length>1?n[0]+n.slice(2):n,+i.slice(t+1)]}function yu(i){return i=pg(Math.abs(i)),i?i[1]:NaN}function KG(i,e){return function(t,n){for(var r=t.length,s=[],a=0,o=i[0],l=0;r>0&&o>0&&(l+o+1>n&&(o=Math.max(1,n-l)),s.push(t.substring(r-=o,r+o)),!((l+=o+1)>n));)o=i[a=(a+1)%i.length];return s.reverse().join(e)}}function JG(i){return function(e){return e.replace(/[0-9]/g,function(t){return i[+t]})}}var QG=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function mg(i){if(!(e=QG.exec(i)))throw new Error("invalid format: "+i);var e;return new P1({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}mg.prototype=P1.prototype;function P1(i){this.fill=i.fill===void 0?" ":i.fill+"",this.align=i.align===void 0?">":i.align+"",this.sign=i.sign===void 0?"-":i.sign+"",this.symbol=i.symbol===void 0?"":i.symbol+"",this.zero=!!i.zero,this.width=i.width===void 0?void 0:+i.width,this.comma=!!i.comma,this.precision=i.precision===void 0?void 0:+i.precision,this.trim=!!i.trim,this.type=i.type===void 0?"":i.type+""}P1.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function $G(i){e:for(var e=i.length,t=1,n=-1,r;t<e;++t)switch(i[t]){case".":n=r=t;break;case"0":n===0&&(n=t),r=t;break;default:if(!+i[t])break e;n>0&&(n=0);break}return n>0?i.slice(0,n)+i.slice(r+1):i}var oR;function eH(i,e){var t=pg(i,e);if(!t)return i+"";var n=t[0],r=t[1],s=r-(oR=Math.max(-8,Math.min(8,Math.floor(r/3)))*3)+1,a=n.length;return s===a?n:s>a?n+new Array(s-a+1).join("0"):s>0?n.slice(0,s)+"."+n.slice(s):"0."+new Array(1-s).join("0")+pg(i,Math.max(0,e+s-1))[0]}function Sw(i,e){var t=pg(i,e);if(!t)return i+"";var n=t[0],r=t[1];return r<0?"0."+new Array(-r).join("0")+n:n.length>r+1?n.slice(0,r+1)+"."+n.slice(r+1):n+new Array(r-n.length+2).join("0")}const Ew={"%":(i,e)=>(i*100).toFixed(e),b:i=>Math.round(i).toString(2),c:i=>i+"",d:ZG,e:(i,e)=>i.toExponential(e),f:(i,e)=>i.toFixed(e),g:(i,e)=>i.toPrecision(e),o:i=>Math.round(i).toString(8),p:(i,e)=>Sw(i*100,e),r:Sw,s:eH,X:i=>Math.round(i).toString(16).toUpperCase(),x:i=>Math.round(i).toString(16)};function Mw(i){return i}var ww=Array.prototype.map,Tw=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function tH(i){var e=i.grouping===void 0||i.thousands===void 0?Mw:KG(ww.call(i.grouping,Number),i.thousands+""),t=i.currency===void 0?"":i.currency[0]+"",n=i.currency===void 0?"":i.currency[1]+"",r=i.decimal===void 0?".":i.decimal+"",s=i.numerals===void 0?Mw:JG(ww.call(i.numerals,String)),a=i.percent===void 0?"%":i.percent+"",o=i.minus===void 0?"−":i.minus+"",l=i.nan===void 0?"NaN":i.nan+"";function c(d){d=mg(d);var p=d.fill,m=d.align,v=d.sign,x=d.symbol,_=d.zero,g=d.width,b=d.comma,E=d.precision,S=d.trim,w=d.type;w==="n"?(b=!0,w="g"):Ew[w]||(E===void 0&&(E=12),S=!0,w="g"),(_||p==="0"&&m==="=")&&(_=!0,p="0",m="=");var T=x==="$"?t:x==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",R=x==="$"?n:/[%p]/.test(w)?a:"",U=Ew[w],A=/[defgprs%]/.test(w);E=E===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,E)):Math.max(0,Math.min(20,E));function D(L){var P=T,I=R,V,H,z;if(w==="c")I=U(L)+I,L="";else{L=+L;var O=L<0||1/L<0;if(L=isNaN(L)?l:U(Math.abs(L),E),S&&(L=$G(L)),O&&+L==0&&v!=="+"&&(O=!1),P=(O?v==="("?v:o:v==="-"||v==="("?"":v)+P,I=(w==="s"?Tw[8+oR/3]:"")+I+(O&&v==="("?")":""),A){for(V=-1,H=L.length;++V<H;)if(z=L.charCodeAt(V),48>z||z>57){I=(z===46?r+L.slice(V+1):L.slice(V))+I,L=L.slice(0,V);break}}}b&&!_&&(L=e(L,1/0));var B=P.length+L.length+I.length,G=B<g?new Array(g-B+1).join(p):"";switch(b&&_&&(L=e(G+L,G.length?g-I.length:1/0),G=""),m){case"<":L=P+L+I+G;break;case"=":L=P+G+L+I;break;case"^":L=G.slice(0,B=G.length>>1)+P+L+I+G.slice(B);break;default:L=G+P+L+I;break}return s(L)}return D.toString=function(){return d+""},D}function h(d,p){var m=c((d=mg(d),d.type="f",d)),v=Math.max(-8,Math.min(8,Math.floor(yu(p)/3)))*3,x=Math.pow(10,-v),_=Tw[8+v/3];return function(g){return m(x*g)+_}}return{format:c,formatPrefix:h}}var Zp,lR,cR;nH({thousands:",",grouping:[3],currency:["$",""]});function nH(i){return Zp=tH(i),lR=Zp.format,cR=Zp.formatPrefix,Zp}function iH(i){return Math.max(0,-yu(Math.abs(i)))}function rH(i,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(yu(e)/3)))*3-yu(Math.abs(i)))}function sH(i,e){return i=Math.abs(i),e=Math.abs(e)-i,Math.max(0,yu(e)-yu(i))+1}function aH(i,e,t,n){var r=mG(i,e,t),s;switch(n=mg(n??",f"),n.type){case"s":{var a=Math.max(Math.abs(i),Math.abs(e));return n.precision==null&&!isNaN(s=rH(r,a))&&(n.precision=s),cR(n,a)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(s=sH(r,Math.max(Math.abs(i),Math.abs(e))))&&(n.precision=s-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(s=iH(r))&&(n.precision=s-(n.type==="%")*2);break}}return lR(n)}function oH(i){var e=i.domain;return i.ticks=function(t){var n=e();return pG(n[0],n[n.length-1],t??10)},i.tickFormat=function(t,n){var r=e();return aH(r[0],r[r.length-1],t??10,n)},i.nice=function(t){t==null&&(t=10);var n=e(),r=0,s=n.length-1,a=n[r],o=n[s],l,c,h=10;for(o<a&&(c=a,a=o,o=c,c=r,r=s,s=c);h-- >0;){if(c=hx(a,o,t),c===l)return n[r]=a,n[s]=o,e(n);if(c>0)a=Math.floor(a/c)*c,o=Math.ceil(o/c)*c;else if(c<0)a=Math.ceil(a*c)/c,o=Math.floor(o*c)/c;else break;l=c}return i},i}function uR(){var i=YG();return i.copy=function(){return jG(i,uR())},gG.apply(i,arguments),oH(i)}var a_,Aw;function z1(){if(Aw)return a_;Aw=1;function i(t){return!t||typeof t!="object"||typeof t=="function"||Array.isArray(t)||t instanceof Set||t instanceof Map||t instanceof RegExp||t instanceof Date}function e(t,n){t=t||{};var r={};for(var s in n){var a=t[s],o=n[s];if(!i(o)){r[s]=e(a,o);continue}a===void 0?r[s]=o:r[s]=a}return r}return a_=e,a_}var Kp={},o_={},Cw;function hR(){return Cw||(Cw=1,(function(i){var e=Math.pow(2,8)-1,t=Math.pow(2,16)-1,n=Math.pow(2,32)-1,r=Math.pow(2,7)-1,s=Math.pow(2,15)-1,a=Math.pow(2,31)-1;i.getPointerArray=function(l){var c=l-1;if(c<=e)return Uint8Array;if(c<=t)return Uint16Array;if(c<=n)return Uint32Array;throw new Error("mnemonist: Pointer Array of size > 4294967295 is not supported.")},i.getSignedPointerArray=function(l){var c=l-1;return c<=r?Int8Array:c<=s?Int16Array:c<=a?Int32Array:Float64Array},i.getNumberType=function(l){return l===(l|0)?Math.sign(l)===-1?l<=127&&l>=-128?Int8Array:l<=32767&&l>=-32768?Int16Array:Int32Array:l<=255?Uint8Array:l<=65535?Uint16Array:Uint32Array:Float64Array};var o={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};i.getMinimalRepresentation=function(l,c){var h=null,d=0,p,m,v,x,_;for(x=0,_=l.length;x<_;x++)v=c?c(l[x]):l[x],m=i.getNumberType(v),p=o[m.name],p>d&&(d=p,h=m);return h},i.isTypedArray=function(l){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView(l)},i.concat=function(){var l=0,c,h,d;for(c=0,d=arguments.length;c<d;c++)l+=arguments[c].length;var p=new arguments[0].constructor(l);for(c=0,h=0;c<d;c++)p.set(arguments[c],h),h+=arguments[c].length;return p},i.indices=function(l){for(var c=i.getPointerArray(l),h=new c(l),d=0;d<l;d++)h[d]=d;return h}})(o_)),o_}var Fh={},Rw;function d0(){if(Rw)return Fh;Rw=1;function i(n){return typeof n!="number"||isNaN(n)?1:n}function e(n,r){var s={},a=function(c){return typeof c>"u"?r:c};typeof r=="function"&&(a=r);var o=function(c){return a(c[n])},l=function(){return a(void 0)};return typeof n=="string"?(s.fromAttributes=o,s.fromGraph=function(c,h){return o(c.getNodeAttributes(h))},s.fromEntry=function(c,h){return o(h)}):typeof n=="function"?(s.fromAttributes=function(){throw new Error("graphology-utils/getters/createNodeValueGetter: irrelevant usage.")},s.fromGraph=function(c,h){return a(n(h,c.getNodeAttributes(h)))},s.fromEntry=function(c,h){return a(n(c,h))}):(s.fromAttributes=l,s.fromGraph=l,s.fromEntry=l),s}function t(n,r){var s={},a=function(c){return typeof c>"u"?r:c};typeof r=="function"&&(a=r);var o=function(c){return a(c[n])},l=function(){return a(void 0)};return typeof n=="string"?(s.fromAttributes=o,s.fromGraph=function(c,h){return o(c.getEdgeAttributes(h))},s.fromEntry=function(c,h){return o(h)},s.fromPartialEntry=s.fromEntry,s.fromMinimalEntry=s.fromEntry):typeof n=="function"?(s.fromAttributes=function(){throw new Error("graphology-utils/getters/createEdgeValueGetter: irrelevant usage.")},s.fromGraph=function(c,h){var d=c.extremities(h);return a(n(h,c.getEdgeAttributes(h),d[0],d[1],c.getNodeAttributes(d[0]),c.getNodeAttributes(d[1]),c.isUndirected(h)))},s.fromEntry=function(c,h,d,p,m,v,x){return a(n(c,h,d,p,m,v,x))},s.fromPartialEntry=function(c,h,d,p){return a(n(c,h,d,p))},s.fromMinimalEntry=function(c,h){return a(n(c,h))}):(s.fromAttributes=l,s.fromGraph=l,s.fromEntry=l,s.fromMinimalEntry=l),s}return Fh.createNodeValueGetter=e,Fh.createEdgeValueGetter=t,Fh.createEdgeWeightGetter=function(n){return t(n,i)},Fh}var Dw;function lH(){if(Dw)return Kp;Dw=1;var i=hR(),e=d0().createEdgeWeightGetter;function t(s,a){return s==="outbound"||s==="inbound"?a.directedSize+a.undirectedSize*2:s==="in"||s==="out"||s==="directed"?a.directedSize:a.undirectedSize*2}function n(s,a){a=a||"outbound";var o=s[a+"Neighbors"].bind(s),l=t(a,s),c=i.getPointerArray(l),h=i.getPointerArray(s.order);this.graph=s,this.neighborhood=new h(l),this.starts=new c(s.order+1),this.nodes=s.nodes();var d={},p,m,v,x,_,g,b=0;for(p=0,m=s.order;p<m;p++)d[this.nodes[p]]=p;for(p=0,m=s.order;p<m;p++)for(_=this.nodes[p],g=o(_),this.starts[p]=b,v=0,x=g.length;v<x;v++)this.neighborhood[b++]=d[g[v]];this.starts[p]=l}n.prototype.bounds=function(s){return[this.starts[s],this.starts[s+1]]},n.prototype.project=function(){var s=this,a={};return s.nodes.forEach(function(o,l){a[o]=Array.from(s.neighborhood.slice(s.starts[l],s.starts[l+1])).map(function(c){return s.nodes[c]})}),a},n.prototype.collect=function(s){var a,o,l={};for(a=0,o=s.length;a<o;a++)l[this.nodes[a]]=s[a];return l},n.prototype.assign=function(s,a){var o=0;this.graph.updateEachNodeAttributes(function(l,c){return c[s]=a[o++],c},{attributes:[s]})},Kp.NeighborhoodIndex=n;function r(s,a,o){o=o||"outbound";var l=s[o+"Edges"].bind(s),c=t(o,s),h=i.getPointerArray(c),d=i.getPointerArray(s.order),p=e(a).fromMinimalEntry;this.graph=s,this.neighborhood=new d(c),this.weights=new Float64Array(c),this.outDegrees=new Float64Array(s.order),this.starts=new h(s.order+1),this.nodes=s.nodes();var m={},v,x,_,g,b,E,S,w,T,R=0;for(v=0,x=s.order;v<x;v++)m[this.nodes[v]]=v;for(v=0,x=s.order;v<x;v++)for(b=this.nodes[v],S=l(b),this.starts[v]=R,_=0,g=S.length;_<g;_++)w=S[_],E=s.opposite(b,w),T=p(w,s.getEdgeAttributes(w)),this.neighborhood[R]=m[E],this.weights[R++]=T,this.outDegrees[v]+=T;this.starts[v]=c}return r.prototype.bounds=n.prototype.bounds,r.prototype.project=n.prototype.project,r.prototype.collect=n.prototype.collect,r.prototype.assign=n.prototype.assign,Kp.WeightedNeighborhoodIndex=r,Kp}var l_,Uw;function cH(){if(Uw)return l_;Uw=1;var i=Aa(),e=z1(),t=lH().WeightedNeighborhoodIndex,n={nodePagerankAttribute:"pagerank",getEdgeWeight:"weight",alpha:.85,maxIterations:100,tolerance:1e-6};function r(a,o,l){if(!i(o))throw new Error("graphology-metrics/centrality/pagerank: the given graph is not a valid graphology instance.");l=e(l,n);var c=l.alpha,h=l.maxIterations,d=l.tolerance,p=l.nodePagerankAttribute,m=o.order,v=1/m,x=new t(o,l.getEdgeWeight),_,g,b,E,S=new Float64Array(o.order),w=new Float64Array(x.weights.length),T=[];for(_=0;_<m;_++)for(S[_]=v,b=x.starts[_+1],E=x.outDegrees[_],E===0&&T.push(_),g=x.starts[_];g<b;g++)w[g]=x.weights[g]/E;for(var R=0,U=0,A,D,L,P=!1;R<h;){for(L=S,S=new Float64Array(o.order),A=0,_=0,b=T.length;_<b;_++)A+=L[T[_]];for(A*=c,_=0;_<m;_++){for(b=x.starts[_+1],g=x.starts[_];g<b;g++)D=x.neighborhood[g],S[D]+=c*L[_]*w[g];S[_]+=A*v+(1-c)*v}for(U=0,_=0;_<m;_++)U+=Math.abs(S[_]-L[_]);if(U<m*d){P=!0;break}R++}if(!P)throw Error("graphology-metrics/centrality/pagerank: failed to converge.");if(a){x.assign(p,S);return}return x.collect(S)}var s=r.bind(null,!1);return s.assign=r.bind(null,!0),l_=s,l_}var uH=cH();const hH=mo(uH);var ts={},cl={},c_,Ow;function fH(){if(Ow)return c_;Ow=1;function i(e){if(typeof e!="function")throw new Error("obliterator/iterator: expecting a function!");this.next=e}return typeof Symbol<"u"&&(i.prototype[Symbol.iterator]=function(){return this}),i.of=function(){var e=arguments,t=e.length,n=0;return new i(function(){return n>=t?{done:!0}:{done:!1,value:e[n++]}})},i.empty=function(){var e=new i(function(){return{done:!0}});return e},i.fromSequence=function(e){var t=0,n=e.length;return new i(function(){return t>=n?{done:!0}:{done:!1,value:e[t++]}})},i.is=function(e){return e instanceof i?!0:typeof e=="object"&&e!==null&&typeof e.next=="function"},c_=i,c_}var Jp={},Lw;function dH(){return Lw||(Lw=1,Jp.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<"u",Jp.SYMBOL_SUPPORT=typeof Symbol<"u"),Jp}var u_,Iw;function F1(){if(Iw)return u_;Iw=1;var i=dH(),e=i.ARRAY_BUFFER_SUPPORT,t=i.SYMBOL_SUPPORT;return u_=function(r,s){var a,o,l,c,h;if(!r)throw new Error("obliterator/forEach: invalid iterable.");if(typeof s!="function")throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(r)||e&&ArrayBuffer.isView(r)||typeof r=="string"||r.toString()==="[object Arguments]"){for(l=0,c=r.length;l<c;l++)s(r[l],l);return}if(typeof r.forEach=="function"){r.forEach(s);return}if(t&&Symbol.iterator in r&&typeof r.next!="function"&&(r=r[Symbol.iterator]()),typeof r.next=="function"){for(a=r,l=0;h=a.next(),h.done!==!0;)s(h.value,l),l++;return}for(o in r)r.hasOwnProperty(o)&&s(r[o],o)},u_}var h_,Nw;function pH(){if(Nw)return h_;Nw=1;var i=fH(),e=F1();function t(){this.clear()}return t.prototype.clear=function(){this.items=[],this.offset=0,this.size=0},t.prototype.enqueue=function(n){return this.items.push(n),++this.size},t.prototype.dequeue=function(){if(this.size){var n=this.items[this.offset];return++this.offset*2>=this.items.length&&(this.items=this.items.slice(this.offset),this.offset=0),this.size--,n}},t.prototype.peek=function(){if(this.size)return this.items[this.offset]},t.prototype.forEach=function(n,r){r=arguments.length>1?r:this;for(var s=this.offset,a=0,o=this.items.length;s<o;s++,a++)n.call(r,this.items[s],a,this)},t.prototype.toArray=function(){return this.items.slice(this.offset)},t.prototype.values=function(){var n=this.items,r=this.offset;return new i(function(){if(r>=n.length)return{done:!0};var s=n[r];return r++,{value:s,done:!1}})},t.prototype.entries=function(){var n=this.items,r=this.offset,s=0;return new i(function(){if(r>=n.length)return{done:!0};var a=n[r];return r++,{value:[s++,a],done:!1}})},typeof Symbol<"u"&&(t.prototype[Symbol.iterator]=t.prototype.values),t.prototype.toString=function(){return this.toArray().join(",")},t.prototype.toJSON=function(){return this.toArray()},t.prototype.inspect=function(){var n=this.toArray();return Object.defineProperty(n,"constructor",{value:t,enumerable:!1}),n},typeof Symbol<"u"&&(t.prototype[Symbol.for("nodejs.util.inspect.custom")]=t.prototype.inspect),t.from=function(n){var r=new t;return e(n,function(s){r.enqueue(s)}),r},t.of=function(){return t.from(arguments)},h_=t,h_}var f_,Pw;function mH(){return Pw||(Pw=1,f_=function(e,t){var n=t.length;if(n!==0){var r=e.length;e.length+=n;for(var s=0;s<n;s++)e[r+s]=t[s]}}),f_}var zw;function gH(){if(zw)return cl;zw=1;var i=Aa(),e=pH(),t=mH();function n(c,h,d){if(!i(c))throw new Error("graphology-shortest-path: invalid graphology instance.");if(arguments.length<3)throw new Error("graphology-shortest-path: invalid number of arguments. Expecting at least 3.");if(!c.hasNode(h))throw new Error('graphology-shortest-path: the "'+h+'" source node does not exist in the given graph.');if(!c.hasNode(d))throw new Error('graphology-shortest-path: the "'+d+'" target node does not exist in the given graph.');if(h=""+h,d=""+d,h===d)return[h];var p=c.inboundNeighbors.bind(c),m=c.outboundNeighbors.bind(c),v={},x={};v[h]=null,x[d]=null;var _=[h],g=[d],b,E,S,w,T,R,U,A,D=!1;e:for(;_.length&&g.length;)if(_.length<=g.length){for(b=_,_=[],T=0,U=b.length;T<U;T++)for(E=b[T],S=m(E),R=0,A=S.length;R<A;R++)if(w=S[R],w in v||(_.push(w),v[w]=E),w in x){D=!0;break e}}else for(b=g,g=[],T=0,U=b.length;T<U;T++)for(E=b[T],S=p(E),R=0,A=S.length;R<A;R++)if(w=S[R],w in x||(g.push(w),x[w]=E),w in v){D=!0;break e}if(!D)return null;for(var L=[];w;)L.unshift(w),w=v[w];for(w=x[L[L.length-1]];w;)L.push(w),w=x[w];return L.length?L:null}function r(c,h){if(!i(c))throw new Error("graphology-shortest-path: invalid graphology instance.");if(arguments.length<2)throw new Error("graphology-shortest-path: invalid number of arguments. Expecting at least 2.");if(!c.hasNode(h))throw new Error('graphology-shortest-path: the "'+h+'" source node does not exist in the given graph.');h=""+h;var d={},p={},m,v,x,_,g,b;for(d[h]=!0,p[h]=[h];Object.keys(d).length;){m=d,d={};for(x in m)for(v=c.outboundNeighbors(x),g=0,b=v.length;g<b;g++)_=v[g],p[_]||(p[_]=p[x].concat(_),d[_]=!0)}return p}function s(c,h,d){if(!i(h))throw new Error("graphology-shortest-path: invalid graphology instance.");if(!h.hasNode(d))throw new Error('graphology-shortest-path: the "'+d+'" source node does not exist in the given graph.');d=""+d;var p=new Set,m={},v=0;m[d]=0;for(var x=[d],_,g,b;x.length!==0;){var E=[];for(_=0,g=x.length;_<g;_++)b=x[_],!p.has(b)&&(p.add(b),t(E,h[c](b)),m[b]=v);v++,x=E}return m}var a=s.bind(null,"outboundNeighbors"),o=s.bind(null,"neighbors");function l(c,h){h=""+h;var d=[],p={},m={},v=c.nodes(),x,_,g,b,E,S,w,T,R;for(S=0,T=v.length;S<T;S++)b=v[S],p[b]=[],m[b]=0;var U={};m[h]=1,U[h]=0;for(var A=e.of(h);A.size;)for(b=A.dequeue(),d.push(b),x=U[b],_=m[b],g=c.outboundNeighbors(b),w=0,R=g.length;w<R;w++)E=g[w],E in U||(A.enqueue(E),U[E]=x+1),U[E]===x+1&&(m[E]+=_,p[E].push(b));return[d,p,m]}return cl.bidirectional=n,cl.singleSource=r,cl.singleSourceLength=a,cl.undirectedSingleSourceLength=o,cl.brandes=l,cl}var d_={},Fw;function vH(){if(Fw)return d_;Fw=1;var i=function(){return!0};return d_.edgePathFromNodePath=function(e,t){var n=t.length,r,s,a,o;if(n<2)return s=t[0],o=e.multi?e.findEdge(s,s,i):e.edge(s,s),o?[o]:[];n--;var l=new Array(n);for(r=0;r<n;r++){if(s=t[r],a=t[r+1],o=e.multi?e.findOutboundEdge(s,a,i):e.edge(s,a),o===void 0)throw new Error("graphology-shortest-path: given path is impossible in given graph.");l[r]=o}return l},d_}var Bh={},jc={},Bw;function yH(){if(Bw)return jc;Bw=1;var i=function(r,s){return r<s?-1:r>s?1:0},e=function(r,s){return r<s?1:r>s?-1:0};function t(r){return function(s,a){return r(a,s)}}function n(r){return r===2?function(s,a){return s[0]<a[0]?-1:s[0]>a[0]?1:s[1]<a[1]?-1:s[1]>a[1]?1:0}:function(s,a){for(var o=0;o<r;){if(s[o]<a[o])return-1;if(s[o]>a[o])return 1;o++}return 0}}return jc.DEFAULT_COMPARATOR=i,jc.DEFAULT_REVERSE_COMPARATOR=e,jc.reverseComparator=t,jc.createTupleComparator=n,jc}var qc={},kw;function _H(){if(kw)return qc;kw=1;var i=F1(),e=hR();function t(a){return Array.isArray(a)||e.isTypedArray(a)}function n(a){if(typeof a.length=="number")return a.length;if(typeof a.size=="number")return a.size}function r(a){var o=n(a),l=typeof o=="number"?new Array(o):[],c=0;return i(a,function(h){l[c++]=h}),l}function s(a){var o=n(a),l=typeof o=="number"?e.getPointerArray(o):Array,c=typeof o=="number"?new Array(o):[],h=typeof o=="number"?new l(o):[],d=0;return i(a,function(p){c[d]=p,h[d]=d++}),[c,h]}return qc.isArrayLike=t,qc.guessLength=n,qc.toArray=r,qc.toArrayWithIndices=s,qc}var p_,Gw;function fR(){if(Gw)return p_;Gw=1;var i=F1(),e=yH(),t=_H(),n=e.DEFAULT_COMPARATOR,r=e.reverseComparator;function s(g,b,E,S){for(var w=b[S],T,R;S>E;){if(T=S-1>>1,R=b[T],g(w,R)<0){b[S]=R,S=T;continue}break}b[S]=w}function a(g,b,E){for(var S=b.length,w=E,T=b[E],R=2*E+1,U;R<S;)U=R+1,U<S&&g(b[R],b[U])>=0&&(R=U),b[E]=b[R],E=R,R=2*E+1;b[E]=T,s(g,b,w,E)}function o(g,b,E){b.push(E),s(g,b,0,b.length-1)}function l(g,b){var E=b.pop();if(b.length!==0){var S=b[0];return b[0]=E,a(g,b,0),S}return E}function c(g,b,E){if(b.length===0)throw new Error("mnemonist/heap.replace: cannot pop an empty heap.");var S=b[0];return b[0]=E,a(g,b,0),S}function h(g,b,E){var S;return b.length!==0&&g(b[0],E)<0&&(S=b[0],b[0]=E,E=S,a(g,b,0)),E}function d(g,b){for(var E=b.length,S=E>>1,w=S;--w>=0;)a(g,b,w)}function p(g,b){for(var E=b.length,S=0,w=new Array(E);S<E;)w[S++]=l(g,b);return w}function m(g,b,E){arguments.length===2&&(E=b,b=g,g=n);var S=r(g),w,T,R,U=1/0,A;if(b===1){if(t.isArrayLike(E)){for(w=0,T=E.length;w<T;w++)R=E[w],(U===1/0||g(R,U)<0)&&(U=R);return A=new E.constructor(1),A[0]=U,A}return i(E,function(L){(U===1/0||g(L,U)<0)&&(U=L)}),[U]}if(t.isArrayLike(E)){if(b>=E.length)return E.slice().sort(g);for(A=E.slice(0,b),d(S,A),w=b,T=E.length;w<T;w++)S(E[w],A[0])>0&&c(S,A,E[w]);return A.sort(g)}var D=t.guessLength(E);return D!==null&&D<b&&(b=D),A=new Array(b),w=0,i(E,function(L){w<b?A[w]=L:(w===b&&d(S,A),S(L,A[0])>0&&c(S,A,L)),w++}),A.length>w&&(A.length=w),A.sort(g)}function v(g,b,E){arguments.length===2&&(E=b,b=g,g=n);var S=r(g),w,T,R,U=-1/0,A;if(b===1){if(t.isArrayLike(E)){for(w=0,T=E.length;w<T;w++)R=E[w],(U===-1/0||g(R,U)>0)&&(U=R);return A=new E.constructor(1),A[0]=U,A}return i(E,function(L){(U===-1/0||g(L,U)>0)&&(U=L)}),[U]}if(t.isArrayLike(E)){if(b>=E.length)return E.slice().sort(S);for(A=E.slice(0,b),d(g,A),w=b,T=E.length;w<T;w++)g(E[w],A[0])>0&&c(g,A,E[w]);return A.sort(S)}var D=t.guessLength(E);return D!==null&&D<b&&(b=D),A=new Array(b),w=0,i(E,function(L){w<b?A[w]=L:(w===b&&d(g,A),g(L,A[0])>0&&c(g,A,L)),w++}),A.length>w&&(A.length=w),A.sort(S)}function x(g){if(this.clear(),this.comparator=g||n,typeof this.comparator!="function")throw new Error("mnemonist/Heap.constructor: given comparator should be a function.")}x.prototype.clear=function(){this.items=[],this.size=0},x.prototype.push=function(g){return o(this.comparator,this.items,g),++this.size},x.prototype.peek=function(){return this.items[0]},x.prototype.pop=function(){return this.size!==0&&this.size--,l(this.comparator,this.items)},x.prototype.replace=function(g){return c(this.comparator,this.items,g)},x.prototype.pushpop=function(g){return h(this.comparator,this.items,g)},x.prototype.consume=function(){return this.size=0,p(this.comparator,this.items)},x.prototype.toArray=function(){return p(this.comparator,this.items.slice())},x.prototype.inspect=function(){var g=this.toArray();return Object.defineProperty(g,"constructor",{value:x,enumerable:!1}),g},typeof Symbol<"u"&&(x.prototype[Symbol.for("nodejs.util.inspect.custom")]=x.prototype.inspect);function _(g){if(this.clear(),this.comparator=g||n,typeof this.comparator!="function")throw new Error("mnemonist/MaxHeap.constructor: given comparator should be a function.");this.comparator=r(this.comparator)}return _.prototype=x.prototype,x.from=function(g,b){var E=new x(b),S;return t.isArrayLike(g)?S=g.slice():S=t.toArray(g),d(E.comparator,S),E.items=S,E.size=S.length,E},_.from=function(g,b){var E=new _(b),S;return t.isArrayLike(g)?S=g.slice():S=t.toArray(g),d(E.comparator,S),E.items=S,E.size=S.length,E},x.siftUp=a,x.siftDown=s,x.push=o,x.pop=l,x.replace=c,x.pushpop=h,x.heapify=d,x.consume=p,x.nsmallest=m,x.nlargest=v,x.MinHeap=x,x.MaxHeap=_,p_=x,p_}var Hw;function xH(){if(Hw)return Bh;Hw=1;var i=Aa(),e=d0().createEdgeWeightGetter,t=fR(),n="weight";function r(d,p){return d[0]>p[0]?1:d[0]<p[0]?-1:d[1]>p[1]?1:d[1]<p[1]?-1:d[2]>p[2]?1:d[2]<p[2]?-1:0}function s(d,p){return d[0]>p[0]?1:d[0]<p[0]?-1:d[1]>p[1]?1:d[1]<p[1]?-1:d[2]>p[2]?1:d[2]<p[2]?-1:d[3]>p[3]?1:d[3]<p[3]?-1:0}function a(d,p,m,v){if(p=""+p,m=""+m,!i(d))throw new Error("graphology-shortest-path/dijkstra: invalid graphology instance.");if(p&&!d.hasNode(p))throw new Error('graphology-shortest-path/dijkstra: the "'+p+'" source node does not exist in the given graph.');if(m&&!d.hasNode(m))throw new Error('graphology-shortest-path/dijkstra: the "'+m+'" target node does not exist in the given graph.');if(v=e(v||n).fromMinimalEntry,p===m)return[0,[p]];var x=[{},{}],_=[{},{}],g=[new t(r),new t(r)],b=[{},{}];_[0][p]=[p],_[1][m]=[m],b[0][p]=0,b[1][m]=0;var E=[],S=1/0,w=0,T=1,R,U,A,D,L,P,I,V,H;for(g[0].push([0,w++,p]),g[1].push([0,w++,m]);g[0].size&&g[1].size;)if(T=1-T,R=g[T].pop(),D=R[0],L=R[2],!(L in x[T])){if(x[T][L]=D,L in x[1-T])return[S,E];for(U=T===1?d.inboundEdges(L):d.outboundEdges(L),V=0,H=U.length;V<H;V++){if(I=U[V],P=d.opposite(L,I),A=x[T][L]+v(I,d.getEdgeAttributes(I)),P in x[T]&&A<x[T][P])throw Error("graphology-shortest-path/dijkstra: contradictory paths found. Do some of your edges have a negative weight?");(!(P in b[T])||A<b[T][P])&&(b[T][P]=A,g[T].push([A,w++,P]),_[T][P]=_[T][L].concat(P),P in b[0]&&P in b[1]&&(D=b[0][P]+b[1][P],(E.length===0||S>D)&&(S=D,E=_[0][P].concat(_[1][P].slice(0,-1).reverse()))))}}return[1/0,null]}function o(d,p,m,v,x,_){if(!i(d))throw new Error("graphology-shortest-path/dijkstra: invalid graphology instance.");m=e(m||n).fromMinimalEntry;var g={},b={},E=new t(r),S=0,w,T,R,U,A,D,L,P,I,V,H;for(P=0,V=p.length;P<V;P++)U=p[P],b[U]=0,E.push([0,S++,U]),_&&(_[U]=[U]);for(;E.size;)if(T=E.pop(),L=T[0],U=T[2],!(U in g)){if(g[U]=L,U===x)break;for(w=d.outboundEdges(U),I=0,H=w.length;I<H;I++){if(D=w[I],A=d.opposite(U,D),R=m(D,d.getEdgeAttributes(D))+g[U],A in g&&R<g[A])throw Error("graphology-shortest-path/dijkstra: contradictory paths found. Do some of your edges have a negative weight?");(!(A in b)||R<b[A])&&(b[A]=R,E.push([R,S++,A]),_&&(_[A]=_[U].concat(A)))}}return g}function l(d,p,m){var v={};return o(d,[p],m,0,null,v),v}function c(d,p,m,v){return a(d,p,m,v)[1]}function h(d,p,m){p=""+p,m=e(m||n).fromMinimalEntry;var v=[],x={},_={},g=d.nodes(),b,E,S,w,T,R,U,A,D,L;for(D=0,L=g.length;D<L;D++)R=g[D],x[R]=[],_[R]=0;var P={};_[p]=1;var I={};I[p]=0;var V=0,H=new t(s);for(H.push([0,V++,p,p]);H.size;)if(E=H.pop(),w=E[0],S=E[2],R=E[3],!(R in P))for(_[R]+=_[S],v.push(R),P[R]=w,b=d.outboundEdges(R),D=0,L=b.length;D<L;D++)A=b[D],U=d.opposite(R,A),T=w+m(A,d.getEdgeAttributes(A)),!(U in P)&&(!(U in I)||T<I[U])?(I[U]=T,H.push([T,V++,R,U]),_[U]=0,x[U]=[R]):T===I[U]&&(_[U]+=_[R],x[U].push(R));return[v,x,_]}return Bh.bidirectional=c,Bh.singleSource=l,Bh.brandes=h,Bh}var m_={},Vw;function bH(){if(Vw)return m_;Vw=1;var i=Aa(),e=d0().createEdgeWeightGetter,t=fR(),n="weight";function r(a,o){return a[0]>o[0]?1:a[0]<o[0]?-1:a[1]>o[1]?1:a[1]<o[1]?-1:0}function s(a,o,l,c,h,d){if(!i(a))throw new Error("graphology-shortest-path/astar: invalid graphology instance.");if(o&&!a.hasNode(o))throw new Error('graphology-shortest-path/astar: the "'+o+'" source node does not exist in the given graph.');if(l&&!a.hasNode(l))throw new Error('graphology-shortest-path/astar: the "'+l+'" target node does not exist in the given graph.');if(c=e(c||n).fromMinimalEntry,o===l)return[o];h=h||function(){return 0},d=d||{};var p=0,m=new t(r);m.push([0,p++,o,0,null]);var v={},x={},_,g,b,E,S,w,T,R,U,A,D,L;function P(I,V,H,z){if(L=g===H?z:H,A=c(I,V),A!==null){if(D=E+A,v.hasOwnProperty(L)){if(b=v[L],R=b[0],U=b[1],R<=D)return}else U=h(L,l);d.cutoff&&D+U>d.cutoff||(v[L]=[D,U],m.push([D+U,p++,L,D,g]))}}for(;m.size!==0;){if(_=m.pop(),g=_[2],E=_[3],S=_[4],g===l){for(w=[g],T=S;T!==null;)w.push(T),T=x[T];return w.reverse(),w}x.hasOwnProperty(g)&&(x[g]===null||(R=v[g][0],R<E))||(x[g]=S,a.forEachOutboundEdge(g,P))}return null}return m_.bidirectional=s,m_}var Ww;function SH(){if(Ww)return ts;Ww=1;var i=gH(),e=vH();return ts.unweighted=i,ts.dijkstra=xH(),ts.astar=bH(),ts.bidirectional=i.bidirectional,ts.singleSource=i.singleSource,ts.singleSourceLength=i.singleSourceLength,ts.undirectedSingleSourceLength=i.undirectedSingleSourceLength,ts.brandes=i.brandes,ts.edgePathFromNodePath=e.edgePathFromNodePath,ts}var EH=SH(),B1=od(),Ct=i=>ad(i,B1),k1=od();Ct.write=i=>ad(i,k1);var p0=od();Ct.onStart=i=>ad(i,p0);var G1=od();Ct.onFrame=i=>ad(i,G1);var H1=od();Ct.onFinish=i=>ad(i,H1);var au=[];Ct.setTimeout=(i,e)=>{const t=Ct.now()+e,n=()=>{const s=au.findIndex(a=>a.cancel==n);~s&&au.splice(s,1),oo-=~s?1:0},r={time:t,handler:i,cancel:n};return au.splice(dR(t),0,r),oo+=1,pR(),r};var dR=i=>~(~au.findIndex(e=>e.time>i)||~au.length);Ct.cancel=i=>{p0.delete(i),G1.delete(i),H1.delete(i),B1.delete(i),k1.delete(i)};Ct.sync=i=>{mx=!0,Ct.batchedUpdates(i),mx=!1};Ct.throttle=i=>{let e;function t(){try{i(...e)}finally{e=null}}function n(...r){e=r,Ct.onStart(t)}return n.handler=i,n.cancel=()=>{p0.delete(t),e=null},n};var V1=typeof window<"u"?window.requestAnimationFrame:(()=>{});Ct.use=i=>V1=i;Ct.now=typeof performance<"u"?()=>performance.now():Date.now;Ct.batchedUpdates=i=>i();Ct.catch=console.error;Ct.frameLoop="always";Ct.advance=()=>{Ct.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):gR()};var ao=-1,oo=0,mx=!1;function ad(i,e){mx?(e.delete(i),i(0)):(e.add(i),pR())}function pR(){ao<0&&(ao=0,Ct.frameLoop!=="demand"&&V1(mR))}function MH(){ao=-1}function mR(){~ao&&(V1(mR),Ct.batchedUpdates(gR))}function gR(){const i=ao;ao=Ct.now();const e=dR(ao);if(e&&(vR(au.splice(0,e),t=>t.handler()),oo-=e),!oo){MH();return}p0.flush(),B1.flush(i?Math.min(64,ao-i):16.667),G1.flush(),k1.flush(),H1.flush()}function od(){let i=new Set,e=i;return{add(t){oo+=e==i&&!i.has(t)?1:0,i.add(t)},delete(t){return oo-=e==i&&i.has(t)?1:0,i.delete(t)},flush(t){e.size&&(i=new Set,oo-=e.size,vR(e,n=>n(t)&&i.add(n)),oo+=i.size,e=i)}}}function vR(i,e){i.forEach(t=>{try{e(t)}catch(n){Ct.catch(n)}})}var wH=Object.defineProperty,TH=(i,e)=>{for(var t in e)wH(i,t,{get:e[t],enumerable:!0})},cs={};TH(cs,{assign:()=>CH,colors:()=>co,createStringInterpolator:()=>X1,skipAnimation:()=>_R,to:()=>yR,willAdvance:()=>j1});function gx(){}var AH=(i,e,t)=>Object.defineProperty(i,e,{value:t,writable:!0,configurable:!0}),nt={arr:Array.isArray,obj:i=>!!i&&i.constructor.name==="Object",fun:i=>typeof i=="function",str:i=>typeof i=="string",num:i=>typeof i=="number",und:i=>i===void 0};function ua(i,e){if(nt.arr(i)){if(!nt.arr(e)||i.length!==e.length)return!1;for(let t=0;t<i.length;t++)if(i[t]!==e[t])return!1;return!0}return i===e}var rn=(i,e)=>i.forEach(e);function Ea(i,e,t){if(nt.arr(i)){for(let n=0;n<i.length;n++)e.call(t,i[n],`${n}`);return}for(const n in i)i.hasOwnProperty(n)&&e.call(t,i[n],n)}var Br=i=>nt.und(i)?[]:nt.arr(i)?i:[i];function pf(i,e){if(i.size){const t=Array.from(i);i.clear(),rn(t,e)}}var Qh=(i,...e)=>pf(i,t=>t(...e)),W1=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),X1,yR,co=null,_R=!1,j1=gx,CH=i=>{i.to&&(yR=i.to),i.now&&(Ct.now=i.now),i.colors!==void 0&&(co=i.colors),i.skipAnimation!=null&&(_R=i.skipAnimation),i.createStringInterpolator&&(X1=i.createStringInterpolator),i.requestAnimationFrame&&Ct.use(i.requestAnimationFrame),i.batchedUpdates&&(Ct.batchedUpdates=i.batchedUpdates),i.willAdvance&&(j1=i.willAdvance),i.frameLoop&&(Ct.frameLoop=i.frameLoop)},mf=new Set,zr=[],g_=[],gg=0,m0={get idle(){return!mf.size&&!zr.length},start(i){gg>i.priority?(mf.add(i),Ct.onStart(RH)):(xR(i),Ct(vx))},advance:vx,sort(i){if(gg)Ct.onFrame(()=>m0.sort(i));else{const e=zr.indexOf(i);~e&&(zr.splice(e,1),bR(i))}},clear(){zr=[],mf.clear()}};function RH(){mf.forEach(xR),mf.clear(),Ct(vx)}function xR(i){zr.includes(i)||bR(i)}function bR(i){zr.splice(DH(zr,e=>e.priority>i.priority),0,i)}function vx(i){const e=g_;for(let t=0;t<zr.length;t++){const n=zr[t];gg=n.priority,n.idle||(j1(n),n.advance(i),n.idle||e.push(n))}return gg=0,g_=zr,g_.length=0,zr=e,zr.length>0}function DH(i,e){const t=i.findIndex(e);return t<0?i.length:t}var UH={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},ls="[-+]?\\d*\\.?\\d+",vg=ls+"%";function g0(...i){return"\\(\\s*("+i.join(")\\s*,\\s*(")+")\\s*\\)"}var OH=new RegExp("rgb"+g0(ls,ls,ls)),LH=new RegExp("rgba"+g0(ls,ls,ls,ls)),IH=new RegExp("hsl"+g0(ls,vg,vg)),NH=new RegExp("hsla"+g0(ls,vg,vg,ls)),PH=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,zH=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,FH=/^#([0-9a-fA-F]{6})$/,BH=/^#([0-9a-fA-F]{8})$/;function kH(i){let e;return typeof i=="number"?i>>>0===i&&i>=0&&i<=4294967295?i:null:(e=FH.exec(i))?parseInt(e[1]+"ff",16)>>>0:co&&co[i]!==void 0?co[i]:(e=OH.exec(i))?(Yc(e[1])<<24|Yc(e[2])<<16|Yc(e[3])<<8|255)>>>0:(e=LH.exec(i))?(Yc(e[1])<<24|Yc(e[2])<<16|Yc(e[3])<<8|qw(e[4]))>>>0:(e=PH.exec(i))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+"ff",16)>>>0:(e=BH.exec(i))?parseInt(e[1],16)>>>0:(e=zH.exec(i))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+e[4]+e[4],16)>>>0:(e=IH.exec(i))?(Xw(jw(e[1]),Qp(e[2]),Qp(e[3]))|255)>>>0:(e=NH.exec(i))?(Xw(jw(e[1]),Qp(e[2]),Qp(e[3]))|qw(e[4]))>>>0:null}function v_(i,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?i+(e-i)*6*t:t<1/2?e:t<2/3?i+(e-i)*(2/3-t)*6:i}function Xw(i,e,t){const n=t<.5?t*(1+e):t+e-t*e,r=2*t-n,s=v_(r,n,i+1/3),a=v_(r,n,i),o=v_(r,n,i-1/3);return Math.round(s*255)<<24|Math.round(a*255)<<16|Math.round(o*255)<<8}function Yc(i){const e=parseInt(i,10);return e<0?0:e>255?255:e}function jw(i){return(parseFloat(i)%360+360)%360/360}function qw(i){const e=parseFloat(i);return e<0?0:e>1?255:Math.round(e*255)}function Qp(i){const e=parseFloat(i);return e<0?0:e>100?1:e/100}function Yw(i){let e=kH(i);if(e===null)return i;e=e||0;const t=(e&4278190080)>>>24,n=(e&16711680)>>>16,r=(e&65280)>>>8,s=(e&255)/255;return`rgba(${t}, ${n}, ${r}, ${s})`}var kf=(i,e,t)=>{if(nt.fun(i))return i;if(nt.arr(i))return kf({range:i,output:e,extrapolate:t});if(nt.str(i.output[0]))return X1(i);const n=i,r=n.output,s=n.range||[0,1],a=n.extrapolateLeft||n.extrapolate||"extend",o=n.extrapolateRight||n.extrapolate||"extend",l=n.easing||(c=>c);return c=>{const h=HH(c,s);return GH(c,s[h],s[h+1],r[h],r[h+1],l,a,o,n.map)}};function GH(i,e,t,n,r,s,a,o,l){let c=l?l(i):i;if(c<e){if(a==="identity")return c;a==="clamp"&&(c=e)}if(c>t){if(o==="identity")return c;o==="clamp"&&(c=t)}return n===r?n:e===t?i<=e?n:r:(e===-1/0?c=-c:t===1/0?c=c-e:c=(c-e)/(t-e),c=s(c),n===-1/0?c=-c:r===1/0?c=c+n:c=c*(r-n)+n,c)}function HH(i,e){for(var t=1;t<e.length-1&&!(e[t]>=i);++t);return t-1}var VH={linear:i=>i},Gf=Symbol.for("FluidValue.get"),_u=Symbol.for("FluidValue.observers"),Es=i=>!!(i&&i[Gf]),Ir=i=>i&&i[Gf]?i[Gf]():i,Zw=i=>i[_u]||null;function WH(i,e){i.eventObserved?i.eventObserved(e):i(e)}function yg(i,e){const t=i[_u];t&&t.forEach(n=>{WH(n,e)})}var XH=class{constructor(i){if(!i&&!(i=this.get))throw Error("Unknown getter");jH(this,i)}},jH=(i,e)=>SR(i,Gf,e);function ld(i,e){if(i[Gf]){let t=i[_u];t||SR(i,_u,t=new Set),t.has(e)||(t.add(e),i.observerAdded&&i.observerAdded(t.size,e))}return e}function _g(i,e){const t=i[_u];if(t&&t.has(e)){const n=t.size-1;n?t.delete(e):i[_u]=null,i.observerRemoved&&i.observerRemoved(n,e)}}var SR=(i,e,t)=>Object.defineProperty(i,e,{value:t,writable:!0,configurable:!0}),um=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,qH=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,Kw=new RegExp(`(${um.source})(%|[a-z]+)`,"i"),YH=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,v0=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,ER=i=>{const[e,t]=ZH(i);if(!e||W1())return i;const n=window.getComputedStyle(document.documentElement).getPropertyValue(e);if(n)return n.trim();if(t&&t.startsWith("--")){const r=window.getComputedStyle(document.documentElement).getPropertyValue(t);return r||i}else{if(t&&v0.test(t))return ER(t);if(t)return t}return i},ZH=i=>{const e=v0.exec(i);if(!e)return[,];const[,t,n]=e;return[t,n]},y_,KH=(i,e,t,n,r)=>`rgba(${Math.round(e)}, ${Math.round(t)}, ${Math.round(n)}, ${r})`,MR=i=>{y_||(y_=co?new RegExp(`(${Object.keys(co).join("|")})(?!\\w)`,"g"):/^\b$/);const e=i.output.map(s=>Ir(s).replace(v0,ER).replace(qH,Yw).replace(y_,Yw)),t=e.map(s=>s.match(um).map(Number)),r=t[0].map((s,a)=>t.map(o=>{if(!(a in o))throw Error('The arity of each "output" value must be equal');return o[a]})).map(s=>kf({...i,output:s}));return s=>{const a=!Kw.test(e[0])&&e.find(l=>Kw.test(l))?.replace(um,"");let o=0;return e[0].replace(um,()=>`${r[o++](s)}${a||""}`).replace(YH,KH)}},q1="react-spring: ",wR=i=>{const e=i;let t=!1;if(typeof e!="function")throw new TypeError(`${q1}once requires a function parameter`);return(...n)=>{t||(e(...n),t=!0)}},JH=wR(console.warn);function QH(){JH(`${q1}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var $H=wR(console.warn);function eV(){$H(`${q1}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function y0(i){return nt.str(i)&&(i[0]=="#"||/\d/.test(i)||!W1()&&v0.test(i)||i in(co||{}))}var Y1=W1()?K.useEffect:K.useLayoutEffect,tV=()=>{const i=K.useRef(!1);return Y1(()=>(i.current=!0,()=>{i.current=!1}),[]),i};function TR(){const i=K.useState()[1],e=tV();return()=>{e.current&&i(Math.random())}}var AR=i=>K.useEffect(i,nV),nV=[];function Jw(i){const e=K.useRef(void 0);return K.useEffect(()=>{e.current=i}),e.current}var Hf=Symbol.for("Animated:node"),iV=i=>!!i&&i[Hf]===i,Ss=i=>i&&i[Hf],Z1=(i,e)=>AH(i,Hf,e),_0=i=>i&&i[Hf]&&i[Hf].getPayload(),CR=class{constructor(){Z1(this,this)}getPayload(){return this.payload||[]}},x0=class RR extends CR{constructor(e){super(),this._value=e,this.done=!0,this.durationProgress=0,nt.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new RR(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return nt.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value===e?!1:(this._value=e,!0)}reset(){const{done:e}=this;this.done=!1,nt.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},xg=class DR extends x0{constructor(e){super(0),this._string=null,this._toString=kf({output:[e,e]})}static create(e){return new DR(e)}getValue(){const e=this._string;return e??(this._string=this._toString(this._value))}setValue(e){if(nt.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else if(super.setValue(e))this._string=null;else return!1;return!0}reset(e){e&&(this._toString=kf({output:[this.getValue(),e]})),this._value=0,super.reset()}},bg={dependencies:null},K1=class extends CR{constructor(i){super(),this.source=i,this.setValue(i)}getValue(i){const e={};return Ea(this.source,(t,n)=>{iV(t)?e[n]=t.getValue(i):Es(t)?e[n]=Ir(t):i||(e[n]=t)}),e}setValue(i){this.source=i,this.payload=this._makePayload(i)}reset(){this.payload&&rn(this.payload,i=>i.reset())}_makePayload(i){if(i){const e=new Set;return Ea(i,this._addToPayload,e),Array.from(e)}}_addToPayload(i){bg.dependencies&&Es(i)&&bg.dependencies.add(i);const e=_0(i);e&&rn(e,t=>this.add(t))}},rV=class UR extends K1{constructor(e){super(e)}static create(e){return new UR(e)}getValue(){return this.source.map(e=>e.getValue())}setValue(e){const t=this.getPayload();return e.length==t.length?t.map((n,r)=>n.setValue(e[r])).some(Boolean):(super.setValue(e.map(sV)),!0)}};function sV(i){return(y0(i)?xg:x0).create(i)}function yx(i){const e=Ss(i);return e?e.constructor:nt.arr(i)?rV:y0(i)?xg:x0}var Qw=(i,e)=>{const t=!nt.fun(i)||i.prototype&&i.prototype.isReactComponent;return K.forwardRef((n,r)=>{const s=K.useRef(null),a=t&&K.useCallback(v=>{s.current=lV(r,v)},[r]),[o,l]=oV(n,e),c=TR(),h=()=>{const v=s.current;if(t&&!v)return;(v?e.applyAnimatedValues(v,o.getValue(!0)):!1)===!1&&c()},d=new aV(h,l),p=K.useRef(void 0);Y1(()=>(p.current=d,rn(l,v=>ld(v,d)),()=>{p.current&&(rn(p.current.deps,v=>_g(v,p.current)),Ct.cancel(p.current.update))})),K.useEffect(h,[]),AR(()=>()=>{const v=p.current;rn(v.deps,x=>_g(x,v))});const m=e.getComponentProps(o.getValue());return K.createElement(i,{...m,ref:a})})},aV=class{constructor(i,e){this.update=i,this.deps=e}eventObserved(i){i.type=="change"&&Ct.write(this.update)}};function oV(i,e){const t=new Set;return bg.dependencies=t,i.style&&(i={...i,style:e.createAnimatedStyle(i.style)}),i=new K1(i),bg.dependencies=null,[i,t]}function lV(i,e){return i&&(nt.fun(i)?i(e):i.current=e),e}var $w=Symbol.for("AnimatedComponent"),cV=(i,{applyAnimatedValues:e=()=>!1,createAnimatedStyle:t=r=>new K1(r),getComponentProps:n=r=>r}={})=>{const r={applyAnimatedValues:e,createAnimatedStyle:t,getComponentProps:n},s=a=>{const o=eT(a)||"Anonymous";return nt.str(a)?a=s[a]||(s[a]=Qw(a,r)):a=a[$w]||(a[$w]=Qw(a,r)),a.displayName=`Animated(${o})`,a};return Ea(i,(a,o)=>{nt.arr(i)&&(o=eT(a)),s[o]=s(a)}),{animated:s}},eT=i=>nt.str(i)?i:i&&nt.str(i.displayName)?i.displayName:nt.fun(i)&&i.name||null;function ml(i,...e){return nt.fun(i)?i(...e):i}var gf=(i,e)=>i===!0||!!(e&&i&&(nt.fun(i)?i(e):Br(i).includes(e))),OR=(i,e)=>nt.obj(i)?e&&i[e]:i,LR=(i,e)=>i.default===!0?i[e]:i.default?i.default[e]:void 0,uV=i=>i,J1=(i,e=uV)=>{let t=hV;i.default&&i.default!==!0&&(i=i.default,t=Object.keys(i));const n={};for(const r of t){const s=e(i[r],r);nt.und(s)||(n[r]=s)}return n},hV=["config","onProps","onStart","onChange","onPause","onResume","onRest"],fV={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function dV(i){const e={};let t=0;if(Ea(i,(n,r)=>{fV[r]||(e[r]=n,t++)}),t)return e}function IR(i){const e=dV(i);if(e){const t={to:e};return Ea(i,(n,r)=>r in e||(t[r]=n)),t}return{...i}}function Vf(i){return i=Ir(i),nt.arr(i)?i.map(Vf):y0(i)?cs.createStringInterpolator({range:[0,1],output:[i,i]})(1):i}function pV(i){for(const e in i)return!0;return!1}function _x(i){return nt.fun(i)||nt.arr(i)&&nt.obj(i[0])}function mV(i,e){i.ref?.delete(i),e?.delete(i)}function gV(i,e){e&&i.ref!==e&&(i.ref?.delete(i),e.add(i),i.ref=e)}var vV={default:{tension:170,friction:26}},xx={...vV.default,mass:1,damping:1,easing:VH.linear,clamp:!1},yV=class{constructor(){this.velocity=0,Object.assign(this,xx)}};function _V(i,e,t){t&&(t={...t},tT(t,e),e={...t,...e}),tT(i,e),Object.assign(i,e);for(const a in xx)i[a]==null&&(i[a]=xx[a]);let{frequency:n,damping:r}=i;const{mass:s}=i;return nt.und(n)||(n<.01&&(n=.01),r<0&&(r=0),i.tension=Math.pow(2*Math.PI/n,2)*s,i.friction=4*Math.PI*r*s/n),i}function tT(i,e){if(!nt.und(e.decay))i.duration=void 0;else{const t=!nt.und(e.tension)||!nt.und(e.friction);(t||!nt.und(e.frequency)||!nt.und(e.damping)||!nt.und(e.mass))&&(i.duration=void 0,i.decay=void 0),t&&(i.frequency=void 0)}}var nT=[],xV=class{constructor(){this.changed=!1,this.values=nT,this.toValues=null,this.fromValues=nT,this.config=new yV,this.immediate=!1}};function NR(i,{key:e,props:t,defaultProps:n,state:r,actions:s}){return new Promise((a,o)=>{let l,c,h=gf(t.cancel??n?.cancel,e);if(h)m();else{nt.und(t.pause)||(r.paused=gf(t.pause,e));let v=n?.pause;v!==!0&&(v=r.paused||gf(v,e)),l=ml(t.delay||0,e),v?(r.resumeQueue.add(p),s.pause()):(s.resume(),p())}function d(){r.resumeQueue.add(p),r.timeouts.delete(c),c.cancel(),l=c.time-Ct.now()}function p(){l>0&&!cs.skipAnimation?(r.delayed=!0,c=Ct.setTimeout(m,l),r.pauseQueue.add(d),r.timeouts.add(c)):m()}function m(){r.delayed&&(r.delayed=!1),r.pauseQueue.delete(d),r.timeouts.delete(c),i<=(r.cancelId||0)&&(h=!0);try{s.start({...t,callId:i,cancel:h},a)}catch(v){o(v)}}})}var Q1=(i,e)=>e.length==1?e[0]:e.some(t=>t.cancelled)?ou(i.get()):e.every(t=>t.noop)?PR(i.get()):ss(i.get(),e.every(t=>t.finished)),PR=i=>({value:i,noop:!0,finished:!0,cancelled:!1}),ss=(i,e,t=!1)=>({value:i,finished:e,cancelled:t}),ou=i=>({value:i,cancelled:!0,finished:!1});function zR(i,e,t,n){const{callId:r,parentId:s,onRest:a}=e,{asyncTo:o,promise:l}=t;return!s&&i===o&&!e.reset?l:t.promise=(async()=>{t.asyncId=r,t.asyncTo=i;const c=J1(e,(_,g)=>g==="onRest"?void 0:_);let h,d;const p=new Promise((_,g)=>(h=_,d=g)),m=_=>{const g=r<=(t.cancelId||0)&&ou(n)||r!==t.asyncId&&ss(n,!1);if(g)throw _.result=g,d(_),_},v=(_,g)=>{const b=new iT,E=new rT;return(async()=>{if(cs.skipAnimation)throw Wf(t),E.result=ss(n,!1),d(E),E;m(b);const S=nt.obj(_)?{..._}:{...g,to:_};S.parentId=r,Ea(c,(T,R)=>{nt.und(S[R])&&(S[R]=T)});const w=await n.start(S);return m(b),t.paused&&await new Promise(T=>{t.resumeQueue.add(T)}),w})()};let x;if(cs.skipAnimation)return Wf(t),ss(n,!1);try{let _;nt.arr(i)?_=(async g=>{for(const b of g)await v(b)})(i):_=Promise.resolve(i(v,n.stop.bind(n))),await Promise.all([_.then(h),p]),x=ss(n.get(),!0,!1)}catch(_){if(_ instanceof iT)x=_.result;else if(_ instanceof rT)x=_.result;else throw _}finally{r==t.asyncId&&(t.asyncId=s,t.asyncTo=s?o:void 0,t.promise=s?l:void 0)}return nt.fun(a)&&Ct.batchedUpdates(()=>{a(x,n,n.item)}),x})()}function Wf(i,e){pf(i.timeouts,t=>t.cancel()),i.pauseQueue.clear(),i.resumeQueue.clear(),i.asyncId=i.asyncTo=i.promise=void 0,e&&(i.cancelId=e)}var iT=class extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},rT=class extends Error{constructor(){super("SkipAnimationSignal")}},bx=i=>i instanceof $1,bV=1,$1=class extends XH{constructor(){super(...arguments),this.id=bV++,this._priority=0}get priority(){return this._priority}set priority(i){this._priority!=i&&(this._priority=i,this._onPriorityChange(i))}get(){const i=Ss(this);return i&&i.getValue()}to(...i){return cs.to(this,i)}interpolate(...i){return QH(),cs.to(this,i)}toJSON(){return this.get()}observerAdded(i){i==1&&this._attach()}observerRemoved(i){i==0&&this._detach()}_attach(){}_detach(){}_onChange(i,e=!1){yg(this,{type:"change",parent:this,value:i,idle:e})}_onPriorityChange(i){this.idle||m0.sort(this),yg(this,{type:"priority",parent:this,priority:i})}},Ul=Symbol.for("SpringPhase"),FR=1,Sx=2,Ex=4,__=i=>(i[Ul]&FR)>0,to=i=>(i[Ul]&Sx)>0,kh=i=>(i[Ul]&Ex)>0,sT=(i,e)=>e?i[Ul]|=Sx|FR:i[Ul]&=~Sx,aT=(i,e)=>e?i[Ul]|=Ex:i[Ul]&=~Ex,SV=class extends $1{constructor(i,e){if(super(),this.animation=new xV,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!nt.und(i)||!nt.und(e)){const t=nt.obj(i)?{...i}:{...e,from:i};nt.und(t.default)&&(t.default=!0),this.start(t)}}get idle(){return!(to(this)||this._state.asyncTo)||kh(this)}get goal(){return Ir(this.animation.to)}get velocity(){const i=Ss(this);return i instanceof x0?i.lastVelocity||0:i.getPayload().map(e=>e.lastVelocity||0)}get hasAnimated(){return __(this)}get isAnimating(){return to(this)}get isPaused(){return kh(this)}get isDelayed(){return this._state.delayed}advance(i){let e=!0,t=!1;const n=this.animation;let{toValues:r}=n;const{config:s}=n,a=_0(n.to);!a&&Es(n.to)&&(r=Br(Ir(n.to))),n.values.forEach((c,h)=>{if(c.done)return;const d=c.constructor==xg?1:a?a[h].lastPosition:r[h];let p=n.immediate,m=d;if(!p){if(m=c.lastPosition,s.tension<=0){c.done=!0;return}let v=c.elapsedTime+=i;const x=n.fromValues[h],_=c.v0!=null?c.v0:c.v0=nt.arr(s.velocity)?s.velocity[h]:s.velocity;let g;const b=s.precision||(x==d?.005:Math.min(1,Math.abs(d-x)*.001));if(nt.und(s.duration))if(s.decay){const E=s.decay===!0?.998:s.decay,S=Math.exp(-(1-E)*v);m=x+_/(1-E)*(1-S),p=Math.abs(c.lastPosition-m)<=b,g=_*S}else{g=c.lastVelocity==null?_:c.lastVelocity;const E=s.restVelocity||b/10,S=s.clamp?0:s.bounce,w=!nt.und(S),T=x==d?c.v0>0:x<d;let R,U=!1;const A=1,D=Math.ceil(i/A);for(let L=0;L<D&&(R=Math.abs(g)>E,!(!R&&(p=Math.abs(d-m)<=b,p)));++L){w&&(U=m==d||m>d==T,U&&(g=-g*S,m=d));const P=-s.tension*1e-6*(m-d),I=-s.friction*.001*g,V=(P+I)/s.mass;g=g+V*A,m=m+g*A}}else{let E=1;s.duration>0&&(this._memoizedDuration!==s.duration&&(this._memoizedDuration=s.duration,c.durationProgress>0&&(c.elapsedTime=s.duration*c.durationProgress,v=c.elapsedTime+=i)),E=(s.progress||0)+v/this._memoizedDuration,E=E>1?1:E<0?0:E,c.durationProgress=E),m=x+s.easing(E)*(d-x),g=(m-c.lastPosition)/i,p=E==1}c.lastVelocity=g,Number.isNaN(m)&&(console.warn("Got NaN while animating:",this),p=!0)}a&&!a[h].done&&(p=!1),p?c.done=!0:e=!1,c.setValue(m,s.round)&&(t=!0)});const o=Ss(this),l=o.getValue();if(e){const c=Ir(n.to);(l!==c||t)&&!s.decay?(o.setValue(c),this._onChange(c)):t&&s.decay&&this._onChange(l),this._stop()}else t&&this._onChange(l)}set(i){return Ct.batchedUpdates(()=>{this._stop(),this._focus(i),this._set(i)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(to(this)){const{to:i,config:e}=this.animation;Ct.batchedUpdates(()=>{this._onStart(),e.decay||this._set(i,!1),this._stop()})}return this}update(i){return(this.queue||(this.queue=[])).push(i),this}start(i,e){let t;return nt.und(i)?(t=this.queue||[],this.queue=[]):t=[nt.obj(i)?i:{...e,to:i}],Promise.all(t.map(n=>this._update(n))).then(n=>Q1(this,n))}stop(i){const{to:e}=this.animation;return this._focus(this.get()),Wf(this._state,i&&this._lastCallId),Ct.batchedUpdates(()=>this._stop(e,i)),this}reset(){this._update({reset:!0})}eventObserved(i){i.type=="change"?this._start():i.type=="priority"&&(this.priority=i.priority+1)}_prepareNode(i){const e=this.key||"";let{to:t,from:n}=i;t=nt.obj(t)?t[e]:t,(t==null||_x(t))&&(t=void 0),n=nt.obj(n)?n[e]:n,n==null&&(n=void 0);const r={to:t,from:n};return __(this)||(i.reverse&&([t,n]=[n,t]),n=Ir(n),nt.und(n)?Ss(this)||this._set(t):this._set(n)),r}_update({...i},e){const{key:t,defaultProps:n}=this;i.default&&Object.assign(n,J1(i,(a,o)=>/^on/.test(o)?OR(a,t):a)),lT(this,i,"onProps"),Hh(this,"onProps",i,this);const r=this._prepareNode(i);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const s=this._state;return NR(++this._lastCallId,{key:t,props:i,defaultProps:n,state:s,actions:{pause:()=>{kh(this)||(aT(this,!0),Qh(s.pauseQueue),Hh(this,"onPause",ss(this,Gh(this,this.animation.to)),this))},resume:()=>{kh(this)&&(aT(this,!1),to(this)&&this._resume(),Qh(s.resumeQueue),Hh(this,"onResume",ss(this,Gh(this,this.animation.to)),this))},start:this._merge.bind(this,r)}}).then(a=>{if(i.loop&&a.finished&&!(e&&a.noop)){const o=BR(i);if(o)return this._update(o,!0)}return a})}_merge(i,e,t){if(e.cancel)return this.stop(!0),t(ou(this));const n=!nt.und(i.to),r=!nt.und(i.from);if(n||r)if(e.callId>this._lastToId)this._lastToId=e.callId;else return t(ou(this));const{key:s,defaultProps:a,animation:o}=this,{to:l,from:c}=o;let{to:h=l,from:d=c}=i;r&&!n&&(!e.default||nt.und(h))&&(h=d),e.reverse&&([h,d]=[d,h]);const p=!ua(d,c);p&&(o.from=d),d=Ir(d);const m=!ua(h,l);m&&this._focus(h);const v=_x(e.to),{config:x}=o,{decay:_,velocity:g}=x;(n||r)&&(x.velocity=0),e.config&&!v&&_V(x,ml(e.config,s),e.config!==a.config?ml(a.config,s):void 0);let b=Ss(this);if(!b||nt.und(h))return t(ss(this,!0));const E=nt.und(e.reset)?r&&!e.default:!nt.und(d)&&gf(e.reset,s),S=E?d:this.get(),w=Vf(h),T=nt.num(w)||nt.arr(w)||y0(w),R=!v&&(!T||gf(a.immediate||e.immediate,s));if(m){const L=yx(h);if(L!==b.constructor)if(R)b=this._set(w);else throw Error(`Cannot animate between ${b.constructor.name} and ${L.name}, as the "to" prop suggests`)}const U=b.constructor;let A=Es(h),D=!1;if(!A){const L=E||!__(this)&&p;(m||L)&&(D=ua(Vf(S),w),A=!D),(!ua(o.immediate,R)&&!R||!ua(x.decay,_)||!ua(x.velocity,g))&&(A=!0)}if(D&&to(this)&&(o.changed&&!E?A=!0:A||this._stop(l)),!v&&((A||Es(l))&&(o.values=b.getPayload(),o.toValues=Es(h)?null:U==xg?[1]:Br(w)),o.immediate!=R&&(o.immediate=R,!R&&!E&&this._set(l)),A)){const{onRest:L}=o;rn(MV,I=>lT(this,e,I));const P=ss(this,Gh(this,l));Qh(this._pendingCalls,P),this._pendingCalls.add(t),o.changed&&Ct.batchedUpdates(()=>{o.changed=!E,L?.(P,this),E?ml(a.onRest,P):o.onStart?.(P,this)})}E&&this._set(S),v?t(zR(e.to,e,this._state,this)):A?this._start():to(this)&&!m?this._pendingCalls.add(t):t(PR(S))}_focus(i){const e=this.animation;i!==e.to&&(Zw(this)&&this._detach(),e.to=i,Zw(this)&&this._attach())}_attach(){let i=0;const{to:e}=this.animation;Es(e)&&(ld(e,this),bx(e)&&(i=e.priority+1)),this.priority=i}_detach(){const{to:i}=this.animation;Es(i)&&_g(i,this)}_set(i,e=!0){const t=Ir(i);if(!nt.und(t)){const n=Ss(this);if(!n||!ua(t,n.getValue())){const r=yx(t);!n||n.constructor!=r?Z1(this,r.create(t)):n.setValue(t),n&&Ct.batchedUpdates(()=>{this._onChange(t,e)})}}return Ss(this)}_onStart(){const i=this.animation;i.changed||(i.changed=!0,Hh(this,"onStart",ss(this,Gh(this,i.to)),this))}_onChange(i,e){e||(this._onStart(),ml(this.animation.onChange,i,this)),ml(this.defaultProps.onChange,i,this),super._onChange(i,e)}_start(){const i=this.animation;Ss(this).reset(Ir(i.to)),i.immediate||(i.fromValues=i.values.map(e=>e.lastPosition)),to(this)||(sT(this,!0),kh(this)||this._resume())}_resume(){cs.skipAnimation?this.finish():m0.start(this)}_stop(i,e){if(to(this)){sT(this,!1);const t=this.animation;rn(t.values,r=>{r.done=!0}),t.toValues&&(t.onChange=t.onPause=t.onResume=void 0),yg(this,{type:"idle",parent:this});const n=e?ou(this.get()):ss(this.get(),Gh(this,i??t.to));Qh(this._pendingCalls,n),t.changed&&(t.changed=!1,Hh(this,"onRest",n,this))}}};function Gh(i,e){const t=Vf(e),n=Vf(i.get());return ua(n,t)}function BR(i,e=i.loop,t=i.to){const n=ml(e);if(n){const r=n!==!0&&IR(n),s=(r||i).reverse,a=!r||r.reset;return Xf({...i,loop:e,default:!1,pause:void 0,to:!s||_x(t)?t:void 0,from:a?i.from:void 0,reset:a,...r})}}function Xf(i){const{to:e,from:t}=i=IR(i),n=new Set;return nt.obj(e)&&oT(e,n),nt.obj(t)&&oT(t,n),i.keys=n.size?Array.from(n):null,i}function EV(i){const e=Xf(i);return nt.und(e.default)&&(e.default=J1(e)),e}function oT(i,e){Ea(i,(t,n)=>t!=null&&e.add(n))}var MV=["onStart","onRest","onChange","onPause","onResume"];function lT(i,e,t){i.animation[t]=e[t]!==LR(e,t)?OR(e[t],i.key):void 0}function Hh(i,e,...t){i.animation[e]?.(...t),i.defaultProps[e]?.(...t)}var wV=["onStart","onChange","onRest"],TV=1,AV=class{constructor(e,t){this.id=TV++,this.springs={},this.queue=[],this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(e=>e.idle&&!e.isDelayed&&!e.isPaused)}get item(){return this._item}set item(e){this._item=e}get(){const e={};return this.each((t,n)=>e[n]=t.get()),e}set(e){for(const t in e){const n=e[t];nt.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(Xf(e)),this}start(e){let{queue:t}=this;return e?t=Br(e).map(Xf):this.queue=[],this._flush?this._flush(this,t):(WR(this,t),Mx(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;rn(Br(t),r=>n[r].stop(!!e))}else Wf(this._state,this._lastAsyncId),this.each(n=>n.stop(!!e));return this}pause(e){if(nt.und(e))this.start({pause:!0});else{const t=this.springs;rn(Br(e),n=>t[n].pause())}return this}resume(e){if(nt.und(e))this.start({pause:!1});else{const t=this.springs;rn(Br(e),n=>t[n].resume())}return this}each(e){Ea(this.springs,e)}_onFrame(){const{onStart:e,onChange:t,onRest:n}=this._events,r=this._active.size>0,s=this._changed.size>0;(r&&!this._started||s&&!this._started)&&(this._started=!0,pf(e,([l,c])=>{c.value=this.get(),l(c,this,this._item)}));const a=!r&&this._started,o=s||a&&n.size?this.get():null;s&&t.size&&pf(t,([l,c])=>{c.value=o,l(c,this,this._item)}),a&&(this._started=!1,pf(n,([l,c])=>{c.value=o,l(c,this,this._item)}))}eventObserved(e){if(e.type=="change")this._changed.add(e.parent),e.idle||this._active.add(e.parent);else if(e.type=="idle")this._active.delete(e.parent);else return;Ct.onFrame(this._onFrame)}};function Mx(i,e){return Promise.all(e.map(t=>kR(i,t))).then(t=>Q1(i,t))}async function kR(i,e,t){const{keys:n,to:r,from:s,loop:a,onRest:o,onResolve:l}=e,c=nt.obj(e.default)&&e.default;a&&(e.loop=!1),r===!1&&(e.to=null),s===!1&&(e.from=null);const h=nt.arr(r)||nt.fun(r)?r:void 0;h?(e.to=void 0,e.onRest=void 0,c&&(c.onRest=void 0)):rn(wV,x=>{const _=e[x];if(nt.fun(_)){const g=i._events[x];e[x]=({finished:b,cancelled:E})=>{const S=g.get(_);S?(b||(S.finished=!1),E&&(S.cancelled=!0)):g.set(_,{value:null,finished:b||!1,cancelled:E||!1})},c&&(c[x]=e[x])}});const d=i._state;e.pause===!d.paused?(d.paused=e.pause,Qh(e.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(e.pause=!0);const p=(n||Object.keys(i.springs)).map(x=>i.springs[x].start(e)),m=e.cancel===!0||LR(e,"cancel")===!0;(h||m&&d.asyncId)&&p.push(NR(++i._lastAsyncId,{props:e,state:d,actions:{pause:gx,resume:gx,start(x,_){m?(Wf(d,i._lastAsyncId),_(ou(i))):(x.onRest=o,_(zR(h,x,d,i)))}}})),d.paused&&await new Promise(x=>{d.resumeQueue.add(x)});const v=Q1(i,await Promise.all(p));if(a&&v.finished&&!(t&&v.noop)){const x=BR(e,a,r);if(x)return WR(i,[x]),kR(i,x,!0)}return l&&Ct.batchedUpdates(()=>l(v,i,i.item)),v}function cT(i,e){const t={...i.springs};return e&&rn(Br(e),n=>{nt.und(n.keys)&&(n=Xf(n)),nt.obj(n.to)||(n={...n,to:void 0}),VR(t,n,r=>HR(r))}),GR(i,t),t}function GR(i,e){Ea(e,(t,n)=>{i.springs[n]||(i.springs[n]=t,ld(t,i))})}function HR(i,e){const t=new SV;return t.key=i,e&&ld(t,e),t}function VR(i,e,t){e.keys&&rn(e.keys,n=>{(i[n]||(i[n]=t(n)))._prepareNode(e)})}function WR(i,e){rn(e,t=>{VR(i.springs,t,n=>HR(n,i))})}var CV=K.createContext({pause:!1,immediate:!1}),RV=()=>{const i=[],e=function(n){eV();const r=[];return rn(i,(s,a)=>{if(nt.und(n))r.push(s.start());else{const o=t(n,s,a);o&&r.push(s.start(o))}}),r};e.current=i,e.add=function(n){i.includes(n)||i.push(n)},e.delete=function(n){const r=i.indexOf(n);~r&&i.splice(r,1)},e.pause=function(){return rn(i,n=>n.pause(...arguments)),this},e.resume=function(){return rn(i,n=>n.resume(...arguments)),this},e.set=function(n){rn(i,(r,s)=>{const a=nt.fun(n)?n(s,r):n;a&&r.set(a)})},e.start=function(n){const r=[];return rn(i,(s,a)=>{if(nt.und(n))r.push(s.start());else{const o=this._getProps(n,s,a);o&&r.push(s.start(o))}}),r},e.stop=function(){return rn(i,n=>n.stop(...arguments)),this},e.update=function(n){return rn(i,(r,s)=>r.update(this._getProps(n,r,s))),this};const t=function(n,r,s){return nt.fun(n)?n(s,r):n};return e._getProps=t,e};function DV(i,e,t){const n=nt.fun(e)&&e;n&&!t&&(t=[]);const r=K.useMemo(()=>n||arguments.length==3?RV():void 0,[]),s=K.useRef(0),a=TR(),o=K.useMemo(()=>({ctrls:[],queue:[],flush(g,b){const E=cT(g,b);return s.current>0&&!o.queue.length&&!Object.keys(E).some(w=>!g.springs[w])?Mx(g,b):new Promise(w=>{GR(g,E),o.queue.push(()=>{w(Mx(g,b))}),a()})}}),[]),l=K.useRef([...o.ctrls]),c=K.useRef([]),h=Jw(i)||0;K.useMemo(()=>{rn(l.current.slice(i,h),g=>{mV(g,r),g.stop(!0)}),l.current.length=i,d(h,i)},[i]),K.useMemo(()=>{d(0,Math.min(h,i))},t);function d(g,b){for(let E=g;E<b;E++){const S=l.current[E]||(l.current[E]=new AV(null,o.flush)),w=n?n(E,S):e[E];w&&(c.current[E]=EV(w))}}const p=l.current.map((g,b)=>cT(g,c.current[b])),m=K.useContext(CV),v=Jw(m),x=m!==v&&pV(m);Y1(()=>{s.current++,o.ctrls=l.current;const{queue:g}=o;g.length&&(o.queue=[],rn(g,b=>b())),rn(l.current,(b,E)=>{r?.add(b),x&&b.start({default:m});const S=c.current[E];S&&(gV(b,S.ref),b.ref?b.queue.push(S):b.start(S))})}),AR(()=>()=>{rn(o.ctrls,g=>g.stop(!0))});const _=p.map(g=>({...g}));return r?[_,r]:_}function er(i,e){const t=nt.fun(i),[[n],r]=DV(1,t?i:[i],t?e||[]:e);return t||arguments.length==2?[n,r]:n}var UV=class extends $1{constructor(i,e){super(),this.source=i,this.idle=!0,this._active=new Set,this.calc=kf(...e);const t=this._get(),n=yx(t);Z1(this,n.create(t))}advance(i){const e=this._get(),t=this.get();ua(e,t)||(Ss(this).setValue(e),this._onChange(e,this.idle)),!this.idle&&uT(this._active)&&x_(this)}_get(){const i=nt.arr(this.source)?this.source.map(Ir):Br(Ir(this.source));return this.calc(...i)}_start(){this.idle&&!uT(this._active)&&(this.idle=!1,rn(_0(this),i=>{i.done=!1}),cs.skipAnimation?(Ct.batchedUpdates(()=>this.advance()),x_(this)):m0.start(this))}_attach(){let i=1;rn(Br(this.source),e=>{Es(e)&&ld(e,this),bx(e)&&(e.idle||this._active.add(e),i=Math.max(i,e.priority+1))}),this.priority=i,this._start()}_detach(){rn(Br(this.source),i=>{Es(i)&&_g(i,this)}),this._active.clear(),x_(this)}eventObserved(i){i.type=="change"?i.idle?this.advance():(this._active.add(i.parent),this._start()):i.type=="idle"?this._active.delete(i.parent):i.type=="priority"&&(this.priority=Br(this.source).reduce((e,t)=>Math.max(e,(bx(t)?t.priority:0)+1),0))}};function OV(i){return i.idle!==!1}function uT(i){return!i.size||Array.from(i).every(OV)}function x_(i){i.idle||(i.idle=!0,rn(_0(i),e=>{e.done=!0}),yg(i,{type:"idle",parent:i}))}cs.assign({createStringInterpolator:MR,to:(i,e)=>new UV(i,e)});var LV=["primitive"].concat(Object.keys(xC).filter(i=>/^[A-Z]/.test(i)).map(i=>i[0].toLowerCase()+i.slice(1)));cs.assign({createStringInterpolator:MR,colors:UH,frameLoop:"demand"});R5(()=>{Ct.advance()});var IV=cV(LV,{applyAnimatedValues:pa}),An=IV.animated;const cd=new j,eb=new j,NV=new j,hT=new ke;function PV(i,e,t){const n=cd.setFromMatrixPosition(i.matrixWorld);n.project(e);const r=t.width/2,s=t.height/2;return[n.x*r+r,-(n.y*s)+s]}function zV(i,e){const t=cd.setFromMatrixPosition(i.matrixWorld),n=eb.setFromMatrixPosition(e.matrixWorld),r=t.sub(n),s=e.getWorldDirection(NV);return r.angleTo(s)>Math.PI/2}function FV(i,e,t,n){const r=cd.setFromMatrixPosition(i.matrixWorld),s=r.clone();s.project(e),hT.set(s.x,s.y),t.setFromCamera(hT,e);const a=t.intersectObjects(n,!0);if(a.length){const o=a[0].distance;return r.distanceTo(t.ray.origin)<o}return!0}function BV(i,e){if(e instanceof Pl)return e.zoom;if(e instanceof Kn){const t=cd.setFromMatrixPosition(i.matrixWorld),n=eb.setFromMatrixPosition(e.matrixWorld),r=e.fov*Math.PI/180,s=t.distanceTo(n);return 1/(2*Math.tan(r/2)*s)}else return 1}function kV(i,e,t){if(e instanceof Kn||e instanceof Pl){const n=cd.setFromMatrixPosition(i.matrixWorld),r=eb.setFromMatrixPosition(e.matrixWorld),s=n.distanceTo(r),a=(t[1]-t[0])/(e.far-e.near),o=t[1]-a*e.far;return Math.round(a*s+o)}}const wx=i=>Math.abs(i)<1e-10?0:i;function XR(i,e,t=""){let n="matrix3d(";for(let r=0;r!==16;r++)n+=wx(e[r]*i.elements[r])+(r!==15?",":")");return t+n}const GV=(i=>e=>XR(e,i))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),HV=(i=>(e,t)=>XR(e,i(t),"translate(-50%,-50%)"))(i=>[1/i,1/i,1/i,1,-1/i,-1/i,-1/i,-1,1/i,1/i,1/i,1,1,1,1,1]);function VV(i){return i&&typeof i=="object"&&"current"in i}const tb=K.forwardRef(({children:i,eps:e=.001,style:t,className:n,prepend:r,center:s,fullscreen:a,portal:o,distanceFactor:l,sprite:c=!1,transform:h=!1,occlude:d,onOcclude:p,castShadow:m,receiveShadow:v,material:x,geometry:_,zIndexRange:g=[16777271,0],calculatePosition:b=PV,as:E="div",wrapperClass:S,pointerEvents:w="auto",...T},R)=>{const{gl:U,camera:A,scene:D,size:L,raycaster:P,events:I,viewport:V}=Jn(),[H]=K.useState(()=>document.createElement(E)),z=K.useRef(null),O=K.useRef(null),B=K.useRef(0),G=K.useRef([0,0]),X=K.useRef(null),k=K.useRef(null),Y=o?.current||I.connected||U.domElement.parentNode,Q=K.useRef(null),te=K.useRef(!1),ee=K.useMemo(()=>d&&d!=="blending"||Array.isArray(d)&&d.length&&VV(d[0]),[d]);K.useLayoutEffect(()=>{const Me=U.domElement;d&&d==="blending"?(Me.style.zIndex=`${Math.floor(g[0]/2)}`,Me.style.position="absolute",Me.style.pointerEvents="none"):(Me.style.zIndex=null,Me.style.position=null,Me.style.pointerEvents=null)},[d]),K.useLayoutEffect(()=>{if(O.current){const Me=z.current=VU.createRoot(H);if(D.updateMatrixWorld(),h)H.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{const ve=b(O.current,A,L);H.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${ve[0]}px,${ve[1]}px,0);transform-origin:0 0;`}return Y&&(r?Y.prepend(H):Y.appendChild(H)),()=>{Y&&Y.removeChild(H),Me.unmount()}}},[Y,h]),K.useLayoutEffect(()=>{S&&(H.className=S)},[S]);const ie=K.useMemo(()=>h?{position:"absolute",top:0,left:0,width:L.width,height:L.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:s?"translate3d(-50%,-50%,0)":"none",...a&&{top:-L.height/2,left:-L.width/2,width:L.width,height:L.height},...t},[t,s,a,L,h]),re=K.useMemo(()=>({position:"absolute",pointerEvents:w}),[w]);K.useLayoutEffect(()=>{if(te.current=!1,h){var Me;(Me=z.current)==null||Me.render(K.createElement("div",{ref:X,style:ie},K.createElement("div",{ref:k,style:re},K.createElement("div",{ref:R,className:n,style:t,children:i}))))}else{var ve;(ve=z.current)==null||ve.render(K.createElement("div",{ref:R,style:ie,className:n,children:i}))}});const de=K.useRef(!0);u0(Me=>{if(O.current){A.updateMatrixWorld(),O.current.updateWorldMatrix(!0,!1);const ve=h?G.current:b(O.current,A,L);if(h||Math.abs(B.current-A.zoom)>e||Math.abs(G.current[0]-ve[0])>e||Math.abs(G.current[1]-ve[1])>e){const fe=zV(O.current,A);let J=!1;ee&&(Array.isArray(d)?J=d.map(pe=>pe.current):d!=="blending"&&(J=[D]));const oe=de.current;if(J){const pe=FV(O.current,A,P,J);de.current=pe&&!fe}else de.current=!fe;oe!==de.current&&(p?p(!de.current):H.style.display=de.current?"block":"none");const se=Math.floor(g[0]/2),$=d?ee?[g[0],se]:[se-1,0]:g;if(H.style.zIndex=`${kV(O.current,A,$)}`,h){const[pe,ye]=[L.width/2,L.height/2],xe=A.projectionMatrix.elements[5]*ye,{isOrthographicCamera:be,top:ue,left:He,bottom:W,right:F}=A,ne=GV(A.matrixWorldInverse),Se=be?`scale(${xe})translate(${wx(-(F+He)/2)}px,${wx((ue+W)/2)}px)`:`translateZ(${xe}px)`;let _e=O.current.matrixWorld;c&&(_e=A.matrixWorldInverse.clone().transpose().copyPosition(_e).scale(O.current.scale),_e.elements[3]=_e.elements[7]=_e.elements[11]=0,_e.elements[15]=1),H.style.width=L.width+"px",H.style.height=L.height+"px",H.style.perspective=be?"":`${xe}px`,X.current&&k.current&&(X.current.style.transform=`${Se}${ne}translate(${pe}px,${ye}px)`,k.current.style.transform=HV(_e,1/((l||10)/400)))}else{const pe=l===void 0?1:BV(O.current,A)*l;H.style.transform=`translate3d(${ve[0]}px,${ve[1]}px,0) scale(${pe})`}G.current=ve,B.current=A.zoom}}if(!ee&&Q.current&&!te.current)if(h){if(X.current){const ve=X.current.children[0];if(ve!=null&&ve.clientWidth&&ve!=null&&ve.clientHeight){const{isOrthographicCamera:fe}=A;if(fe||_)T.scale&&(Array.isArray(T.scale)?T.scale instanceof j?Q.current.scale.copy(T.scale.clone().divideScalar(1)):Q.current.scale.set(1/T.scale[0],1/T.scale[1],1/T.scale[2]):Q.current.scale.setScalar(1/T.scale));else{const J=(l||10)/400,oe=ve.clientWidth*J,se=ve.clientHeight*J;Q.current.scale.set(oe,se,1)}te.current=!0}}}else{const ve=H.children[0];if(ve!=null&&ve.clientWidth&&ve!=null&&ve.clientHeight){const fe=1/V.factor,J=ve.clientWidth*fe,oe=ve.clientHeight*fe;Q.current.scale.set(J,oe,1),te.current=!0}Q.current.lookAt(Me.camera.position)}});const Ae=K.useMemo(()=>({vertexShader:h?void 0:`
|
|
3843
|
+
`)+u.join(" > ")}return null},zt.getPublicRootInstance=function(u){if(u=u.current,!u.child)return null;switch(u.child.tag){case 27:case 5:return Ju(u.child.stateNode);default:return u.child.stateNode}},zt.injectIntoDevTools=function(){var u={bundleType:0,version:h3,rendererPackageName:f3,currentDispatcherRef:wt,findFiberByHostInstance:yS,reconcilerVersion:"19.0.0"};if(mS!==null&&(u.rendererConfig=mS),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")u=!1;else{var f=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(f.isDisabled||!f.supportsFiber)u=!0;else{try{eh=f.inject(u),hr=f}catch{}u=!!f.checkDCE}}return u},zt.isAlreadyRendering=function(){return!1},zt.observeVisibleRects=function(u,f,y,M){if(!Qu)throw Error(r(363));u=K0(u,f);var C=N3(u,y,M).disconnect;return{disconnect:function(){C()}}},zt.shouldError=function(){return null},zt.shouldSuspend=function(){return!1},zt.startHostTransition=function(u,f,y,M){if(u.tag!==5)throw Error(r(476));var C=To(u).queue;zu(u,C,f,Ql,y===null?n:function(){var N=To(u).next.queue;return ks(u,N,{},lr()),y(M)})},zt.updateContainer=function(u,f,y,M){var C=f.current,N=lr();return lS(C,N,u,f,y,M),N},zt.updateContainerSync=function(u,f,y,M){return f.tag===0&&Lo(),lS(f.current,2,u,f,y,M),2},zt},i.exports.default=i.exports,Object.defineProperty(i.exports,"__esModule",{value:!0})})(Ny)),Ny.exports}var LM;function V4(){return LM||(LM=1,Iy.exports=H4()),Iy.exports}var W4=V4();const X4=mo(W4);var Fy={exports:{}},By={};var IM;function j4(){return IM||(IM=1,(function(i){function e(z,O){var B=z.length;z.push(O);e:for(;0<B;){var G=B-1>>>1,X=z[G];if(0<r(X,O))z[G]=O,z[B]=X,B=G;else break e}}function t(z){return z.length===0?null:z[0]}function n(z){if(z.length===0)return null;var O=z[0],B=z.pop();if(B!==O){z[0]=B;e:for(var G=0,X=z.length,k=X>>>1;G<k;){var Y=2*(G+1)-1,Q=z[Y],te=Y+1,ee=z[te];if(0>r(Q,B))te<X&&0>r(ee,Q)?(z[G]=ee,z[te]=B,G=te):(z[G]=Q,z[Y]=B,G=Y);else if(te<X&&0>r(ee,B))z[G]=ee,z[te]=B,G=te;else break e}}return O}function r(z,O){var B=z.sortIndex-O.sortIndex;return B!==0?B:z.id-O.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;i.unstable_now=function(){return s.now()}}else{var a=Date,o=a.now();i.unstable_now=function(){return a.now()-o}}var l=[],c=[],h=1,d=null,p=3,m=!1,v=!1,x=!1,_=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;function E(z){for(var O=t(c);O!==null;){if(O.callback===null)n(c);else if(O.startTime<=z)n(c),O.sortIndex=O.expirationTime,e(l,O);else break;O=t(c)}}function S(z){if(x=!1,E(z),!v)if(t(l)!==null)v=!0,V();else{var O=t(c);O!==null&&H(S,O.startTime-z)}}var w=!1,T=-1,R=5,U=-1;function A(){return!(i.unstable_now()-U<R)}function D(){if(w){var z=i.unstable_now();U=z;var O=!0;try{e:{v=!1,x&&(x=!1,g(T),T=-1),m=!0;var B=p;try{t:{for(E(z),d=t(l);d!==null&&!(d.expirationTime>z&&A());){var G=d.callback;if(typeof G=="function"){d.callback=null,p=d.priorityLevel;var X=G(d.expirationTime<=z);if(z=i.unstable_now(),typeof X=="function"){d.callback=X,E(z),O=!0;break t}d===t(l)&&n(l),E(z)}else n(l);d=t(l)}if(d!==null)O=!0;else{var k=t(c);k!==null&&H(S,k.startTime-z),O=!1}}break e}finally{d=null,p=B,m=!1}O=void 0}}finally{O?L():w=!1}}}var L;if(typeof b=="function")L=function(){b(D)};else if(typeof MessageChannel<"u"){var P=new MessageChannel,I=P.port2;P.port1.onmessage=D,L=function(){I.postMessage(null)}}else L=function(){_(D,0)};function V(){w||(w=!0,L())}function H(z,O){T=_(function(){z(i.unstable_now())},O)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(z){z.callback=null},i.unstable_continueExecution=function(){v||m||(v=!0,V())},i.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<z?Math.floor(1e3/z):5},i.unstable_getCurrentPriorityLevel=function(){return p},i.unstable_getFirstCallbackNode=function(){return t(l)},i.unstable_next=function(z){switch(p){case 1:case 2:case 3:var O=3;break;default:O=p}var B=p;p=O;try{return z()}finally{p=B}},i.unstable_pauseExecution=function(){},i.unstable_requestPaint=function(){},i.unstable_runWithPriority=function(z,O){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var B=p;p=z;try{return O()}finally{p=B}},i.unstable_scheduleCallback=function(z,O,B){var G=i.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?G+B:G):B=G,z){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=B+X,z={id:h++,callback:O,priorityLevel:z,startTime:B,expirationTime:X,sortIndex:-1},B>G?(z.sortIndex=B,e(c,z),t(l)===null&&z===t(c)&&(x?(g(T),T=-1):x=!0,H(S,B-G))):(z.sortIndex=X,e(l,z),v||m||(v=!0,V())),z},i.unstable_shouldYield=A,i.unstable_wrapCallback=function(z){var O=p;return function(){var B=p;p=O;try{return z.apply(this,arguments)}finally{p=B}}}})(By)),By}var NM;function q4(){return NM||(NM=1,Fy.exports=j4()),Fy.exports}var PM=q4();function T1(i,e,t){if(!i)return;if(t(i)===!0)return i;let n=e?i.return:i.child;for(;n;){const r=T1(n,e,t);if(r)return r;n=e?null:n.sibling}}function bC(i){try{return Object.defineProperties(i,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return i}}const A1=bC(K.createContext(null));let SC=class extends K.Component{render(){return K.createElement(A1.Provider,{value:this._reactInternals},this.props.children)}};function EC(){const i=K.useContext(A1);if(i===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=K.useId();return K.useMemo(()=>{for(const t of[i,i?.alternate]){if(!t)continue;const n=T1(t,!1,r=>{let s=r.memoizedState;for(;s;){if(s.memoizedState===e)return!0;s=s.next}});if(n)return n}},[i,e])}const Y4=Symbol.for("react.context"),Z4=i=>i!==null&&typeof i=="object"&&"$$typeof"in i&&i.$$typeof===Y4;function K4(){const i=EC(),[e]=K.useState(()=>new Map);e.clear();let t=i;for(;t;){const n=t.type;Z4(n)&&n!==A1&&!e.has(n)&&e.set(n,K.use(bC(n))),t=t.return}return e}function J4(){const i=K4();return K.useMemo(()=>Array.from(i.keys()).reduce((e,t)=>n=>K.createElement(e,null,K.createElement(t.Provider,{...n,value:i.get(t)})),e=>K.createElement(SC,{...e})),[i])}function MC(i){let e=i.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const wC=i=>i&&i.isOrthographicCamera,Q4=i=>i&&i.hasOwnProperty("current"),$4=i=>i!=null&&(typeof i=="string"||typeof i=="number"||i.isColor),rd=((i,e)=>typeof window<"u"&&(((i=window.document)==null?void 0:i.createElement)||((e=window.navigator)==null?void 0:e.product)==="ReactNative"))()?K.useLayoutEffect:K.useEffect;function TC(i){const e=K.useRef(i);return rd(()=>{e.current=i},[i]),e}function e5(){const i=EC(),e=J4();return K.useMemo(()=>({children:t})=>{const r=!!T1(i,!0,s=>s.type===K.StrictMode)?K.StrictMode:K.Fragment;return he.jsx(r,{children:he.jsx(e,{children:t})})},[i,e])}function t5({set:i}){return rd(()=>(i(new Promise(()=>null)),()=>i(!1)),[i]),null}const n5=(i=>(i=class extends K.Component{constructor(...t){super(...t),this.state={error:!1}}componentDidCatch(t){this.props.set(t)}render(){return this.state.error?null:this.props.children}},i.getDerivedStateFromError=()=>({error:!0}),i))();function AC(i){var e;const t=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(i)?Math.min(Math.max(i[0],t),i[1]):i}function zc(i){var e;return(e=i.__r3f)==null?void 0:e.root.getState()}const wn={obj:i=>i===Object(i)&&!wn.arr(i)&&typeof i!="function",fun:i=>typeof i=="function",str:i=>typeof i=="string",num:i=>typeof i=="number",boo:i=>typeof i=="boolean",und:i=>i===void 0,nul:i=>i===null,arr:i=>Array.isArray(i),equ(i,e,{arrays:t="shallow",objects:n="reference",strict:r=!0}={}){if(typeof i!=typeof e||!!i!=!!e)return!1;if(wn.str(i)||wn.num(i)||wn.boo(i))return i===e;const s=wn.obj(i);if(s&&n==="reference")return i===e;const a=wn.arr(i);if(a&&t==="reference")return i===e;if((a||s)&&i===e)return!0;let o;for(o in i)if(!(o in e))return!1;if(s&&t==="shallow"&&n==="shallow"){for(o in r?e:i)if(!wn.equ(i[o],e[o],{strict:r,objects:"reference"}))return!1}else for(o in r?e:i)if(i[o]!==e[o])return!1;if(wn.und(o)){if(a&&i.length===0&&e.length===0||s&&Object.keys(i).length===0&&Object.keys(e).length===0)return!0;if(i!==e)return!1}return!0}};function i5(i){i.type!=="Scene"&&(i.dispose==null||i.dispose());for(const e in i){const t=i[e];t?.type!=="Scene"&&(t==null||t.dispose==null||t.dispose())}}const CC=["children","key","ref"];function r5(i){const e={};for(const t in i)CC.includes(t)||(e[t]=i[t]);return e}function ag(i,e,t,n){const r=i;let s=r?.__r3f;return s||(s={root:e,type:t,parent:null,children:[],props:r5(n),object:r,eventCount:0,handlers:{},isHidden:!1},r&&(r.__r3f=s)),s}function Pf(i,e){let t=i[e];if(!e.includes("-"))return{root:i,key:e,target:t};t=i;for(const r of e.split("-")){var n;e=r,i=t,t=(n=t)==null?void 0:n[e]}return{root:i,key:e,target:t}}const zM=/-\d+$/;function og(i,e){if(wn.str(e.props.attach)){if(zM.test(e.props.attach)){const r=e.props.attach.replace(zM,""),{root:s,key:a}=Pf(i.object,r);Array.isArray(s[a])||(s[a]=[])}const{root:t,key:n}=Pf(i.object,e.props.attach);e.previousAttach=t[n],t[n]=e.object}else wn.fun(e.props.attach)&&(e.previousAttach=e.props.attach(i.object,e.object))}function lg(i,e){if(wn.str(e.props.attach)){const{root:t,key:n}=Pf(i.object,e.props.attach),r=e.previousAttach;r===void 0?delete t[n]:t[n]=r}else e.previousAttach==null||e.previousAttach(i.object,e.object);delete e.previousAttach}const rx=[...CC,"args","dispose","attach","object","onUpdate","dispose"],FM=new Map;function s5(i){let e=FM.get(i.constructor);try{e||(e=new i.constructor,FM.set(i.constructor,e))}catch{}return e}function a5(i,e){const t={};for(const n in e)if(!rx.includes(n)&&!wn.equ(e[n],i.props[n])){t[n]=e[n];for(const r in e)r.startsWith(`${n}-`)&&(t[r]=e[r])}for(const n in i.props){if(rx.includes(n)||e.hasOwnProperty(n))continue;const{root:r,key:s}=Pf(i.object,n);if(r.constructor&&r.constructor.length===0){const a=s5(r);wn.und(a)||(t[s]=a[s])}else t[s]=0}return t}const o5=["map","emissiveMap","sheenColorMap","specularColorMap","envMap"],l5=/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/;function pa(i,e){var t;const n=i.__r3f,r=n&&MC(n).getState(),s=n?.eventCount;for(const o in e){let l=e[o];if(rx.includes(o))continue;if(n&&l5.test(o)){typeof l=="function"?n.handlers[o]=l:delete n.handlers[o],n.eventCount=Object.keys(n.handlers).length;continue}if(l===void 0)continue;let{root:c,key:h,target:d}=Pf(i,o);if(d instanceof pu&&l instanceof pu)d.mask=l.mask;else if(d instanceof Ye&&$4(l))d.set(l);else if(d!==null&&typeof d=="object"&&typeof d.set=="function"&&typeof d.copy=="function"&&l!=null&&l.constructor&&d.constructor===l.constructor)d.copy(l);else if(d!==null&&typeof d=="object"&&typeof d.set=="function"&&Array.isArray(l))typeof d.fromArray=="function"?d.fromArray(l):d.set(...l);else if(d!==null&&typeof d=="object"&&typeof d.set=="function"&&typeof l=="number")typeof d.setScalar=="function"?d.setScalar(l):d.set(l);else{var a;c[h]=l,r&&!r.linear&&o5.includes(h)&&(a=c[h])!=null&&a.isTexture&&c[h].format===Di&&c[h].type===Gr&&(c[h].colorSpace=Ri)}}if(n!=null&&n.parent&&r!=null&&r.internal&&(t=n.object)!=null&&t.isObject3D&&s!==n.eventCount){const o=n.object,l=r.internal.interaction.indexOf(o);l>-1&&r.internal.interaction.splice(l,1),n.eventCount&&o.raycast!==null&&r.internal.interaction.push(o)}return n&&n.props.attach===void 0&&(n.object.isBufferGeometry?n.props.attach="geometry":n.object.isMaterial&&(n.props.attach="material")),n&&Du(n),i}function Du(i){var e;if(!i.parent)return;i.props.onUpdate==null||i.props.onUpdate(i.object);const t=(e=i.root)==null||e.getState==null?void 0:e.getState();t&&t.internal.frames===0&&t.invalidate()}function c5(i,e){i.manual||(wC(i)?(i.left=e.width/-2,i.right=e.width/2,i.top=e.height/2,i.bottom=e.height/-2):i.aspect=e.width/e.height,i.updateProjectionMatrix())}const Ki=i=>i?.isObject3D;function zp(i){return(i.eventObject||i.object).uuid+"/"+i.index+i.instanceId}function RC(i,e,t,n){const r=t.get(e);r&&(t.delete(e),t.size===0&&(i.delete(n),r.target.releasePointerCapture(n)))}function u5(i,e){const{internal:t}=i.getState();t.interaction=t.interaction.filter(n=>n!==e),t.initialHits=t.initialHits.filter(n=>n!==e),t.hovered.forEach((n,r)=>{(n.eventObject===e||n.object===e)&&t.hovered.delete(r)}),t.capturedMap.forEach((n,r)=>{RC(t.capturedMap,e,n,r)})}function h5(i){function e(l){const{internal:c}=i.getState(),h=l.offsetX-c.initialClick[0],d=l.offsetY-c.initialClick[1];return Math.round(Math.sqrt(h*h+d*d))}function t(l){return l.filter(c=>["Move","Over","Enter","Out","Leave"].some(h=>{var d;return(d=c.__r3f)==null?void 0:d.handlers["onPointer"+h]}))}function n(l,c){const h=i.getState(),d=new Set,p=[],m=c?c(h.internal.interaction):h.internal.interaction;for(let g=0;g<m.length;g++){const b=zc(m[g]);b&&(b.raycaster.camera=void 0)}h.previousRoot||h.events.compute==null||h.events.compute(l,h);function v(g){const b=zc(g);if(!b||!b.events.enabled||b.raycaster.camera===null)return[];if(b.raycaster.camera===void 0){var E;b.events.compute==null||b.events.compute(l,b,(E=b.previousRoot)==null?void 0:E.getState()),b.raycaster.camera===void 0&&(b.raycaster.camera=null)}return b.raycaster.camera?b.raycaster.intersectObject(g,!0):[]}let x=m.flatMap(v).sort((g,b)=>{const E=zc(g.object),S=zc(b.object);return!E||!S?g.distance-b.distance:S.events.priority-E.events.priority||g.distance-b.distance}).filter(g=>{const b=zp(g);return d.has(b)?!1:(d.add(b),!0)});h.events.filter&&(x=h.events.filter(x,h));for(const g of x){let b=g.object;for(;b;){var _;(_=b.__r3f)!=null&&_.eventCount&&p.push({...g,eventObject:b}),b=b.parent}}if("pointerId"in l&&h.internal.capturedMap.has(l.pointerId))for(let g of h.internal.capturedMap.get(l.pointerId).values())d.has(zp(g.intersection))||p.push(g.intersection);return p}function r(l,c,h,d){if(l.length){const p={stopped:!1};for(const m of l){let v=zc(m.object);if(v||m.object.traverseAncestors(x=>{const _=zc(x);if(_)return v=_,!1}),v){const{raycaster:x,pointer:_,camera:g,internal:b}=v,E=new j(_.x,_.y,0).unproject(g),S=A=>{var D,L;return(D=(L=b.capturedMap.get(A))==null?void 0:L.has(m.eventObject))!=null?D:!1},w=A=>{const D={intersection:m,target:c.target};b.capturedMap.has(A)?b.capturedMap.get(A).set(m.eventObject,D):b.capturedMap.set(A,new Map([[m.eventObject,D]])),c.target.setPointerCapture(A)},T=A=>{const D=b.capturedMap.get(A);D&&RC(b.capturedMap,m.eventObject,D,A)};let R={};for(let A in c){let D=c[A];typeof D!="function"&&(R[A]=D)}let U={...m,...R,pointer:_,intersections:l,stopped:p.stopped,delta:h,unprojectedPoint:E,ray:x.ray,camera:g,stopPropagation(){const A="pointerId"in c&&b.capturedMap.get(c.pointerId);if((!A||A.has(m.eventObject))&&(U.stopped=p.stopped=!0,b.hovered.size&&Array.from(b.hovered.values()).find(D=>D.eventObject===m.eventObject))){const D=l.slice(0,l.indexOf(m));s([...D,m])}},target:{hasPointerCapture:S,setPointerCapture:w,releasePointerCapture:T},currentTarget:{hasPointerCapture:S,setPointerCapture:w,releasePointerCapture:T},nativeEvent:c};if(d(U),p.stopped===!0)break}}}return l}function s(l){const{internal:c}=i.getState();for(const h of c.hovered.values())if(!l.length||!l.find(d=>d.object===h.object&&d.index===h.index&&d.instanceId===h.instanceId)){const p=h.eventObject.__r3f;if(c.hovered.delete(zp(h)),p!=null&&p.eventCount){const m=p.handlers,v={...h,intersections:l};m.onPointerOut==null||m.onPointerOut(v),m.onPointerLeave==null||m.onPointerLeave(v)}}}function a(l,c){for(let h=0;h<c.length;h++){const d=c[h].__r3f;d==null||d.handlers.onPointerMissed==null||d.handlers.onPointerMissed(l)}}function o(l){switch(l){case"onPointerLeave":case"onPointerCancel":return()=>s([]);case"onLostPointerCapture":return c=>{const{internal:h}=i.getState();"pointerId"in c&&h.capturedMap.has(c.pointerId)&&requestAnimationFrame(()=>{h.capturedMap.has(c.pointerId)&&(h.capturedMap.delete(c.pointerId),s([]))})}}return function(h){const{onPointerMissed:d,internal:p}=i.getState();p.lastEvent.current=h;const m=l==="onPointerMove",v=l==="onClick"||l==="onContextMenu"||l==="onDoubleClick",_=n(h,m?t:void 0),g=v?e(h):0;l==="onPointerDown"&&(p.initialClick=[h.offsetX,h.offsetY],p.initialHits=_.map(E=>E.eventObject)),v&&!_.length&&g<=2&&(a(h,p.interaction),d&&d(h)),m&&s(_);function b(E){const S=E.eventObject,w=S.__r3f;if(!(w!=null&&w.eventCount))return;const T=w.handlers;if(m){if(T.onPointerOver||T.onPointerEnter||T.onPointerOut||T.onPointerLeave){const R=zp(E),U=p.hovered.get(R);U?U.stopped&&E.stopPropagation():(p.hovered.set(R,E),T.onPointerOver==null||T.onPointerOver(E),T.onPointerEnter==null||T.onPointerEnter(E))}T.onPointerMove==null||T.onPointerMove(E)}else{const R=T[l];R?(!v||p.initialHits.includes(S))&&(a(h,p.interaction.filter(U=>!p.initialHits.includes(U))),R(E)):v&&p.initialHits.includes(S)&&a(h,p.interaction.filter(U=>!p.initialHits.includes(U)))}}r(_,h,g,b)}}return{handlePointer:o}}const BM=i=>!!(i!=null&&i.render),DC=K.createContext(null),f5=(i,e)=>{const t=N4((o,l)=>{const c=new j,h=new j,d=new j;function p(g=l().camera,b=h,E=l().size){const{width:S,height:w,top:T,left:R}=E,U=S/w;b.isVector3?d.copy(b):d.set(...b);const A=g.getWorldPosition(c).distanceTo(d);if(wC(g))return{width:S/g.zoom,height:w/g.zoom,top:T,left:R,factor:1,distance:A,aspect:U};{const D=g.fov*Math.PI/180,L=2*Math.tan(D/2)*A,P=L*(S/w);return{width:P,height:L,top:T,left:R,factor:S/P,distance:A,aspect:U}}}let m;const v=g=>o(b=>({performance:{...b.performance,current:g}})),x=new ke;return{set:o,get:l,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},scene:null,xr:null,invalidate:(g=1)=>i(l(),g),advance:(g,b)=>e(g,b,l()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new _1,pointer:x,mouse:x,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const g=l();m&&clearTimeout(m),g.performance.current!==g.performance.min&&v(g.performance.min),m=setTimeout(()=>v(l().performance.max),g.performance.debounce)}},size:{width:0,height:0,top:0,left:0},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:p},setEvents:g=>o(b=>({...b,events:{...b.events,...g}})),setSize:(g,b,E=0,S=0)=>{const w=l().camera,T={width:g,height:b,top:E,left:S};o(R=>({size:T,viewport:{...R.viewport,...p(w,h,T)}}))},setDpr:g=>o(b=>{const E=AC(g);return{viewport:{...b.viewport,dpr:E,initialDpr:b.viewport.initialDpr||E}}}),setFrameloop:(g="always")=>{const b=l().clock;b.stop(),b.elapsedTime=0,g!=="never"&&(b.start(),b.elapsedTime=0),o(()=>({frameloop:g}))},previousRoot:void 0,internal:{interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,lastEvent:K.createRef(),active:!1,frames:0,priority:0,subscribe:(g,b,E)=>{const S=l().internal;return S.priority=S.priority+(b>0?1:0),S.subscribers.push({ref:g,priority:b,store:E}),S.subscribers=S.subscribers.sort((w,T)=>w.priority-T.priority),()=>{const w=l().internal;w!=null&&w.subscribers&&(w.priority=w.priority-(b>0?1:0),w.subscribers=w.subscribers.filter(T=>T.ref!==g))}}}}}),n=t.getState();let r=n.size,s=n.viewport.dpr,a=n.camera;return t.subscribe(()=>{const{camera:o,size:l,viewport:c,gl:h,set:d}=t.getState();if(l.width!==r.width||l.height!==r.height||c.dpr!==s){r=l,s=c.dpr,c5(o,l),c.dpr>0&&h.setPixelRatio(c.dpr);const p=typeof HTMLCanvasElement<"u"&&h.domElement instanceof HTMLCanvasElement;h.setSize(l.width,l.height,p)}o!==a&&(a=o,d(p=>({viewport:{...p.viewport,...p.viewport.getCurrentViewport(o)}})))}),t.subscribe(o=>i(o)),t};function UC(){const i=K.useContext(DC);if(!i)throw new Error("R3F: Hooks can only be used within the Canvas component!");return i}function Jn(i=t=>t,e){return UC()(i,e)}function u0(i,e=0){const t=UC(),n=t.getState().internal.subscribe,r=TC(i);return rd(()=>n(r,e,t),[e,n,t]),null}function d5(i){const e=X4(i);return e.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:K.version}),e}const OC=0,vu={},p5=/^three(?=[A-Z])/,h0=i=>`${i[0].toUpperCase()}${i.slice(1)}`;let m5=0;const g5=i=>typeof i=="function";function LC(i){if(g5(i)){const e=`${m5++}`;return vu[e]=i,e}else Object.assign(vu,i)}function IC(i,e){const t=h0(i),n=vu[t];if(i!=="primitive"&&!n)throw new Error(`R3F: ${t} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(i==="primitive"&&!e.object)throw new Error("R3F: Primitives without 'object' are invalid!");if(e.args!==void 0&&!Array.isArray(e.args))throw new Error("R3F: The args prop must be an array!")}function v5(i,e,t){var n;return i=h0(i)in vu?i:i.replace(p5,""),IC(i,e),i==="primitive"&&(n=e.object)!=null&&n.__r3f&&delete e.object.__r3f,ag(e.object,t,i,e)}function y5(i){if(!i.isHidden){var e;i.props.attach&&(e=i.parent)!=null&&e.object?lg(i.parent,i):Ki(i.object)&&(i.object.visible=!1),i.isHidden=!0,Du(i)}}function NC(i){if(i.isHidden){var e;i.props.attach&&(e=i.parent)!=null&&e.object?og(i.parent,i):Ki(i.object)&&i.props.visible!==!1&&(i.object.visible=!0),i.isHidden=!1,Du(i)}}function C1(i,e,t){const n=e.root.getState();if(!(!i.parent&&i.object!==n.scene)){if(!e.object){var r,s;const a=vu[h0(e.type)];e.object=(r=e.props.object)!=null?r:new a(...(s=e.props.args)!=null?s:[]),e.object.__r3f=e}if(pa(e.object,e.props),e.props.attach)og(i,e);else if(Ki(e.object)&&Ki(i.object)){const a=i.object.children.indexOf(t?.object);if(t&&a!==-1){const o=i.object.children.indexOf(e.object);if(o!==-1){i.object.children.splice(o,1);const l=o<a?a-1:a;i.object.children.splice(l,0,e.object)}else e.object.parent=i.object,i.object.children.splice(a,0,e.object),e.object.dispatchEvent({type:"added"}),i.object.dispatchEvent({type:"childadded",child:e.object})}else i.object.add(e.object)}for(const a of e.children)C1(e,a);Du(e)}}function ky(i,e){e&&(e.parent=i,i.children.push(e),C1(i,e))}function kM(i,e,t){if(!e||!t)return;e.parent=i;const n=i.children.indexOf(t);n!==-1?i.children.splice(n,0,e):i.children.push(e),C1(i,e,t)}function PC(i){if(typeof i.dispose=="function"){const e=()=>{try{i.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT<"u"?e():PM.unstable_scheduleCallback(PM.unstable_IdlePriority,e)}}function sx(i,e,t){if(!e)return;e.parent=null;const n=i.children.indexOf(e);n!==-1&&i.children.splice(n,1),e.props.attach?lg(i,e):Ki(e.object)&&Ki(i.object)&&(i.object.remove(e.object),u5(MC(e),e.object));const r=e.props.dispose!==null&&t!==!1;for(let s=e.children.length-1;s>=0;s--){const a=e.children[s];sx(e,a,r)}e.children.length=0,delete e.object.__r3f,r&&e.type!=="primitive"&&e.object.type!=="Scene"&&PC(e.object),t===void 0&&Du(e)}function _5(i,e){for(const t of[i,i.alternate])if(t!==null)if(typeof t.ref=="function"){t.refCleanup==null||t.refCleanup();const n=t.ref(e);typeof n=="function"&&(t.refCleanup=n)}else t.ref&&(t.ref.current=e)}const lm=[];function x5(){for(const[t]of lm){const n=t.parent;if(n){t.props.attach?lg(n,t):Ki(t.object)&&Ki(n.object)&&n.object.remove(t.object);for(const r of t.children)r.props.attach?lg(t,r):Ki(r.object)&&Ki(t.object)&&t.object.remove(r.object)}t.isHidden&&NC(t),t.object.__r3f&&delete t.object.__r3f,t.type!=="primitive"&&PC(t.object)}for(const[t,n,r]of lm){t.props=n;const s=t.parent;if(s){var i,e;const a=vu[h0(t.type)];t.object=(i=t.props.object)!=null?i:new a(...(e=t.props.args)!=null?e:[]),t.object.__r3f=t,_5(r,t.object),pa(t.object,t.props),t.props.attach?og(s,t):Ki(t.object)&&Ki(s.object)&&s.object.add(t.object);for(const o of t.children)o.props.attach?og(t,o):Ki(o.object)&&Ki(t.object)&&t.object.add(o.object);Du(t)}}lm.length=0}const Gy=()=>{},GM={};let Fp=OC;const b5=0,S5=4,ax=d5({isPrimaryRenderer:!1,warnsIfNotActing:!1,supportsMutation:!0,supportsPersistence:!1,supportsHydration:!1,createInstance:v5,removeChild:sx,appendChild:ky,appendInitialChild:ky,insertBefore:kM,appendChildToContainer(i,e){const t=i.getState().scene.__r3f;!e||!t||ky(t,e)},removeChildFromContainer(i,e){const t=i.getState().scene.__r3f;!e||!t||sx(t,e)},insertInContainerBefore(i,e,t){const n=i.getState().scene.__r3f;!e||!t||!n||kM(n,e,t)},getRootHostContext:()=>GM,getChildHostContext:()=>GM,commitUpdate(i,e,t,n,r){var s,a,o;IC(e,n);let l=!1;if((i.type==="primitive"&&t.object!==n.object||((s=n.args)==null?void 0:s.length)!==((a=t.args)==null?void 0:a.length)||(o=n.args)!=null&&o.some((h,d)=>{var p;return h!==((p=t.args)==null?void 0:p[d])}))&&(l=!0),l)lm.push([i,{...n},r]);else{const h=a5(i,n);Object.keys(h).length&&(Object.assign(i.props,h),pa(i.object,h))}(r.sibling===null||(r.flags&S5)===b5)&&x5()},finalizeInitialChildren:()=>!1,commitMount(){},getPublicInstance:i=>i?.object,prepareForCommit:()=>null,preparePortalMount:i=>ag(i.getState().scene,i,"",{}),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance:y5,unhideInstance:NC,createTextInstance:Gy,hideTextInstance:Gy,unhideTextInstance:Gy,scheduleTimeout:typeof setTimeout=="function"?setTimeout:void 0,cancelTimeout:typeof clearTimeout=="function"?clearTimeout:void 0,noTimeout:-1,getInstanceFromNode:()=>null,beforeActiveInstanceBlur(){},afterActiveInstanceBlur(){},detachDeletedInstance(){},prepareScopeUpdate(){},getInstanceFromScope:()=>null,shouldAttemptEagerTransition:()=>!1,trackSchedulerEvent:()=>{},resolveEventType:()=>null,resolveEventTimeStamp:()=>-1.1,requestPostPaintCallback(){},maySuspendCommit:()=>!1,preloadInstance:()=>!0,startSuspendingCommit(){},suspendInstance(){},waitForCommitToBeReady:()=>null,NotPendingTransition:null,HostTransitionContext:K.createContext(null),setCurrentUpdatePriority(i){Fp=i},getCurrentUpdatePriority(){return Fp},resolveUpdatePriority(){var i;if(Fp!==OC)return Fp;switch(typeof window<"u"&&((i=window.event)==null?void 0:i.type)){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return rm.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return rm.ContinuousEventPriority;default:return rm.DefaultEventPriority}},resetFormInstance(){}}),Dl=new Map,Fc={objects:"shallow",strict:!1};function E5(i,e){if(!e&&typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement&&i.parentElement){const{width:t,height:n,top:r,left:s}=i.parentElement.getBoundingClientRect();return{width:t,height:n,top:r,left:s}}else if(!e&&typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas)return{width:i.width,height:i.height,top:0,left:0};return{width:0,height:0,top:0,left:0,...e}}function M5(i){const e=Dl.get(i),t=e?.fiber,n=e?.store;e&&console.warn("R3F.createRoot should only be called once!");const r=typeof reportError=="function"?reportError:console.error,s=n||f5(cx,VM),a=t||ax.createContainer(s,rm.ConcurrentRoot,null,!1,null,"",r,r,r,null);e||Dl.set(i,{fiber:a,store:s});let o,l,c=!1,h=null;return{async configure(d={}){let p;h=new Promise(k=>p=k);let{gl:m,size:v,scene:x,events:_,onCreated:g,shadows:b=!1,linear:E=!1,flat:S=!1,legacy:w=!1,orthographic:T=!1,frameloop:R="always",dpr:U=[1,2],performance:A,raycaster:D,camera:L,onPointerMissed:P}=d,I=s.getState(),V=I.gl;if(!I.gl){const k={canvas:i,powerPreference:"high-performance",antialias:!0,alpha:!0},Y=typeof m=="function"?await m(k):m;BM(Y)?V=Y:V=new _C({...k,...m}),I.set({gl:V})}let H=I.raycaster;H||I.set({raycaster:H=new E1});const{params:z,...O}=D||{};if(wn.equ(O,H,Fc)||pa(H,{...O}),wn.equ(z,H.params,Fc)||pa(H,{params:{...H.params,...z}}),!I.camera||I.camera===l&&!wn.equ(l,L,Fc)){l=L;const k=L?.isCamera,Y=k?L:T?new Pl(0,0,0,0,.1,1e3):new Kn(75,0,.1,1e3);k||(Y.position.z=5,L&&(pa(Y,L),Y.manual||("aspect"in L||"left"in L||"right"in L||"bottom"in L||"top"in L)&&(Y.manual=!0,Y.updateProjectionMatrix())),!I.camera&&!(L!=null&&L.rotation)&&Y.lookAt(0,0,0)),I.set({camera:Y}),H.camera=Y}if(!I.scene){let k;x!=null&&x.isScene?(k=x,ag(k,s,"",{})):(k=new Gg,ag(k,s,"",{}),x&&pa(k,x)),I.set({scene:k})}_&&!I.events.handlers&&I.set({events:_(s)});const B=E5(i,v);if(wn.equ(B,I.size,Fc)||I.setSize(B.width,B.height,B.top,B.left),U&&I.viewport.dpr!==AC(U)&&I.setDpr(U),I.frameloop!==R&&I.setFrameloop(R),I.onPointerMissed||I.set({onPointerMissed:P}),A&&!wn.equ(A,I.performance,Fc)&&I.set(k=>({performance:{...k.performance,...A}})),!I.xr){var G;const k=(te,ee)=>{const ie=s.getState();ie.frameloop!=="never"&&VM(te,!0,ie,ee)},Y=()=>{const te=s.getState();te.gl.xr.enabled=te.gl.xr.isPresenting,te.gl.xr.setAnimationLoop(te.gl.xr.isPresenting?k:null),te.gl.xr.isPresenting||cx(te)},Q={connect(){const te=s.getState().gl;te.xr.addEventListener("sessionstart",Y),te.xr.addEventListener("sessionend",Y)},disconnect(){const te=s.getState().gl;te.xr.removeEventListener("sessionstart",Y),te.xr.removeEventListener("sessionend",Y)}};typeof((G=V.xr)==null?void 0:G.addEventListener)=="function"&&Q.connect(),I.set({xr:Q})}if(V.shadowMap){const k=V.shadowMap.enabled,Y=V.shadowMap.type;if(V.shadowMap.enabled=!!b,wn.boo(b))V.shadowMap.type=nf;else if(wn.str(b)){var X;const Q={basic:wA,percentage:Ag,soft:nf,variance:is};V.shadowMap.type=(X=Q[b])!=null?X:nf}else wn.obj(b)&&Object.assign(V.shadowMap,b);(k!==V.shadowMap.enabled||Y!==V.shadowMap.type)&&(V.shadowMap.needsUpdate=!0)}return Gt.enabled=!w,c||(V.outputColorSpace=E?ho:Ri,V.toneMapping=S?As:zx),I.legacy!==w&&I.set(()=>({legacy:w})),I.linear!==E&&I.set(()=>({linear:E})),I.flat!==S&&I.set(()=>({flat:S})),m&&!wn.fun(m)&&!BM(m)&&!wn.equ(m,V,Fc)&&pa(V,m),o=g,c=!0,p(),this},render(d){return!c&&!h&&this.configure(),h.then(()=>{ax.updateContainer(he.jsx(w5,{store:s,children:d,onCreated:o,rootElement:i}),a,null,()=>{})}),s},unmount(){zC(i)}}}function w5({store:i,children:e,onCreated:t,rootElement:n}){return rd(()=>{const r=i.getState();r.set(s=>({internal:{...s.internal,active:!0}})),t&&t(r),i.getState().events.connected||r.events.connect==null||r.events.connect(n)},[]),he.jsx(DC.Provider,{value:i,children:e})}function zC(i,e){const t=Dl.get(i),n=t?.fiber;if(n){const r=t?.store.getState();r&&(r.internal.active=!1),ax.updateContainer(null,n,null,()=>{r&&setTimeout(()=>{try{var s,a,o,l;r.events.disconnect==null||r.events.disconnect(),(s=r.gl)==null||(a=s.renderLists)==null||a.dispose==null||a.dispose(),(o=r.gl)==null||o.forceContextLoss==null||o.forceContextLoss(),(l=r.gl)!=null&&l.xr&&r.xr.disconnect(),i5(r.scene),Dl.delete(i)}catch{}},500)})}}function T5(i,e){const t={callback:i};return e.add(t),()=>{e.delete(t)}}const FC=new Set,A5=new Set,C5=new Set,R5=i=>T5(i,FC);function Hy(i,e){if(i.size)for(const{callback:t}of i.values())t(e)}function ff(i,e){switch(i){case"before":return Hy(FC,e);case"after":return Hy(A5,e);case"tail":return Hy(C5,e)}}let Vy,Wy;function ox(i,e,t){let n=e.clock.getDelta();e.frameloop==="never"&&typeof i=="number"&&(n=i-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=i),Vy=e.internal.subscribers;for(let r=0;r<Vy.length;r++)Wy=Vy[r],Wy.ref.current(Wy.store.getState(),n,t);return!e.internal.priority&&e.gl.render&&e.gl.render(e.scene,e.camera),e.internal.frames=Math.max(0,e.internal.frames-1),e.frameloop==="always"?1:e.internal.frames}let cg=!1,lx=!1,Xy,HM,Bc;function BC(i){HM=requestAnimationFrame(BC),cg=!0,Xy=0,ff("before",i),lx=!0;for(const t of Dl.values()){var e;Bc=t.store.getState(),Bc.internal.active&&(Bc.frameloop==="always"||Bc.internal.frames>0)&&!((e=Bc.gl.xr)!=null&&e.isPresenting)&&(Xy+=ox(i,Bc))}if(lx=!1,ff("after",i),Xy===0)return ff("tail",i),cg=!1,cancelAnimationFrame(HM)}function cx(i,e=1){var t;if(!i)return Dl.forEach(n=>cx(n.store.getState(),e));(t=i.gl.xr)!=null&&t.isPresenting||!i.internal.active||i.frameloop==="never"||(e>1?i.internal.frames=Math.min(60,i.internal.frames+e):lx?i.internal.frames=2:i.internal.frames=1,cg||(cg=!0,requestAnimationFrame(BC)))}function VM(i,e=!0,t,n){if(e&&ff("before",i),t)ox(i,t,n);else for(const r of Dl.values())ox(i,r.store.getState());e&&ff("after",i)}const jy={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function D5(i){const{handlePointer:e}=h5(i);return{priority:1,enabled:!0,compute(t,n,r){n.pointer.set(t.offsetX/n.size.width*2-1,-(t.offsetY/n.size.height)*2+1),n.raycaster.setFromCamera(n.pointer,n.camera)},connected:void 0,handlers:Object.keys(jy).reduce((t,n)=>({...t,[n]:e(n)}),{}),update:()=>{var t;const{events:n,internal:r}=i.getState();(t=r.lastEvent)!=null&&t.current&&n.handlers&&n.handlers.onPointerMove(r.lastEvent.current)},connect:t=>{const{set:n,events:r}=i.getState();if(r.disconnect==null||r.disconnect(),n(s=>({events:{...s.events,connected:t}})),r.handlers)for(const s in r.handlers){const a=r.handlers[s],[o,l]=jy[s];t.addEventListener(o,a,{passive:l})}},disconnect:()=>{const{set:t,events:n}=i.getState();if(n.connected){if(n.handlers)for(const r in n.handlers){const s=n.handlers[r],[a]=jy[r];n.connected.removeEventListener(a,s)}t(r=>({events:{...r.events,connected:void 0}}))}}}}function WM(i,e){let t;return(...n)=>{window.clearTimeout(t),t=window.setTimeout(()=>i(...n),e)}}function U5({debounce:i,scroll:e,polyfill:t,offsetSize:n}={debounce:0,scroll:!1,offsetSize:!1}){const r=t||(typeof window>"u"?class{}:window.ResizeObserver);if(!r)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[s,a]=K.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),o=K.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:s,orientationHandler:null}),l=i?typeof i=="number"?i:i.scroll:null,c=i?typeof i=="number"?i:i.resize:null,h=K.useRef(!1);K.useEffect(()=>(h.current=!0,()=>{h.current=!1}));const[d,p,m]=K.useMemo(()=>{const g=()=>{if(!o.current.element)return;const{left:b,top:E,width:S,height:w,bottom:T,right:R,x:U,y:A}=o.current.element.getBoundingClientRect(),D={left:b,top:E,width:S,height:w,bottom:T,right:R,x:U,y:A};o.current.element instanceof HTMLElement&&n&&(D.height=o.current.element.offsetHeight,D.width=o.current.element.offsetWidth),Object.freeze(D),h.current&&!N5(o.current.lastBounds,D)&&a(o.current.lastBounds=D)};return[g,c?WM(g,c):g,l?WM(g,l):g]},[a,n,l,c]);function v(){o.current.scrollContainers&&(o.current.scrollContainers.forEach(g=>g.removeEventListener("scroll",m,!0)),o.current.scrollContainers=null),o.current.resizeObserver&&(o.current.resizeObserver.disconnect(),o.current.resizeObserver=null),o.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",o.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",o.current.orientationHandler))}function x(){o.current.element&&(o.current.resizeObserver=new r(m),o.current.resizeObserver.observe(o.current.element),e&&o.current.scrollContainers&&o.current.scrollContainers.forEach(g=>g.addEventListener("scroll",m,{capture:!0,passive:!0})),o.current.orientationHandler=()=>{m()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",o.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",o.current.orientationHandler))}const _=g=>{!g||g===o.current.element||(v(),o.current.element=g,o.current.scrollContainers=kC(g),x())};return L5(m,!!e),O5(p),K.useEffect(()=>{v(),x()},[e,m,p]),K.useEffect(()=>v,[]),[_,s,d]}function O5(i){K.useEffect(()=>{const e=i;return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[i])}function L5(i,e){K.useEffect(()=>{if(e){const t=i;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>{window.removeEventListener("scroll",t,!0)}}},[i,e])}function kC(i){const e=[];if(!i||i===document.body)return e;const{overflow:t,overflowX:n,overflowY:r}=window.getComputedStyle(i);return[t,n,r].some(s=>s==="auto"||s==="scroll")&&e.push(i),[...e,...kC(i.parentElement)]}const I5=["x","y","top","bottom","left","right","width","height"],N5=(i,e)=>I5.every(t=>i[t]===e[t]);function P5({ref:i,children:e,fallback:t,resize:n,style:r,gl:s,events:a=D5,eventSource:o,eventPrefix:l,shadows:c,linear:h,flat:d,legacy:p,orthographic:m,frameloop:v,dpr:x,performance:_,raycaster:g,camera:b,scene:E,onPointerMissed:S,onCreated:w,...T}){K.useMemo(()=>LC(xC),[]);const R=e5(),[U,A]=U5({scroll:!0,debounce:{scroll:50,resize:0},...n}),D=K.useRef(null),L=K.useRef(null);K.useImperativeHandle(i,()=>D.current);const P=TC(S),[I,V]=K.useState(!1),[H,z]=K.useState(!1);if(I)throw I;if(H)throw H;const O=K.useRef(null);rd(()=>{const G=D.current;if(A.width>0&&A.height>0&&G){O.current||(O.current=M5(G));async function X(){await O.current.configure({gl:s,scene:E,events:a,shadows:c,linear:h,flat:d,legacy:p,orthographic:m,frameloop:v,dpr:x,performance:_,raycaster:g,camera:b,size:A,onPointerMissed:(...k)=>P.current==null?void 0:P.current(...k),onCreated:k=>{k.events.connect==null||k.events.connect(o?Q4(o)?o.current:o:L.current),l&&k.setEvents({compute:(Y,Q)=>{const te=Y[l+"X"],ee=Y[l+"Y"];Q.pointer.set(te/Q.size.width*2-1,-(ee/Q.size.height)*2+1),Q.raycaster.setFromCamera(Q.pointer,Q.camera)}}),w?.(k)}}),O.current.render(he.jsx(R,{children:he.jsx(n5,{set:z,children:he.jsx(K.Suspense,{fallback:he.jsx(t5,{set:V}),children:e??null})})}))}X()}}),K.useEffect(()=>{const G=D.current;if(G)return()=>zC(G)},[]);const B=o?"none":"auto";return he.jsx("div",{ref:L,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:B,...r},...T,children:he.jsx("div",{ref:U,style:{width:"100%",height:"100%"},children:he.jsx("canvas",{ref:D,style:{display:"block"},children:t})})})}function z5(i){return he.jsx(SC,{children:he.jsx(P5,{...i})})}const Mn={LEFT:1,RIGHT:2,MIDDLE:4},Re=Object.freeze({NONE:0,ROTATE:1,TRUCK:2,SCREEN_PAN:4,OFFSET:8,DOLLY:16,ZOOM:32,TOUCH_ROTATE:64,TOUCH_TRUCK:128,TOUCH_SCREEN_PAN:256,TOUCH_OFFSET:512,TOUCH_DOLLY:1024,TOUCH_ZOOM:2048,TOUCH_DOLLY_TRUCK:4096,TOUCH_DOLLY_SCREEN_PAN:8192,TOUCH_DOLLY_OFFSET:16384,TOUCH_DOLLY_ROTATE:32768,TOUCH_ZOOM_TRUCK:65536,TOUCH_ZOOM_OFFSET:131072,TOUCH_ZOOM_SCREEN_PAN:262144,TOUCH_ZOOM_ROTATE:524288}),kc={NONE:0,IN:1,OUT:-1};function ol(i){return i.isPerspectiveCamera}function io(i){return i.isOrthographicCamera}const eo=Math.PI*2,XM=Math.PI/2,GC=1e-5,wh=Math.PI/180;function ns(i,e,t){return Math.max(e,Math.min(t,i))}function pn(i,e=GC){return Math.abs(i)<e}function nn(i,e,t=GC){return pn(i-e,t)}function jM(i,e){return Math.round(i/e)*e}function Th(i){return isFinite(i)?i:i<0?-Number.MAX_VALUE:Number.MAX_VALUE}function Ah(i){return Math.abs(i)<Number.MAX_VALUE?i:i*(1/0)}function Bp(i,e,t,n,r=1/0,s){n=Math.max(1e-4,n);const a=2/n,o=a*s,l=1/(1+o+.48*o*o+.235*o*o*o);let c=i-e;const h=e,d=r*n;c=ns(c,-d,d),e=i-c;const p=(t.value+a*c)*s;t.value=(t.value-a*p)*l;let m=e+(c+p)*l;return h-i>0==m>h&&(m=h,t.value=(m-h)/s),m}function qM(i,e,t,n,r=1/0,s,a){n=Math.max(1e-4,n);const o=2/n,l=o*s,c=1/(1+l+.48*l*l+.235*l*l*l);let h=e.x,d=e.y,p=e.z,m=i.x-h,v=i.y-d,x=i.z-p;const _=h,g=d,b=p,E=r*n,S=E*E,w=m*m+v*v+x*x;if(w>S){const H=Math.sqrt(w);m=m/H*E,v=v/H*E,x=x/H*E}h=i.x-m,d=i.y-v,p=i.z-x;const T=(t.x+o*m)*s,R=(t.y+o*v)*s,U=(t.z+o*x)*s;t.x=(t.x-o*T)*c,t.y=(t.y-o*R)*c,t.z=(t.z-o*U)*c,a.x=h+(m+T)*c,a.y=d+(v+R)*c,a.z=p+(x+U)*c;const A=_-i.x,D=g-i.y,L=b-i.z,P=a.x-_,I=a.y-g,V=a.z-b;return A*P+D*I+L*V>0&&(a.x=_,a.y=g,a.z=b,t.x=(a.x-_)/s,t.y=(a.y-g)/s,t.z=(a.z-b)/s),a}function qy(i,e){e.set(0,0),i.forEach(t=>{e.x+=t.clientX,e.y+=t.clientY}),e.x/=i.length,e.y/=i.length}function Yy(i,e){return io(i)?(console.warn(`${e} is not supported in OrthographicCamera`),!0):!1}let F5=class{_listeners={};addEventListener(e,t){const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){const n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){const r=this._listeners[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}removeAllEventListeners(e){if(!e){this._listeners={};return}Array.isArray(this._listeners[e])&&(this._listeners[e].length=0)}dispatchEvent(e){const n=this._listeners[e.type];if(n!==void 0){e.target=this;const r=n.slice(0);for(let s=0,a=r.length;s<a;s++)r[s].call(this,e)}}};const B5="3.1.2",kp=1/8,k5=/Mac/.test(globalThis?.navigator?.platform);let Mt,YM,Gp,Zy,Yi,Lt,Kt,Gc,Ch,ys,_s,ll,ZM,KM,vr,Hc,Vc,JM,Ky,QM,Jy,Qy,Hp,ni=class ux extends F5{static install(e){Mt=e.THREE,YM=Object.freeze(new Mt.Vector3(0,0,0)),Gp=Object.freeze(new Mt.Vector3(0,1,0)),Zy=Object.freeze(new Mt.Vector3(0,0,1)),Yi=new Mt.Vector2,Lt=new Mt.Vector3,Kt=new Mt.Vector3,Gc=new Mt.Vector3,Ch=new Mt.Vector3,ys=new Mt.Vector3,_s=new Mt.Vector3,ll=new Mt.Vector3,ZM=new Mt.Vector3,KM=new Mt.Vector3,vr=new Mt.Spherical,Hc=new Mt.Spherical,Vc=new Mt.Box3,JM=new Mt.Box3,Ky=new Mt.Sphere,QM=new Mt.Quaternion,Jy=new Mt.Quaternion,Qy=new Mt.Matrix4,Hp=new Mt.Raycaster}static get ACTION(){return Re}minPolarAngle=0;maxPolarAngle=Math.PI;minAzimuthAngle=-1/0;maxAzimuthAngle=1/0;minDistance=Number.EPSILON;maxDistance=1/0;infinityDolly=!1;minZoom=.01;maxZoom=1/0;smoothTime=.25;draggingSmoothTime=.125;maxSpeed=1/0;azimuthRotateSpeed=1;polarRotateSpeed=1;dollySpeed=1;dollyDragInverted=!1;truckSpeed=2;dollyToCursor=!1;dragToOffset=!1;boundaryFriction=0;restThreshold=.01;colliderMeshes=[];mouseButtons;touches;cancel=()=>{};lockPointer;unlockPointer;_enabled=!0;_camera;_yAxisUpSpace;_yAxisUpSpaceInverse;_state=Re.NONE;_domElement;_viewport=null;_target;_targetEnd;_focalOffset;_focalOffsetEnd;_spherical;_sphericalEnd;_lastDistance;_zoom;_zoomEnd;_lastZoom;_cameraUp0;_target0;_position0;_zoom0;_focalOffset0;_dollyControlCoord;_changedDolly=0;_changedZoom=0;_nearPlaneCorners;_hasRested=!0;_boundary;_boundaryEnclosesCamera=!1;_needsUpdate=!0;_updatedLastTime=!1;_elementRect=new DOMRect;_isDragging=!1;_dragNeedsUpdate=!0;_activePointers=[];_lockedPointer=null;_interactiveArea=new DOMRect(0,0,1,1);_isUserControllingRotate=!1;_isUserControllingDolly=!1;_isUserControllingTruck=!1;_isUserControllingOffset=!1;_isUserControllingZoom=!1;_lastDollyDirection=kc.NONE;_thetaVelocity={value:0};_phiVelocity={value:0};_radiusVelocity={value:0};_targetVelocity=new Mt.Vector3;_focalOffsetVelocity=new Mt.Vector3;_zoomVelocity={value:0};set verticalDragToForward(e){console.warn("camera-controls: `verticalDragToForward` was removed. Use `mouseButtons.left = CameraControls.ACTION.SCREEN_PAN` instead.")}constructor(e,t){super(),typeof Mt>"u"&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=e,this._yAxisUpSpace=new Mt.Quaternion().setFromUnitVectors(this._camera.up,Gp),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=Re.NONE,this._target=new Mt.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new Mt.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=new Mt.Spherical().setFromVector3(Lt.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)),this._sphericalEnd=this._spherical.clone(),this._lastDistance=this._spherical.radius,this._zoom=this._camera.zoom,this._zoomEnd=this._zoom,this._lastZoom=this._zoom,this._nearPlaneCorners=[new Mt.Vector3,new Mt.Vector3,new Mt.Vector3,new Mt.Vector3],this._updateNearPlaneCorners(),this._boundary=new Mt.Box3(new Mt.Vector3(-1/0,-1/0,-1/0),new Mt.Vector3(1/0,1/0,1/0)),this._cameraUp0=this._camera.up.clone(),this._target0=this._target.clone(),this._position0=this._camera.position.clone(),this._zoom0=this._zoom,this._focalOffset0=this._focalOffset.clone(),this._dollyControlCoord=new Mt.Vector2,this.mouseButtons={left:Re.ROTATE,middle:Re.DOLLY,right:Re.TRUCK,wheel:ol(this._camera)?Re.DOLLY:io(this._camera)?Re.ZOOM:Re.NONE},this.touches={one:Re.TOUCH_ROTATE,two:ol(this._camera)?Re.TOUCH_DOLLY_TRUCK:io(this._camera)?Re.TOUCH_ZOOM_TRUCK:Re.NONE,three:Re.TOUCH_TRUCK};const n=new Mt.Vector2,r=new Mt.Vector2,s=new Mt.Vector2,a=g=>{if(!this._enabled||!this._domElement)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const S=this._domElement.getBoundingClientRect(),w=g.clientX/S.width,T=g.clientY/S.height;if(w<this._interactiveArea.left||w>this._interactiveArea.right||T<this._interactiveArea.top||T>this._interactiveArea.bottom)return}const b=g.pointerType!=="mouse"?null:(g.buttons&Mn.LEFT)===Mn.LEFT?Mn.LEFT:(g.buttons&Mn.MIDDLE)===Mn.MIDDLE?Mn.MIDDLE:(g.buttons&Mn.RIGHT)===Mn.RIGHT?Mn.RIGHT:null;if(b!==null){const S=this._findPointerByMouseButton(b);S&&this._disposePointer(S)}if((g.buttons&Mn.LEFT)===Mn.LEFT&&this._lockedPointer)return;const E={pointerId:g.pointerId,clientX:g.clientX,clientY:g.clientY,deltaX:0,deltaY:0,mouseButton:b};this._activePointers.push(E),this._domElement.ownerDocument.removeEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",l),this._domElement.ownerDocument.addEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",l),this._isDragging=!0,p(g)},o=g=>{g.cancelable&&g.preventDefault();const b=g.pointerId,E=this._lockedPointer||this._findPointerById(b);if(E){if(E.clientX=g.clientX,E.clientY=g.clientY,E.deltaX=g.movementX,E.deltaY=g.movementY,this._state=0,g.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else(!this._isDragging&&this._lockedPointer||this._isDragging&&(g.buttons&Mn.LEFT)===Mn.LEFT)&&(this._state=this._state|this.mouseButtons.left),this._isDragging&&(g.buttons&Mn.MIDDLE)===Mn.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),this._isDragging&&(g.buttons&Mn.RIGHT)===Mn.RIGHT&&(this._state=this._state|this.mouseButtons.right);m()}},l=g=>{const b=this._findPointerById(g.pointerId);if(!(b&&b===this._lockedPointer)){if(b&&this._disposePointer(b),g.pointerType==="touch")switch(this._activePointers.length){case 0:this._state=Re.NONE;break;case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else this._state=Re.NONE;v()}};let c=-1;const h=g=>{if(!this._domElement||!this._enabled||this.mouseButtons.wheel===Re.NONE)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const R=this._domElement.getBoundingClientRect(),U=g.clientX/R.width,A=g.clientY/R.height;if(U<this._interactiveArea.left||U>this._interactiveArea.right||A<this._interactiveArea.top||A>this._interactiveArea.bottom)return}if(g.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===Re.ROTATE||this.mouseButtons.wheel===Re.TRUCK){const R=performance.now();c-R<1e3&&this._getClientRect(this._elementRect),c=R}const b=k5?-1:-3,E=g.deltaMode===1&&!g.ctrlKey?g.deltaY/b:g.deltaY/(b*10),S=this.dollyToCursor?(g.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,w=this.dollyToCursor?(g.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(g.ctrlKey?Re.ZOOM:this.mouseButtons.wheel){case Re.ROTATE:{this._rotateInternal(g.deltaX,g.deltaY),this._isUserControllingRotate=!0;break}case Re.TRUCK:{this._truckInternal(g.deltaX,g.deltaY,!1,!1),this._isUserControllingTruck=!0;break}case Re.SCREEN_PAN:{this._truckInternal(g.deltaX,g.deltaY,!1,!0),this._isUserControllingTruck=!0;break}case Re.OFFSET:{this._truckInternal(g.deltaX,g.deltaY,!0,!1),this._isUserControllingOffset=!0;break}case Re.DOLLY:{this._dollyInternal(-E,S,w),this._isUserControllingDolly=!0;break}case Re.ZOOM:{this._zoomInternal(-E,S,w),this._isUserControllingZoom=!0;break}}this.dispatchEvent({type:"control"})},d=g=>{if(!(!this._domElement||!this._enabled)){if(this.mouseButtons.right===ux.ACTION.NONE){const b=g instanceof PointerEvent?g.pointerId:0,E=this._findPointerById(b);E&&this._disposePointer(E),this._domElement.ownerDocument.removeEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",l);return}g.preventDefault()}},p=g=>{if(!this._enabled)return;if(qy(this._activePointers,Yi),this._getClientRect(this._elementRect),n.copy(Yi),r.copy(Yi),this._activePointers.length>=2){const E=Yi.x-this._activePointers[1].clientX,S=Yi.y-this._activePointers[1].clientY,w=Math.sqrt(E*E+S*S);s.set(0,w);const T=(this._activePointers[0].clientX+this._activePointers[1].clientX)*.5,R=(this._activePointers[0].clientY+this._activePointers[1].clientY)*.5;r.set(T,R)}if(this._state=0,!g)this._lockedPointer&&(this._state=this._state|this.mouseButtons.left);else if("pointerType"in g&&g.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else!this._lockedPointer&&(g.buttons&Mn.LEFT)===Mn.LEFT&&(this._state=this._state|this.mouseButtons.left),(g.buttons&Mn.MIDDLE)===Mn.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(g.buttons&Mn.RIGHT)===Mn.RIGHT&&(this._state=this._state|this.mouseButtons.right);((this._state&Re.ROTATE)===Re.ROTATE||(this._state&Re.TOUCH_ROTATE)===Re.TOUCH_ROTATE||(this._state&Re.TOUCH_DOLLY_ROTATE)===Re.TOUCH_DOLLY_ROTATE||(this._state&Re.TOUCH_ZOOM_ROTATE)===Re.TOUCH_ZOOM_ROTATE)&&(this._sphericalEnd.theta=this._spherical.theta,this._sphericalEnd.phi=this._spherical.phi,this._thetaVelocity.value=0,this._phiVelocity.value=0),((this._state&Re.TRUCK)===Re.TRUCK||(this._state&Re.SCREEN_PAN)===Re.SCREEN_PAN||(this._state&Re.TOUCH_TRUCK)===Re.TOUCH_TRUCK||(this._state&Re.TOUCH_SCREEN_PAN)===Re.TOUCH_SCREEN_PAN||(this._state&Re.TOUCH_DOLLY_TRUCK)===Re.TOUCH_DOLLY_TRUCK||(this._state&Re.TOUCH_DOLLY_SCREEN_PAN)===Re.TOUCH_DOLLY_SCREEN_PAN||(this._state&Re.TOUCH_ZOOM_TRUCK)===Re.TOUCH_ZOOM_TRUCK||(this._state&Re.TOUCH_ZOOM_SCREEN_PAN)===Re.TOUCH_DOLLY_SCREEN_PAN)&&(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),((this._state&Re.DOLLY)===Re.DOLLY||(this._state&Re.TOUCH_DOLLY)===Re.TOUCH_DOLLY||(this._state&Re.TOUCH_DOLLY_TRUCK)===Re.TOUCH_DOLLY_TRUCK||(this._state&Re.TOUCH_DOLLY_SCREEN_PAN)===Re.TOUCH_DOLLY_SCREEN_PAN||(this._state&Re.TOUCH_DOLLY_OFFSET)===Re.TOUCH_DOLLY_OFFSET||(this._state&Re.TOUCH_DOLLY_ROTATE)===Re.TOUCH_DOLLY_ROTATE)&&(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),((this._state&Re.ZOOM)===Re.ZOOM||(this._state&Re.TOUCH_ZOOM)===Re.TOUCH_ZOOM||(this._state&Re.TOUCH_ZOOM_TRUCK)===Re.TOUCH_ZOOM_TRUCK||(this._state&Re.TOUCH_ZOOM_SCREEN_PAN)===Re.TOUCH_ZOOM_SCREEN_PAN||(this._state&Re.TOUCH_ZOOM_OFFSET)===Re.TOUCH_ZOOM_OFFSET||(this._state&Re.TOUCH_ZOOM_ROTATE)===Re.TOUCH_ZOOM_ROTATE)&&(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),((this._state&Re.OFFSET)===Re.OFFSET||(this._state&Re.TOUCH_OFFSET)===Re.TOUCH_OFFSET||(this._state&Re.TOUCH_DOLLY_OFFSET)===Re.TOUCH_DOLLY_OFFSET||(this._state&Re.TOUCH_ZOOM_OFFSET)===Re.TOUCH_ZOOM_OFFSET)&&(this._focalOffsetEnd.copy(this._focalOffset),this._focalOffsetVelocity.set(0,0,0)),this.dispatchEvent({type:"controlstart"})},m=()=>{if(!this._enabled||!this._dragNeedsUpdate)return;this._dragNeedsUpdate=!1,qy(this._activePointers,Yi);const b=this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,E=b?-b.deltaX:r.x-Yi.x,S=b?-b.deltaY:r.y-Yi.y;if(r.copy(Yi),((this._state&Re.ROTATE)===Re.ROTATE||(this._state&Re.TOUCH_ROTATE)===Re.TOUCH_ROTATE||(this._state&Re.TOUCH_DOLLY_ROTATE)===Re.TOUCH_DOLLY_ROTATE||(this._state&Re.TOUCH_ZOOM_ROTATE)===Re.TOUCH_ZOOM_ROTATE)&&(this._rotateInternal(E,S),this._isUserControllingRotate=!0),(this._state&Re.DOLLY)===Re.DOLLY||(this._state&Re.ZOOM)===Re.ZOOM){const w=this.dollyToCursor?(n.x-this._elementRect.x)/this._elementRect.width*2-1:0,T=this.dollyToCursor?(n.y-this._elementRect.y)/this._elementRect.height*-2+1:0,R=this.dollyDragInverted?-1:1;(this._state&Re.DOLLY)===Re.DOLLY?(this._dollyInternal(R*S*kp,w,T),this._isUserControllingDolly=!0):(this._zoomInternal(R*S*kp,w,T),this._isUserControllingZoom=!0)}if((this._state&Re.TOUCH_DOLLY)===Re.TOUCH_DOLLY||(this._state&Re.TOUCH_ZOOM)===Re.TOUCH_ZOOM||(this._state&Re.TOUCH_DOLLY_TRUCK)===Re.TOUCH_DOLLY_TRUCK||(this._state&Re.TOUCH_ZOOM_TRUCK)===Re.TOUCH_ZOOM_TRUCK||(this._state&Re.TOUCH_DOLLY_SCREEN_PAN)===Re.TOUCH_DOLLY_SCREEN_PAN||(this._state&Re.TOUCH_ZOOM_SCREEN_PAN)===Re.TOUCH_ZOOM_SCREEN_PAN||(this._state&Re.TOUCH_DOLLY_OFFSET)===Re.TOUCH_DOLLY_OFFSET||(this._state&Re.TOUCH_ZOOM_OFFSET)===Re.TOUCH_ZOOM_OFFSET||(this._state&Re.TOUCH_DOLLY_ROTATE)===Re.TOUCH_DOLLY_ROTATE||(this._state&Re.TOUCH_ZOOM_ROTATE)===Re.TOUCH_ZOOM_ROTATE){const w=Yi.x-this._activePointers[1].clientX,T=Yi.y-this._activePointers[1].clientY,R=Math.sqrt(w*w+T*T),U=s.y-R;s.set(0,R);const A=this.dollyToCursor?(r.x-this._elementRect.x)/this._elementRect.width*2-1:0,D=this.dollyToCursor?(r.y-this._elementRect.y)/this._elementRect.height*-2+1:0;(this._state&Re.TOUCH_DOLLY)===Re.TOUCH_DOLLY||(this._state&Re.TOUCH_DOLLY_ROTATE)===Re.TOUCH_DOLLY_ROTATE||(this._state&Re.TOUCH_DOLLY_TRUCK)===Re.TOUCH_DOLLY_TRUCK||(this._state&Re.TOUCH_DOLLY_SCREEN_PAN)===Re.TOUCH_DOLLY_SCREEN_PAN||(this._state&Re.TOUCH_DOLLY_OFFSET)===Re.TOUCH_DOLLY_OFFSET?(this._dollyInternal(U*kp,A,D),this._isUserControllingDolly=!0):(this._zoomInternal(U*kp,A,D),this._isUserControllingZoom=!0)}((this._state&Re.TRUCK)===Re.TRUCK||(this._state&Re.TOUCH_TRUCK)===Re.TOUCH_TRUCK||(this._state&Re.TOUCH_DOLLY_TRUCK)===Re.TOUCH_DOLLY_TRUCK||(this._state&Re.TOUCH_ZOOM_TRUCK)===Re.TOUCH_ZOOM_TRUCK)&&(this._truckInternal(E,S,!1,!1),this._isUserControllingTruck=!0),((this._state&Re.SCREEN_PAN)===Re.SCREEN_PAN||(this._state&Re.TOUCH_SCREEN_PAN)===Re.TOUCH_SCREEN_PAN||(this._state&Re.TOUCH_DOLLY_SCREEN_PAN)===Re.TOUCH_DOLLY_SCREEN_PAN||(this._state&Re.TOUCH_ZOOM_SCREEN_PAN)===Re.TOUCH_ZOOM_SCREEN_PAN)&&(this._truckInternal(E,S,!1,!0),this._isUserControllingTruck=!0),((this._state&Re.OFFSET)===Re.OFFSET||(this._state&Re.TOUCH_OFFSET)===Re.TOUCH_OFFSET||(this._state&Re.TOUCH_DOLLY_OFFSET)===Re.TOUCH_DOLLY_OFFSET||(this._state&Re.TOUCH_ZOOM_OFFSET)===Re.TOUCH_ZOOM_OFFSET)&&(this._truckInternal(E,S,!0,!1),this._isUserControllingOffset=!0),this.dispatchEvent({type:"control"})},v=()=>{qy(this._activePointers,Yi),r.copy(Yi),this._dragNeedsUpdate=!1,(this._activePointers.length===0||this._activePointers.length===1&&this._activePointers[0]===this._lockedPointer)&&(this._isDragging=!1),this._activePointers.length===0&&this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",l),this.dispatchEvent({type:"controlend"}))};this.lockPointer=()=>{!this._enabled||!this._domElement||(this.cancel(),this._lockedPointer={pointerId:-1,clientX:0,clientY:0,deltaX:0,deltaY:0,mouseButton:null},this._activePointers.push(this._lockedPointer),this._domElement.ownerDocument.removeEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",l),this._domElement.requestPointerLock(),this._domElement.ownerDocument.addEventListener("pointerlockchange",x),this._domElement.ownerDocument.addEventListener("pointerlockerror",_),this._domElement.ownerDocument.addEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",l),p())},this.unlockPointer=()=>{this._lockedPointer!==null&&(this._disposePointer(this._lockedPointer),this._lockedPointer=null),this._domElement?.ownerDocument.exitPointerLock(),this._domElement?.ownerDocument.removeEventListener("pointerlockchange",x),this._domElement?.ownerDocument.removeEventListener("pointerlockerror",_),this.cancel()};const x=()=>{this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement||this.unlockPointer()},_=()=>{this.unlockPointer()};this._addAllEventListeners=g=>{this._domElement=g,this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none",this._domElement.addEventListener("pointerdown",a),this._domElement.addEventListener("pointercancel",l),this._domElement.addEventListener("wheel",h,{passive:!1}),this._domElement.addEventListener("contextmenu",d)},this._removeAllEventListeners=()=>{this._domElement&&(this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect="",this._domElement.removeEventListener("pointerdown",a),this._domElement.removeEventListener("pointercancel",l),this._domElement.removeEventListener("wheel",h,{passive:!1}),this._domElement.removeEventListener("contextmenu",d),this._domElement.ownerDocument.removeEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",l),this._domElement.ownerDocument.removeEventListener("pointerlockchange",x),this._domElement.ownerDocument.removeEventListener("pointerlockerror",_))},this.cancel=()=>{this._state!==Re.NONE&&(this._state=Re.NONE,this._activePointers.length=0,v())},t&&this.connect(t),this.update(0)}get camera(){return this._camera}set camera(e){this._camera=e,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._domElement&&(e?(this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none"):(this.cancel(),this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect=""))}get active(){return!this._hasRested}get currentAction(){return this._state}get distance(){return this._spherical.radius}set distance(e){this._spherical.radius===e&&this._sphericalEnd.radius===e||(this._spherical.radius=e,this._sphericalEnd.radius=e,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(e){this._spherical.theta===e&&this._sphericalEnd.theta===e||(this._spherical.theta=e,this._sphericalEnd.theta=e,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(e){this._spherical.phi===e&&this._sphericalEnd.phi===e||(this._spherical.phi=e,this._sphericalEnd.phi=e,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(e){this._boundaryEnclosesCamera=e,this._needsUpdate=!0}set interactiveArea(e){this._interactiveArea.width=ns(e.width,0,1),this._interactiveArea.height=ns(e.height,0,1),this._interactiveArea.x=ns(e.x,0,1-this._interactiveArea.width),this._interactiveArea.y=ns(e.y,0,1-this._interactiveArea.height)}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}rotate(e,t,n=!1){return this.rotateTo(this._sphericalEnd.theta+e,this._sphericalEnd.phi+t,n)}rotateAzimuthTo(e,t=!1){return this.rotateTo(e,this._sphericalEnd.phi,t)}rotatePolarTo(e,t=!1){return this.rotateTo(this._sphericalEnd.theta,e,t)}rotateTo(e,t,n=!1){this._isUserControllingRotate=!1;const r=ns(e,this.minAzimuthAngle,this.maxAzimuthAngle),s=ns(t,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=r,this._sphericalEnd.phi=s,this._sphericalEnd.makeSafe(),this._needsUpdate=!0,n||(this._spherical.theta=this._sphericalEnd.theta,this._spherical.phi=this._sphericalEnd.phi);const a=!n||nn(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&nn(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(a)}dolly(e,t=!1){return this.dollyTo(this._sphericalEnd.radius-e,t)}dollyTo(e,t=!1){return this._isUserControllingDolly=!1,this._lastDollyDirection=kc.NONE,this._changedDolly=0,this._dollyToNoClamp(ns(e,this.minDistance,this.maxDistance),t)}_dollyToNoClamp(e,t=!1){const n=this._sphericalEnd.radius;if(this.colliderMeshes.length>=1){const a=this._collisionTest(),o=nn(a,this._spherical.radius);if(!(n>e)&&o)return Promise.resolve();this._sphericalEnd.radius=Math.min(e,a)}else this._sphericalEnd.radius=e;this._needsUpdate=!0,t||(this._spherical.radius=this._sphericalEnd.radius);const s=!t||nn(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(s)}dollyInFixed(e,t=!1){this._targetEnd.add(this._getCameraDirection(Ch).multiplyScalar(e)),t||this._target.copy(this._targetEnd);const n=!t||nn(this._target.x,this._targetEnd.x,this.restThreshold)&&nn(this._target.y,this._targetEnd.y,this.restThreshold)&&nn(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(n)}zoom(e,t=!1){return this.zoomTo(this._zoomEnd+e,t)}zoomTo(e,t=!1){this._isUserControllingZoom=!1,this._zoomEnd=ns(e,this.minZoom,this.maxZoom),this._needsUpdate=!0,t||(this._zoom=this._zoomEnd);const n=!t||nn(this._zoom,this._zoomEnd,this.restThreshold);return this._changedZoom=0,this._createOnRestPromise(n)}pan(e,t,n=!1){return console.warn("`pan` has been renamed to `truck`"),this.truck(e,t,n)}truck(e,t,n=!1){this._camera.updateMatrix(),ys.setFromMatrixColumn(this._camera.matrix,0),_s.setFromMatrixColumn(this._camera.matrix,1),ys.multiplyScalar(e),_s.multiplyScalar(-t);const r=Lt.copy(ys).add(_s),s=Kt.copy(this._targetEnd).add(r);return this.moveTo(s.x,s.y,s.z,n)}forward(e,t=!1){Lt.setFromMatrixColumn(this._camera.matrix,0),Lt.crossVectors(this._camera.up,Lt),Lt.multiplyScalar(e);const n=Kt.copy(this._targetEnd).add(Lt);return this.moveTo(n.x,n.y,n.z,t)}elevate(e,t=!1){return Lt.copy(this._camera.up).multiplyScalar(e),this.moveTo(this._targetEnd.x+Lt.x,this._targetEnd.y+Lt.y,this._targetEnd.z+Lt.z,t)}moveTo(e,t,n,r=!1){this._isUserControllingTruck=!1;const s=Lt.set(e,t,n).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,s,this.boundaryFriction),this._needsUpdate=!0,r||this._target.copy(this._targetEnd);const a=!r||nn(this._target.x,this._targetEnd.x,this.restThreshold)&&nn(this._target.y,this._targetEnd.y,this.restThreshold)&&nn(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(a)}lookInDirectionOf(e,t,n,r=!1){const o=Lt.set(e,t,n).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius).add(this._targetEnd);return this.setPosition(o.x,o.y,o.z,r)}fitToBox(e,t,{cover:n=!1,paddingLeft:r=0,paddingRight:s=0,paddingBottom:a=0,paddingTop:o=0}={}){const l=[],c=e.isBox3?Vc.copy(e):Vc.setFromObject(e);c.isEmpty()&&(console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"),Promise.resolve());const h=jM(this._sphericalEnd.theta,XM),d=jM(this._sphericalEnd.phi,XM);l.push(this.rotateTo(h,d,t));const p=Lt.setFromSpherical(this._sphericalEnd).normalize(),m=QM.setFromUnitVectors(p,Zy),v=nn(Math.abs(p.y),1);v&&m.multiply(Jy.setFromAxisAngle(Gp,h)),m.multiply(this._yAxisUpSpaceInverse);const x=JM.makeEmpty();Kt.copy(c.min).applyQuaternion(m),x.expandByPoint(Kt),Kt.copy(c.min).setX(c.max.x).applyQuaternion(m),x.expandByPoint(Kt),Kt.copy(c.min).setY(c.max.y).applyQuaternion(m),x.expandByPoint(Kt),Kt.copy(c.max).setZ(c.min.z).applyQuaternion(m),x.expandByPoint(Kt),Kt.copy(c.min).setZ(c.max.z).applyQuaternion(m),x.expandByPoint(Kt),Kt.copy(c.max).setY(c.min.y).applyQuaternion(m),x.expandByPoint(Kt),Kt.copy(c.max).setX(c.min.x).applyQuaternion(m),x.expandByPoint(Kt),Kt.copy(c.max).applyQuaternion(m),x.expandByPoint(Kt),x.min.x-=r,x.min.y-=a,x.max.x+=s,x.max.y+=o,m.setFromUnitVectors(Zy,p),v&&m.premultiply(Jy.invert()),m.premultiply(this._yAxisUpSpace);const _=x.getSize(Lt),g=x.getCenter(Kt).applyQuaternion(m);if(ol(this._camera)){const b=this.getDistanceToFitBox(_.x,_.y,_.z,n);l.push(this.moveTo(g.x,g.y,g.z,t)),l.push(this.dollyTo(b,t)),l.push(this.setFocalOffset(0,0,0,t))}else if(io(this._camera)){const b=this._camera,E=b.right-b.left,S=b.top-b.bottom,w=n?Math.max(E/_.x,S/_.y):Math.min(E/_.x,S/_.y);l.push(this.moveTo(g.x,g.y,g.z,t)),l.push(this.zoomTo(w,t)),l.push(this.setFocalOffset(0,0,0,t))}return Promise.all(l)}fitToSphere(e,t){const n=[],s="isObject3D"in e?ux.createBoundingSphere(e,Ky):Ky.copy(e);if(n.push(this.moveTo(s.center.x,s.center.y,s.center.z,t)),ol(this._camera)){const a=this.getDistanceToFitSphere(s.radius);n.push(this.dollyTo(a,t))}else if(io(this._camera)){const a=this._camera.right-this._camera.left,o=this._camera.top-this._camera.bottom,l=2*s.radius,c=Math.min(a/l,o/l);n.push(this.zoomTo(c,t))}return n.push(this.setFocalOffset(0,0,0,t)),Promise.all(n)}setLookAt(e,t,n,r,s,a,o=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=kc.NONE,this._changedDolly=0;const l=Kt.set(r,s,a),c=Lt.set(e,t,n);this._targetEnd.copy(l),this._sphericalEnd.setFromVector3(c.sub(l).applyQuaternion(this._yAxisUpSpace)),this._needsUpdate=!0,o||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const h=!o||nn(this._target.x,this._targetEnd.x,this.restThreshold)&&nn(this._target.y,this._targetEnd.y,this.restThreshold)&&nn(this._target.z,this._targetEnd.z,this.restThreshold)&&nn(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&nn(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&nn(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(h)}lerp(e,t,n,r=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=kc.NONE,this._changedDolly=0;const s=Lt.set(...e.target);if("spherical"in e)vr.set(...e.spherical);else{const d=Kt.set(...e.position);vr.setFromVector3(d.sub(s).applyQuaternion(this._yAxisUpSpace))}const a=Gc.set(...t.target);if("spherical"in t)Hc.set(...t.spherical);else{const d=Kt.set(...t.position);Hc.setFromVector3(d.sub(a).applyQuaternion(this._yAxisUpSpace))}this._targetEnd.copy(s.lerp(a,n));const o=Hc.theta-vr.theta,l=Hc.phi-vr.phi,c=Hc.radius-vr.radius;this._sphericalEnd.set(vr.radius+c*n,vr.phi+l*n,vr.theta+o*n),this._needsUpdate=!0,r||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const h=!r||nn(this._target.x,this._targetEnd.x,this.restThreshold)&&nn(this._target.y,this._targetEnd.y,this.restThreshold)&&nn(this._target.z,this._targetEnd.z,this.restThreshold)&&nn(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&nn(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&nn(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(h)}lerpLookAt(e,t,n,r,s,a,o,l,c,h,d,p,m,v=!1){return this.lerp({position:[e,t,n],target:[r,s,a]},{position:[o,l,c],target:[h,d,p]},m,v)}setPosition(e,t,n,r=!1){return this.setLookAt(e,t,n,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,r)}setTarget(e,t,n,r=!1){const s=this.getPosition(Lt),a=this.setLookAt(s.x,s.y,s.z,e,t,n,r);return this._sphericalEnd.phi=ns(this._sphericalEnd.phi,this.minPolarAngle,this.maxPolarAngle),a}setFocalOffset(e,t,n,r=!1){this._isUserControllingOffset=!1,this._focalOffsetEnd.set(e,t,n),this._needsUpdate=!0,r||this._focalOffset.copy(this._focalOffsetEnd);const s=!r||nn(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&&nn(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&&nn(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(s)}setOrbitPoint(e,t,n){this._camera.updateMatrixWorld(),ys.setFromMatrixColumn(this._camera.matrixWorldInverse,0),_s.setFromMatrixColumn(this._camera.matrixWorldInverse,1),ll.setFromMatrixColumn(this._camera.matrixWorldInverse,2);const r=Lt.set(e,t,n),s=r.distanceTo(this._camera.position),a=r.sub(this._camera.position);ys.multiplyScalar(a.x),_s.multiplyScalar(a.y),ll.multiplyScalar(a.z),Lt.copy(ys).add(_s).add(ll),Lt.z=Lt.z+s,this.dollyTo(s,!1),this.setFocalOffset(-Lt.x,Lt.y,-Lt.z,!1),this.moveTo(e,t,n,!1)}setBoundary(e){if(!e){this._boundary.min.set(-1/0,-1/0,-1/0),this._boundary.max.set(1/0,1/0,1/0),this._needsUpdate=!0;return}this._boundary.copy(e),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(e,t,n,r){if(e===null){this._viewport=null;return}this._viewport=this._viewport||new Mt.Vector4,typeof e=="number"?this._viewport.set(e,t,n,r):this._viewport.copy(e)}getDistanceToFitBox(e,t,n,r=!1){if(Yy(this._camera,"getDistanceToFitBox"))return this._spherical.radius;const s=e/t,a=this._camera.getEffectiveFOV()*wh,o=this._camera.aspect;return((r?s>o:s<o)?t:e/o)*.5/Math.tan(a*.5)+n*.5}getDistanceToFitSphere(e){if(Yy(this._camera,"getDistanceToFitSphere"))return this._spherical.radius;const t=this._camera.getEffectiveFOV()*wh,n=Math.atan(Math.tan(t*.5)*this._camera.aspect)*2,r=1<this._camera.aspect?t:n;return e/Math.sin(r*.5)}getTarget(e,t=!0){return(e&&e.isVector3?e:new Mt.Vector3).copy(t?this._targetEnd:this._target)}getPosition(e,t=!0){return(e&&e.isVector3?e:new Mt.Vector3).setFromSpherical(t?this._sphericalEnd:this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(t?this._targetEnd:this._target)}getSpherical(e,t=!0){return(e||new Mt.Spherical).copy(t?this._sphericalEnd:this._spherical)}getFocalOffset(e,t=!0){return(e&&e.isVector3?e:new Mt.Vector3).copy(t?this._focalOffsetEnd:this._focalOffset)}normalizeRotations(){return this._sphericalEnd.theta=(this._sphericalEnd.theta%eo+eo)%eo,this._sphericalEnd.theta>Math.PI&&(this._sphericalEnd.theta-=eo),this._spherical.theta+=eo*Math.round((this._sphericalEnd.theta-this._spherical.theta)/eo),this}stop(){this._focalOffset.copy(this._focalOffsetEnd),this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd),this._zoom=this._zoomEnd}reset(e=!1){if(!nn(this._camera.up.x,this._cameraUp0.x)||!nn(this._camera.up.y,this._cameraUp0.y)||!nn(this._camera.up.z,this._cameraUp0.z)){this._camera.up.copy(this._cameraUp0);const n=this.getPosition(Lt);this.updateCameraUp(),this.setPosition(n.x,n.y,n.z)}const t=[this.setLookAt(this._position0.x,this._position0.y,this._position0.z,this._target0.x,this._target0.y,this._target0.z,e),this.setFocalOffset(this._focalOffset0.x,this._focalOffset0.y,this._focalOffset0.z,e),this.zoomTo(this._zoom0,e)];return Promise.all(t)}saveState(){this._cameraUp0.copy(this._camera.up),this.getTarget(this._target0),this.getPosition(this._position0),this._zoom0=this._zoom,this._focalOffset0.copy(this._focalOffset)}updateCameraUp(){this._yAxisUpSpace.setFromUnitVectors(this._camera.up,Gp),this._yAxisUpSpaceInverse.copy(this._yAxisUpSpace).invert()}applyCameraUp(){const e=Lt.subVectors(this._target,this._camera.position).normalize(),t=Kt.crossVectors(e,this._camera.up);this._camera.up.crossVectors(t,e).normalize(),this._camera.updateMatrixWorld();const n=this.getPosition(Lt);this.updateCameraUp(),this.setPosition(n.x,n.y,n.z)}update(e){const t=this._sphericalEnd.theta-this._spherical.theta,n=this._sphericalEnd.phi-this._spherical.phi,r=this._sphericalEnd.radius-this._spherical.radius,s=ZM.subVectors(this._targetEnd,this._target),a=KM.subVectors(this._focalOffsetEnd,this._focalOffset),o=this._zoomEnd-this._zoom;if(pn(t))this._thetaVelocity.value=0,this._spherical.theta=this._sphericalEnd.theta;else{const d=this._isUserControllingRotate?this.draggingSmoothTime:this.smoothTime;this._spherical.theta=Bp(this._spherical.theta,this._sphericalEnd.theta,this._thetaVelocity,d,1/0,e),this._needsUpdate=!0}if(pn(n))this._phiVelocity.value=0,this._spherical.phi=this._sphericalEnd.phi;else{const d=this._isUserControllingRotate?this.draggingSmoothTime:this.smoothTime;this._spherical.phi=Bp(this._spherical.phi,this._sphericalEnd.phi,this._phiVelocity,d,1/0,e),this._needsUpdate=!0}if(pn(r))this._radiusVelocity.value=0,this._spherical.radius=this._sphericalEnd.radius;else{const d=this._isUserControllingDolly?this.draggingSmoothTime:this.smoothTime;this._spherical.radius=Bp(this._spherical.radius,this._sphericalEnd.radius,this._radiusVelocity,d,this.maxSpeed,e),this._needsUpdate=!0}if(pn(s.x)&&pn(s.y)&&pn(s.z))this._targetVelocity.set(0,0,0),this._target.copy(this._targetEnd);else{const d=this._isUserControllingTruck?this.draggingSmoothTime:this.smoothTime;qM(this._target,this._targetEnd,this._targetVelocity,d,this.maxSpeed,e,this._target),this._needsUpdate=!0}if(pn(a.x)&&pn(a.y)&&pn(a.z))this._focalOffsetVelocity.set(0,0,0),this._focalOffset.copy(this._focalOffsetEnd);else{const d=this._isUserControllingOffset?this.draggingSmoothTime:this.smoothTime;qM(this._focalOffset,this._focalOffsetEnd,this._focalOffsetVelocity,d,this.maxSpeed,e,this._focalOffset),this._needsUpdate=!0}if(pn(o))this._zoomVelocity.value=0,this._zoom=this._zoomEnd;else{const d=this._isUserControllingZoom?this.draggingSmoothTime:this.smoothTime;this._zoom=Bp(this._zoom,this._zoomEnd,this._zoomVelocity,d,1/0,e)}if(this.dollyToCursor){if(ol(this._camera)&&this._changedDolly!==0){const d=this._spherical.radius-this._lastDistance,p=this._camera,m=this._getCameraDirection(Ch),v=Lt.copy(m).cross(p.up).normalize();v.lengthSq()===0&&(v.x=1);const x=Kt.crossVectors(v,m),_=this._sphericalEnd.radius*Math.tan(p.getEffectiveFOV()*wh*.5),b=(this._sphericalEnd.radius-d-this._sphericalEnd.radius)/this._sphericalEnd.radius,E=Gc.copy(this._targetEnd).add(v.multiplyScalar(this._dollyControlCoord.x*_*p.aspect)).add(x.multiplyScalar(this._dollyControlCoord.y*_)),S=Lt.copy(this._targetEnd).lerp(E,b),w=this._lastDollyDirection===kc.IN&&this._spherical.radius<=this.minDistance,T=this._lastDollyDirection===kc.OUT&&this.maxDistance<=this._spherical.radius;if(this.infinityDolly&&(w||T)){this._sphericalEnd.radius-=d,this._spherical.radius-=d;const U=Kt.copy(m).multiplyScalar(-d);S.add(U)}this._boundary.clampPoint(S,S);const R=Kt.subVectors(S,this._targetEnd);this._targetEnd.copy(S),this._target.add(R),this._changedDolly-=d,pn(this._changedDolly)&&(this._changedDolly=0)}else if(io(this._camera)&&this._changedZoom!==0){const d=this._zoom-this._lastZoom,p=this._camera,m=Lt.set(this._dollyControlCoord.x,this._dollyControlCoord.y,(p.near+p.far)/(p.near-p.far)).unproject(p),v=Kt.set(0,0,-1).applyQuaternion(p.quaternion),x=Gc.copy(m).add(v.multiplyScalar(-m.dot(p.up))),g=-(this._zoom-d-this._zoom)/this._zoom,b=this._getCameraDirection(Ch),E=this._targetEnd.dot(b),S=Lt.copy(this._targetEnd).lerp(x,g),w=S.dot(b),T=b.multiplyScalar(w-E);S.sub(T),this._boundary.clampPoint(S,S);const R=Kt.subVectors(S,this._targetEnd);this._targetEnd.copy(S),this._target.add(R),this._changedZoom-=d,pn(this._changedZoom)&&(this._changedZoom=0)}}this._camera.zoom!==this._zoom&&(this._camera.zoom=this._zoom,this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0),this._dragNeedsUpdate=!0;const l=this._collisionTest();this._spherical.radius=Math.min(this._spherical.radius,l),this._spherical.makeSafe(),this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target),this._camera.lookAt(this._target),(!pn(this._focalOffset.x)||!pn(this._focalOffset.y)||!pn(this._focalOffset.z))&&(this._camera.matrix.compose(this._camera.position,this._camera.quaternion,this._camera.scale),ys.setFromMatrixColumn(this._camera.matrix,0),_s.setFromMatrixColumn(this._camera.matrix,1),ll.setFromMatrixColumn(this._camera.matrix,2),ys.multiplyScalar(this._focalOffset.x),_s.multiplyScalar(-this._focalOffset.y),ll.multiplyScalar(this._focalOffset.z),Lt.copy(ys).add(_s).add(ll),this._camera.position.add(Lt),this._camera.updateMatrixWorld()),this._boundaryEnclosesCamera&&this._encloseToBoundary(this._camera.position.copy(this._target),Lt.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse),1);const h=this._needsUpdate;return h&&!this._updatedLastTime?(this._hasRested=!1,this.dispatchEvent({type:"wake"}),this.dispatchEvent({type:"update"})):h?(this.dispatchEvent({type:"update"}),pn(t,this.restThreshold)&&pn(n,this.restThreshold)&&pn(r,this.restThreshold)&&pn(s.x,this.restThreshold)&&pn(s.y,this.restThreshold)&&pn(s.z,this.restThreshold)&&pn(a.x,this.restThreshold)&&pn(a.y,this.restThreshold)&&pn(a.z,this.restThreshold)&&pn(o,this.restThreshold)&&!this._hasRested&&(this._hasRested=!0,this.dispatchEvent({type:"rest"}))):!h&&this._updatedLastTime&&this.dispatchEvent({type:"sleep"}),this._lastDistance=this._spherical.radius,this._lastZoom=this._zoom,this._updatedLastTime=h,this._needsUpdate=!1,h}toJSON(){return JSON.stringify({enabled:this._enabled,minDistance:this.minDistance,maxDistance:Th(this.maxDistance),minZoom:this.minZoom,maxZoom:Th(this.maxZoom),minPolarAngle:this.minPolarAngle,maxPolarAngle:Th(this.maxPolarAngle),minAzimuthAngle:Th(this.minAzimuthAngle),maxAzimuthAngle:Th(this.maxAzimuthAngle),smoothTime:this.smoothTime,draggingSmoothTime:this.draggingSmoothTime,dollySpeed:this.dollySpeed,truckSpeed:this.truckSpeed,dollyToCursor:this.dollyToCursor,target:this._targetEnd.toArray(),position:Lt.setFromSpherical(this._sphericalEnd).add(this._targetEnd).toArray(),zoom:this._zoomEnd,focalOffset:this._focalOffsetEnd.toArray(),target0:this._target0.toArray(),position0:this._position0.toArray(),zoom0:this._zoom0,focalOffset0:this._focalOffset0.toArray()})}fromJSON(e,t=!1){const n=JSON.parse(e);this.enabled=n.enabled,this.minDistance=n.minDistance,this.maxDistance=Ah(n.maxDistance),this.minZoom=n.minZoom,this.maxZoom=Ah(n.maxZoom),this.minPolarAngle=n.minPolarAngle,this.maxPolarAngle=Ah(n.maxPolarAngle),this.minAzimuthAngle=Ah(n.minAzimuthAngle),this.maxAzimuthAngle=Ah(n.maxAzimuthAngle),this.smoothTime=n.smoothTime,this.draggingSmoothTime=n.draggingSmoothTime,this.dollySpeed=n.dollySpeed,this.truckSpeed=n.truckSpeed,this.dollyToCursor=n.dollyToCursor,this._target0.fromArray(n.target0),this._position0.fromArray(n.position0),this._zoom0=n.zoom0,this._focalOffset0.fromArray(n.focalOffset0),this.moveTo(n.target[0],n.target[1],n.target[2],t),vr.setFromVector3(Lt.fromArray(n.position).sub(this._targetEnd).applyQuaternion(this._yAxisUpSpace)),this.rotateTo(vr.theta,vr.phi,t),this.dollyTo(vr.radius,t),this.zoomTo(n.zoom,t),this.setFocalOffset(n.focalOffset[0],n.focalOffset[1],n.focalOffset[2],t),this._needsUpdate=!0}connect(e){if(this._domElement){console.warn("camera-controls is already connected.");return}e.setAttribute("data-camera-controls-version",B5),this._addAllEventListeners(e),this._getClientRect(this._elementRect)}disconnect(){this.cancel(),this._removeAllEventListeners(),this._domElement&&(this._domElement.removeAttribute("data-camera-controls-version"),this._domElement=void 0)}dispose(){this.removeAllEventListeners(),this.disconnect()}_getTargetDirection(e){return e.setFromSpherical(this._spherical).divideScalar(this._spherical.radius).applyQuaternion(this._yAxisUpSpaceInverse)}_getCameraDirection(e){return this._getTargetDirection(e).negate()}_findPointerById(e){return this._activePointers.find(t=>t.pointerId===e)}_findPointerByMouseButton(e){return this._activePointers.find(t=>t.mouseButton===e)}_disposePointer(e){this._activePointers.splice(this._activePointers.indexOf(e),1)}_encloseToBoundary(e,t,n){const r=t.lengthSq();if(r===0)return e;const s=Kt.copy(t).add(e),o=this._boundary.clampPoint(s,Gc).sub(s),l=o.lengthSq();if(l===0)return e.add(t);if(l===r)return e;if(n===0)return e.add(t).add(o);{const c=1+n*l/t.dot(o);return e.add(Kt.copy(t).multiplyScalar(c)).add(o.multiplyScalar(1-n))}}_updateNearPlaneCorners(){if(ol(this._camera)){const e=this._camera,t=e.near,n=e.getEffectiveFOV()*wh,r=Math.tan(n*.5)*t,s=r*e.aspect;this._nearPlaneCorners[0].set(-s,-r,0),this._nearPlaneCorners[1].set(s,-r,0),this._nearPlaneCorners[2].set(s,r,0),this._nearPlaneCorners[3].set(-s,r,0)}else if(io(this._camera)){const e=this._camera,t=1/e.zoom,n=e.left*t,r=e.right*t,s=e.top*t,a=e.bottom*t;this._nearPlaneCorners[0].set(n,s,0),this._nearPlaneCorners[1].set(r,s,0),this._nearPlaneCorners[2].set(r,a,0),this._nearPlaneCorners[3].set(n,a,0)}}_truckInternal=(e,t,n,r)=>{let s,a;if(ol(this._camera)){const o=Lt.copy(this._camera.position).sub(this._target),l=this._camera.getEffectiveFOV()*wh,c=o.length()*Math.tan(l*.5);s=this.truckSpeed*e*c/this._elementRect.height,a=this.truckSpeed*t*c/this._elementRect.height}else if(io(this._camera)){const o=this._camera;s=this.truckSpeed*e*(o.right-o.left)/o.zoom/this._elementRect.width,a=this.truckSpeed*t*(o.top-o.bottom)/o.zoom/this._elementRect.height}else return;r?(n?this.setFocalOffset(this._focalOffsetEnd.x+s,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(s,0,!0),this.forward(-a,!0)):n?this.setFocalOffset(this._focalOffsetEnd.x+s,this._focalOffsetEnd.y+a,this._focalOffsetEnd.z,!0):this.truck(s,a,!0)};_rotateInternal=(e,t)=>{const n=eo*this.azimuthRotateSpeed*e/this._elementRect.height,r=eo*this.polarRotateSpeed*t/this._elementRect.height;this.rotate(n,r,!0)};_dollyInternal=(e,t,n)=>{const r=Math.pow(.95,-e*this.dollySpeed),s=this._sphericalEnd.radius,a=this._sphericalEnd.radius*r,o=ns(a,this.minDistance,this.maxDistance),l=o-a;this.infinityDolly&&this.dollyToCursor?this._dollyToNoClamp(a,!0):this.infinityDolly&&!this.dollyToCursor?(this.dollyInFixed(l,!0),this._dollyToNoClamp(o,!0)):this._dollyToNoClamp(o,!0),this.dollyToCursor&&(this._changedDolly+=(this.infinityDolly?a:o)-s,this._dollyControlCoord.set(t,n)),this._lastDollyDirection=Math.sign(-e)};_zoomInternal=(e,t,n)=>{const r=Math.pow(.95,e*this.dollySpeed),s=this._zoom,a=this._zoom*r;this.zoomTo(a,!0),this.dollyToCursor&&(this._changedZoom+=a-s,this._dollyControlCoord.set(t,n))};_collisionTest(){let e=1/0;if(!(this.colliderMeshes.length>=1)||Yy(this._camera,"_collisionTest"))return e;const n=this._getTargetDirection(Ch);Qy.lookAt(YM,n,this._camera.up);for(let r=0;r<4;r++){const s=Kt.copy(this._nearPlaneCorners[r]);s.applyMatrix4(Qy);const a=Gc.addVectors(this._target,s);Hp.set(a,n),Hp.far=this._spherical.radius+1;const o=Hp.intersectObjects(this.colliderMeshes);o.length!==0&&o[0].distance<e&&(e=o[0].distance)}return e}_getClientRect(e){if(!this._domElement)return;const t=this._domElement.getBoundingClientRect();return e.x=t.left,e.y=t.top,this._viewport?(e.x+=this._viewport.x,e.y+=t.height-this._viewport.w-this._viewport.y,e.width=this._viewport.z,e.height=this._viewport.w):(e.width=t.width,e.height=t.height),e}_createOnRestPromise(e){return e?Promise.resolve():(this._hasRested=!1,this.dispatchEvent({type:"transitionstart"}),new Promise(t=>{const n=()=>{this.removeEventListener("rest",n),t()};this.addEventListener("rest",n)}))}_addAllEventListeners(e){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead."),0}set dampingFactor(e){console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead.")}get draggingDampingFactor(){return console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead."),0}set draggingDampingFactor(e){console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.")}static createBoundingSphere(e,t=new Mt.Sphere){const n=t,r=n.center;Vc.makeEmpty(),e.traverseVisible(a=>{a.isMesh&&Vc.expandByObject(a)}),Vc.getCenter(r);let s=0;return e.traverseVisible(a=>{if(!a.isMesh)return;const o=a;if(!o.geometry)return;const l=o.geometry.clone();l.applyMatrix4(o.matrixWorld);const h=l.attributes.position;for(let d=0,p=h.count;d<p;d++)Lt.fromBufferAttribute(h,d),s=Math.max(s,r.distanceToSquared(Lt))}),n.radius=Math.sqrt(s),n}};var df;(function(i){i.HOLD_START="holdStart",i.HOLD_END="holdEnd",i.HOLDING="holding"})(df||(df={}));class G5{constructor(){this._listeners={}}addEventListener(e,t){const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}removeEventListener(e,t){const r=this._listeners[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}dispatchEvent(e){const n=this._listeners[e.type];if(n!==void 0){e.target=this;const r=n.slice(0);for(let s=0,a=r.length;s<a;s++)r[s].call(this,e)}}}class H5 extends G5{constructor(e){super(),this._enabled=!0,this._holding=!1,this._intervalId=-1,this._deltaTime=0,this._elapsedTime=0,this._lastTime=0,this._holdStart=t=>{if(!this._enabled||this._holding)return;this._deltaTime=0,this._elapsedTime=0,this._lastTime=performance.now(),this.dispatchEvent({type:df.HOLD_START,deltaTime:this._deltaTime,elapsedTime:this._elapsedTime,originalEvent:t}),this._holding=!0;const n=()=>{this._intervalId=this.holdIntervalDelay?window.setTimeout(n,this.holdIntervalDelay):window.requestAnimationFrame(n);const r=performance.now();this._deltaTime=r-this._lastTime,this._elapsedTime+=this._deltaTime,this._lastTime=performance.now(),this.dispatchEvent({type:df.HOLDING,deltaTime:this._deltaTime,elapsedTime:this._elapsedTime,originalEvent:t})};this._intervalId=this.holdIntervalDelay?window.setTimeout(n,this.holdIntervalDelay):window.requestAnimationFrame(n)},this._holdEnd=t=>{if(!this._enabled||!this._holding)return;const n=performance.now();this._deltaTime=n-this._lastTime,this._elapsedTime+=this._deltaTime,this._lastTime=performance.now(),this.dispatchEvent({type:df.HOLD_END,deltaTime:this._deltaTime,elapsedTime:this._elapsedTime,originalEvent:t}),window.clearTimeout(this._intervalId),window.cancelAnimationFrame(this._intervalId),this._holding=!1},this.holdIntervalDelay=e}get enabled(){return this._enabled}set enabled(e){this._enabled!==e&&(this._enabled=e,this._enabled||this._holdEnd())}get holding(){return this._holding}}class Vp extends H5{constructor(e,t){if(typeof e!="string"){console.error("KeyboardKeyHold: the first argument has to be a KeyboardEvent.code string.");return}super(t),this._holdStart=this._holdStart.bind(this),this._holdEnd=this._holdEnd.bind(this);const n=s=>{V5(s)||s.code===e&&this._holdStart(s)},r=s=>{s.code===e&&this._holdEnd(s)};document.addEventListener("keydown",n),document.addEventListener("keyup",r),window.addEventListener("blur",this._holdEnd)}}function V5(i){const e=i.target;return e.tagName==="INPUT"||e.tagName==="SELECT"||e.tagName==="TEXTAREA"||e.isContentEditable}var Wp={exports:{}},$M;function W5(){if($M)return Wp.exports;$M=1;var i=typeof Reflect=="object"?Reflect:null,e=i&&typeof i.apply=="function"?i.apply:function(w,T,R){return Function.prototype.apply.call(w,T,R)},t;i&&typeof i.ownKeys=="function"?t=i.ownKeys:Object.getOwnPropertySymbols?t=function(w){return Object.getOwnPropertyNames(w).concat(Object.getOwnPropertySymbols(w))}:t=function(w){return Object.getOwnPropertyNames(w)};function n(S){console&&console.warn&&console.warn(S)}var r=Number.isNaN||function(w){return w!==w};function s(){s.init.call(this)}Wp.exports=s,Wp.exports.once=g,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function o(S){if(typeof S!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof S)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(S){if(typeof S!="number"||S<0||r(S))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+S+".");a=S}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(w){if(typeof w!="number"||w<0||r(w))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+w+".");return this._maxListeners=w,this};function l(S){return S._maxListeners===void 0?s.defaultMaxListeners:S._maxListeners}s.prototype.getMaxListeners=function(){return l(this)},s.prototype.emit=function(w){for(var T=[],R=1;R<arguments.length;R++)T.push(arguments[R]);var U=w==="error",A=this._events;if(A!==void 0)U=U&&A.error===void 0;else if(!U)return!1;if(U){var D;if(T.length>0&&(D=T[0]),D instanceof Error)throw D;var L=new Error("Unhandled error."+(D?" ("+D.message+")":""));throw L.context=D,L}var P=A[w];if(P===void 0)return!1;if(typeof P=="function")e(P,this,T);else for(var I=P.length,V=v(P,I),R=0;R<I;++R)e(V[R],this,T);return!0};function c(S,w,T,R){var U,A,D;if(o(T),A=S._events,A===void 0?(A=S._events=Object.create(null),S._eventsCount=0):(A.newListener!==void 0&&(S.emit("newListener",w,T.listener?T.listener:T),A=S._events),D=A[w]),D===void 0)D=A[w]=T,++S._eventsCount;else if(typeof D=="function"?D=A[w]=R?[T,D]:[D,T]:R?D.unshift(T):D.push(T),U=l(S),U>0&&D.length>U&&!D.warned){D.warned=!0;var L=new Error("Possible EventEmitter memory leak detected. "+D.length+" "+String(w)+" listeners added. Use emitter.setMaxListeners() to increase limit");L.name="MaxListenersExceededWarning",L.emitter=S,L.type=w,L.count=D.length,n(L)}return S}s.prototype.addListener=function(w,T){return c(this,w,T,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(w,T){return c(this,w,T,!0)};function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(S,w,T){var R={fired:!1,wrapFn:void 0,target:S,type:w,listener:T},U=h.bind(R);return U.listener=T,R.wrapFn=U,U}s.prototype.once=function(w,T){return o(T),this.on(w,d(this,w,T)),this},s.prototype.prependOnceListener=function(w,T){return o(T),this.prependListener(w,d(this,w,T)),this},s.prototype.removeListener=function(w,T){var R,U,A,D,L;if(o(T),U=this._events,U===void 0)return this;if(R=U[w],R===void 0)return this;if(R===T||R.listener===T)--this._eventsCount===0?this._events=Object.create(null):(delete U[w],U.removeListener&&this.emit("removeListener",w,R.listener||T));else if(typeof R!="function"){for(A=-1,D=R.length-1;D>=0;D--)if(R[D]===T||R[D].listener===T){L=R[D].listener,A=D;break}if(A<0)return this;A===0?R.shift():x(R,A),R.length===1&&(U[w]=R[0]),U.removeListener!==void 0&&this.emit("removeListener",w,L||T)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(w){var T,R,U;if(R=this._events,R===void 0)return this;if(R.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):R[w]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete R[w]),this;if(arguments.length===0){var A=Object.keys(R),D;for(U=0;U<A.length;++U)D=A[U],D!=="removeListener"&&this.removeAllListeners(D);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(T=R[w],typeof T=="function")this.removeListener(w,T);else if(T!==void 0)for(U=T.length-1;U>=0;U--)this.removeListener(w,T[U]);return this};function p(S,w,T){var R=S._events;if(R===void 0)return[];var U=R[w];return U===void 0?[]:typeof U=="function"?T?[U.listener||U]:[U]:T?_(U):v(U,U.length)}s.prototype.listeners=function(w){return p(this,w,!0)},s.prototype.rawListeners=function(w){return p(this,w,!1)},s.listenerCount=function(S,w){return typeof S.listenerCount=="function"?S.listenerCount(w):m.call(S,w)},s.prototype.listenerCount=m;function m(S){var w=this._events;if(w!==void 0){var T=w[S];if(typeof T=="function")return 1;if(T!==void 0)return T.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function v(S,w){for(var T=new Array(w),R=0;R<w;++R)T[R]=S[R];return T}function x(S,w){for(;w+1<S.length;w++)S[w]=S[w+1];S.pop()}function _(S){for(var w=new Array(S.length),T=0;T<w.length;++T)w[T]=S[T].listener||S[T];return w}function g(S,w){return new Promise(function(T,R){function U(D){S.removeListener(w,A),R(D)}function A(){typeof S.removeListener=="function"&&S.removeListener("error",U),T([].slice.call(arguments))}E(S,w,A,{once:!0}),w!=="error"&&b(S,U,{once:!0})})}function b(S,w,T){typeof S.on=="function"&&E(S,"error",w,T)}function E(S,w,T,R){if(typeof S.on=="function")R.once?S.once(w,T):S.on(w,T);else if(typeof S.addEventListener=="function")S.addEventListener(w,function U(A){R.once&&S.removeEventListener(w,U),T(A)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof S)}return Wp.exports}var X5=W5();function j5(){const i=arguments[0];for(let e=1,t=arguments.length;e<t;e++)if(arguments[e])for(const n in arguments[e])i[n]=arguments[e][n];return i}let ii=j5;typeof Object.assign=="function"&&(ii=Object.assign);function kr(i,e,t,n){const r=i._nodes.get(e);let s=null;return r&&(n==="mixed"?s=r.out&&r.out[t]||r.undirected&&r.undirected[t]:n==="directed"?s=r.out&&r.out[t]:s=r.undirected&&r.undirected[t]),s}function gi(i){return typeof i=="object"&&i!==null}function HC(i){let e;for(e in i)return!1;return!0}function Or(i,e,t){Object.defineProperty(i,e,{enumerable:!1,configurable:!1,writable:!0,value:t})}function $r(i,e,t){const n={enumerable:!0,configurable:!0};typeof t=="function"?n.get=t:(n.value=t,n.writable=!1),Object.defineProperty(i,e,n)}function ew(i){return!(!gi(i)||i.attributes&&!Array.isArray(i.attributes))}function q5(){let i=Math.floor(Math.random()*256)&255;return()=>i++}function va(){const i=arguments;let e=null,t=-1;return{[Symbol.iterator](){return this},next(){let n=null;do{if(e===null){if(t++,t>=i.length)return{done:!0};e=i[t][Symbol.iterator]()}if(n=e.next(),n.done){e=null;continue}break}while(!0);return n}}}function Uu(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}class R1 extends Error{constructor(e){super(),this.name="GraphError",this.message=e}}class ut extends R1{constructor(e){super(e),this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,ut.prototype.constructor)}}class et extends R1{constructor(e){super(e),this.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,et.prototype.constructor)}}class xt extends R1{constructor(e){super(e),this.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,xt.prototype.constructor)}}function VC(i,e){this.key=i,this.attributes=e,this.clear()}VC.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}};function WC(i,e){this.key=i,this.attributes=e,this.clear()}WC.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function XC(i,e){this.key=i,this.attributes=e,this.clear()}XC.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function Ou(i,e,t,n,r){this.key=e,this.attributes=r,this.undirected=i,this.source=t,this.target=n}Ou.prototype.attach=function(){let i="out",e="in";this.undirected&&(i=e="undirected");const t=this.source.key,n=this.target.key;this.source[i][n]=this,!(this.undirected&&t===n)&&(this.target[e][t]=this)};Ou.prototype.attachMulti=function(){let i="out",e="in";const t=this.source.key,n=this.target.key;this.undirected&&(i=e="undirected");const r=this.source[i],s=r[n];if(typeof s>"u"){r[n]=this,this.undirected&&t===n||(this.target[e][t]=this);return}s.previous=this,this.next=s,r[n]=this,this.target[e][t]=this};Ou.prototype.detach=function(){const i=this.source.key,e=this.target.key;let t="out",n="in";this.undirected&&(t=n="undirected"),delete this.source[t][e],delete this.target[n][i]};Ou.prototype.detachMulti=function(){const i=this.source.key,e=this.target.key;let t="out",n="in";this.undirected&&(t=n="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[t][e],delete this.target[n][i]):(this.next.previous=void 0,this.source[t][e]=this.next,this.target[n][i]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};const jC=0,qC=1,Y5=2,YC=3;function Ta(i,e,t,n,r,s,a){let o,l,c,h;if(n=""+n,t===jC){if(o=i._nodes.get(n),!o)throw new et(`Graph.${e}: could not find the "${n}" node in the graph.`);c=r,h=s}else if(t===YC){if(r=""+r,l=i._edges.get(r),!l)throw new et(`Graph.${e}: could not find the "${r}" edge in the graph.`);const d=l.source.key,p=l.target.key;if(n===d)o=l.target;else if(n===p)o=l.source;else throw new et(`Graph.${e}: the "${n}" node is not attached to the "${r}" edge (${d}, ${p}).`);c=s,h=a}else{if(l=i._edges.get(n),!l)throw new et(`Graph.${e}: could not find the "${n}" edge in the graph.`);t===qC?o=l.source:o=l.target,c=r,h=s}return[o,c,h]}function Z5(i,e,t){i.prototype[e]=function(n,r,s){const[a,o]=Ta(this,e,t,n,r,s);return a.attributes[o]}}function K5(i,e,t){i.prototype[e]=function(n,r){const[s]=Ta(this,e,t,n,r);return s.attributes}}function J5(i,e,t){i.prototype[e]=function(n,r,s){const[a,o]=Ta(this,e,t,n,r,s);return a.attributes.hasOwnProperty(o)}}function Q5(i,e,t){i.prototype[e]=function(n,r,s,a){const[o,l,c]=Ta(this,e,t,n,r,s,a);return o.attributes[l]=c,this.emit("nodeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:l}),this}}function $5(i,e,t){i.prototype[e]=function(n,r,s,a){const[o,l,c]=Ta(this,e,t,n,r,s,a);if(typeof c!="function")throw new ut(`Graph.${e}: updater should be a function.`);const h=o.attributes,d=c(h[l]);return h[l]=d,this.emit("nodeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:l}),this}}function ek(i,e,t){i.prototype[e]=function(n,r,s){const[a,o]=Ta(this,e,t,n,r,s);return delete a.attributes[o],this.emit("nodeAttributesUpdated",{key:a.key,type:"remove",attributes:a.attributes,name:o}),this}}function tk(i,e,t){i.prototype[e]=function(n,r,s){const[a,o]=Ta(this,e,t,n,r,s);if(!gi(o))throw new ut(`Graph.${e}: provided attributes are not a plain object.`);return a.attributes=o,this.emit("nodeAttributesUpdated",{key:a.key,type:"replace",attributes:a.attributes}),this}}function nk(i,e,t){i.prototype[e]=function(n,r,s){const[a,o]=Ta(this,e,t,n,r,s);if(!gi(o))throw new ut(`Graph.${e}: provided attributes are not a plain object.`);return ii(a.attributes,o),this.emit("nodeAttributesUpdated",{key:a.key,type:"merge",attributes:a.attributes,data:o}),this}}function ik(i,e,t){i.prototype[e]=function(n,r,s){const[a,o]=Ta(this,e,t,n,r,s);if(typeof o!="function")throw new ut(`Graph.${e}: provided updater is not a function.`);return a.attributes=o(a.attributes),this.emit("nodeAttributesUpdated",{key:a.key,type:"update",attributes:a.attributes}),this}}const rk=[{name:i=>`get${i}Attribute`,attacher:Z5},{name:i=>`get${i}Attributes`,attacher:K5},{name:i=>`has${i}Attribute`,attacher:J5},{name:i=>`set${i}Attribute`,attacher:Q5},{name:i=>`update${i}Attribute`,attacher:$5},{name:i=>`remove${i}Attribute`,attacher:ek},{name:i=>`replace${i}Attributes`,attacher:tk},{name:i=>`merge${i}Attributes`,attacher:nk},{name:i=>`update${i}Attributes`,attacher:ik}];function sk(i){rk.forEach(function({name:e,attacher:t}){t(i,e("Node"),jC),t(i,e("Source"),qC),t(i,e("Target"),Y5),t(i,e("Opposite"),YC)})}function ak(i,e,t){i.prototype[e]=function(n,r){let s;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new xt(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new xt(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+n,o=""+r;if(r=arguments[2],s=kr(this,a,o,t),!s)throw new et(`Graph.${e}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(t!=="mixed")throw new xt(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,s=this._edges.get(n),!s)throw new et(`Graph.${e}: could not find the "${n}" edge in the graph.`)}return s.attributes[r]}}function ok(i,e,t){i.prototype[e]=function(n){let r;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new xt(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new xt(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+n,a=""+arguments[1];if(r=kr(this,s,a,t),!r)throw new et(`Graph.${e}: could not find an edge for the given path ("${s}" - "${a}").`)}else{if(t!=="mixed")throw new xt(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,r=this._edges.get(n),!r)throw new et(`Graph.${e}: could not find the "${n}" edge in the graph.`)}return r.attributes}}function lk(i,e,t){i.prototype[e]=function(n,r){let s;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new xt(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new xt(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+n,o=""+r;if(r=arguments[2],s=kr(this,a,o,t),!s)throw new et(`Graph.${e}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(t!=="mixed")throw new xt(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,s=this._edges.get(n),!s)throw new et(`Graph.${e}: could not find the "${n}" edge in the graph.`)}return s.attributes.hasOwnProperty(r)}}function ck(i,e,t){i.prototype[e]=function(n,r,s){let a;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new xt(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new xt(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+n,l=""+r;if(r=arguments[2],s=arguments[3],a=kr(this,o,l,t),!a)throw new et(`Graph.${e}: could not find an edge for the given path ("${o}" - "${l}").`)}else{if(t!=="mixed")throw new xt(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,a=this._edges.get(n),!a)throw new et(`Graph.${e}: could not find the "${n}" edge in the graph.`)}return a.attributes[r]=s,this.emit("edgeAttributesUpdated",{key:a.key,type:"set",attributes:a.attributes,name:r}),this}}function uk(i,e,t){i.prototype[e]=function(n,r,s){let a;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new xt(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new xt(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+n,l=""+r;if(r=arguments[2],s=arguments[3],a=kr(this,o,l,t),!a)throw new et(`Graph.${e}: could not find an edge for the given path ("${o}" - "${l}").`)}else{if(t!=="mixed")throw new xt(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,a=this._edges.get(n),!a)throw new et(`Graph.${e}: could not find the "${n}" edge in the graph.`)}if(typeof s!="function")throw new ut(`Graph.${e}: updater should be a function.`);return a.attributes[r]=s(a.attributes[r]),this.emit("edgeAttributesUpdated",{key:a.key,type:"set",attributes:a.attributes,name:r}),this}}function hk(i,e,t){i.prototype[e]=function(n,r){let s;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new xt(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new xt(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+n,o=""+r;if(r=arguments[2],s=kr(this,a,o,t),!s)throw new et(`Graph.${e}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(t!=="mixed")throw new xt(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,s=this._edges.get(n),!s)throw new et(`Graph.${e}: could not find the "${n}" edge in the graph.`)}return delete s.attributes[r],this.emit("edgeAttributesUpdated",{key:s.key,type:"remove",attributes:s.attributes,name:r}),this}}function fk(i,e,t){i.prototype[e]=function(n,r){let s;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new xt(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new xt(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+n,o=""+r;if(r=arguments[2],s=kr(this,a,o,t),!s)throw new et(`Graph.${e}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(t!=="mixed")throw new xt(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,s=this._edges.get(n),!s)throw new et(`Graph.${e}: could not find the "${n}" edge in the graph.`)}if(!gi(r))throw new ut(`Graph.${e}: provided attributes are not a plain object.`);return s.attributes=r,this.emit("edgeAttributesUpdated",{key:s.key,type:"replace",attributes:s.attributes}),this}}function dk(i,e,t){i.prototype[e]=function(n,r){let s;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new xt(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new xt(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+n,o=""+r;if(r=arguments[2],s=kr(this,a,o,t),!s)throw new et(`Graph.${e}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(t!=="mixed")throw new xt(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,s=this._edges.get(n),!s)throw new et(`Graph.${e}: could not find the "${n}" edge in the graph.`)}if(!gi(r))throw new ut(`Graph.${e}: provided attributes are not a plain object.`);return ii(s.attributes,r),this.emit("edgeAttributesUpdated",{key:s.key,type:"merge",attributes:s.attributes,data:r}),this}}function pk(i,e,t){i.prototype[e]=function(n,r){let s;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new xt(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new xt(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+n,o=""+r;if(r=arguments[2],s=kr(this,a,o,t),!s)throw new et(`Graph.${e}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(t!=="mixed")throw new xt(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,s=this._edges.get(n),!s)throw new et(`Graph.${e}: could not find the "${n}" edge in the graph.`)}if(typeof r!="function")throw new ut(`Graph.${e}: provided updater is not a function.`);return s.attributes=r(s.attributes),this.emit("edgeAttributesUpdated",{key:s.key,type:"update",attributes:s.attributes}),this}}const mk=[{name:i=>`get${i}Attribute`,attacher:ak},{name:i=>`get${i}Attributes`,attacher:ok},{name:i=>`has${i}Attribute`,attacher:lk},{name:i=>`set${i}Attribute`,attacher:ck},{name:i=>`update${i}Attribute`,attacher:uk},{name:i=>`remove${i}Attribute`,attacher:hk},{name:i=>`replace${i}Attributes`,attacher:fk},{name:i=>`merge${i}Attributes`,attacher:dk},{name:i=>`update${i}Attributes`,attacher:pk}];function gk(i){mk.forEach(function({name:e,attacher:t}){t(i,e("Edge"),"mixed"),t(i,e("DirectedEdge"),"directed"),t(i,e("UndirectedEdge"),"undirected")})}const vk=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function yk(i,e,t,n){let r=!1;for(const s in e){if(s===n)continue;const a=e[s];if(r=t(a.key,a.attributes,a.source.key,a.target.key,a.source.attributes,a.target.attributes,a.undirected),i&&r)return a.key}}function _k(i,e,t,n){let r,s,a,o=!1;for(const l in e)if(l!==n){r=e[l];do{if(s=r.source,a=r.target,o=t(r.key,r.attributes,s.key,a.key,s.attributes,a.attributes,r.undirected),i&&o)return r.key;r=r.next}while(r!==void 0)}}function $y(i,e){const t=Object.keys(i),n=t.length;let r,s=0;return{[Symbol.iterator](){return this},next(){do if(r)r=r.next;else{if(s>=n)return{done:!0};const a=t[s++];if(a===e){r=void 0;continue}r=i[a]}while(!r);return{done:!1,value:{edge:r.key,attributes:r.attributes,source:r.source.key,target:r.target.key,sourceAttributes:r.source.attributes,targetAttributes:r.target.attributes,undirected:r.undirected}}}}}function xk(i,e,t,n){const r=e[t];if(!r)return;const s=r.source,a=r.target;if(n(r.key,r.attributes,s.key,a.key,s.attributes,a.attributes,r.undirected)&&i)return r.key}function bk(i,e,t,n){let r=e[t];if(!r)return;let s=!1;do{if(s=n(r.key,r.attributes,r.source.key,r.target.key,r.source.attributes,r.target.attributes,r.undirected),i&&s)return r.key;r=r.next}while(r!==void 0)}function e_(i,e){let t=i[e];if(t.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!t)return{done:!0};const r={edge:t.key,attributes:t.attributes,source:t.source.key,target:t.target.key,sourceAttributes:t.source.attributes,targetAttributes:t.target.attributes,undirected:t.undirected};return t=t.next,{done:!1,value:r}}};let n=!1;return{[Symbol.iterator](){return this},next(){return n===!0?{done:!0}:(n=!0,{done:!1,value:{edge:t.key,attributes:t.attributes,source:t.source.key,target:t.target.key,sourceAttributes:t.source.attributes,targetAttributes:t.target.attributes,undirected:t.undirected}})}}}function Sk(i,e){if(i.size===0)return[];if(e==="mixed"||e===i.type)return Array.from(i._edges.keys());const t=e==="undirected"?i.undirectedSize:i.directedSize,n=new Array(t),r=e==="undirected",s=i._edges.values();let a=0,o,l;for(;o=s.next(),o.done!==!0;)l=o.value,l.undirected===r&&(n[a++]=l.key);return n}function ZC(i,e,t,n){if(e.size===0)return;const r=t!=="mixed"&&t!==e.type,s=t==="undirected";let a,o,l=!1;const c=e._edges.values();for(;a=c.next(),a.done!==!0;){if(o=a.value,r&&o.undirected!==s)continue;const{key:h,attributes:d,source:p,target:m}=o;if(l=n(h,d,p.key,m.key,p.attributes,m.attributes,o.undirected),i&&l)return h}}function Ek(i,e){if(i.size===0)return Uu();const t=e!=="mixed"&&e!==i.type,n=e==="undirected",r=i._edges.values();return{[Symbol.iterator](){return this},next(){let s,a;for(;;){if(s=r.next(),s.done)return s;if(a=s.value,!(t&&a.undirected!==n))break}return{value:{edge:a.key,attributes:a.attributes,source:a.source.key,target:a.target.key,sourceAttributes:a.source.attributes,targetAttributes:a.target.attributes,undirected:a.undirected},done:!1}}}}function D1(i,e,t,n,r,s){const a=e?_k:yk;let o;if(t!=="undirected"&&(n!=="out"&&(o=a(i,r.in,s),i&&o)||n!=="in"&&(o=a(i,r.out,s,n?void 0:r.key),i&&o))||t!=="directed"&&(o=a(i,r.undirected,s),i&&o))return o}function Mk(i,e,t,n){const r=[];return D1(!1,i,e,t,n,function(s){r.push(s)}),r}function wk(i,e,t){let n=Uu();return i!=="undirected"&&(e!=="out"&&typeof t.in<"u"&&(n=va(n,$y(t.in))),e!=="in"&&typeof t.out<"u"&&(n=va(n,$y(t.out,e?void 0:t.key)))),i!=="directed"&&typeof t.undirected<"u"&&(n=va(n,$y(t.undirected))),n}function U1(i,e,t,n,r,s,a){const o=t?bk:xk;let l;if(e!=="undirected"&&(typeof r.in<"u"&&n!=="out"&&(l=o(i,r.in,s,a),i&&l)||typeof r.out<"u"&&n!=="in"&&(n||r.key!==s)&&(l=o(i,r.out,s,a),i&&l))||e!=="directed"&&typeof r.undirected<"u"&&(l=o(i,r.undirected,s,a),i&&l))return l}function Tk(i,e,t,n,r){const s=[];return U1(!1,i,e,t,n,r,function(a){s.push(a)}),s}function Ak(i,e,t,n){let r=Uu();return i!=="undirected"&&(typeof t.in<"u"&&e!=="out"&&n in t.in&&(r=va(r,e_(t.in,n))),typeof t.out<"u"&&e!=="in"&&n in t.out&&(e||t.key!==n)&&(r=va(r,e_(t.out,n)))),i!=="directed"&&typeof t.undirected<"u"&&n in t.undirected&&(r=va(r,e_(t.undirected,n))),r}function Ck(i,e){const{name:t,type:n,direction:r}=e;i.prototype[t]=function(s,a){if(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)return[];if(!arguments.length)return Sk(this,n);if(arguments.length===1){s=""+s;const o=this._nodes.get(s);if(typeof o>"u")throw new et(`Graph.${t}: could not find the "${s}" node in the graph.`);return Mk(this.multi,n==="mixed"?this.type:n,r,o)}if(arguments.length===2){s=""+s,a=""+a;const o=this._nodes.get(s);if(!o)throw new et(`Graph.${t}: could not find the "${s}" source node in the graph.`);if(!this._nodes.has(a))throw new et(`Graph.${t}: could not find the "${a}" target node in the graph.`);return Tk(n,this.multi,r,o,a)}throw new ut(`Graph.${t}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function Rk(i,e){const{name:t,type:n,direction:r}=e,s="forEach"+t[0].toUpperCase()+t.slice(1,-1);i.prototype[s]=function(c,h,d){if(!(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)){if(arguments.length===1)return d=c,ZC(!1,this,n,d);if(arguments.length===2){c=""+c,d=h;const p=this._nodes.get(c);if(typeof p>"u")throw new et(`Graph.${s}: could not find the "${c}" node in the graph.`);return D1(!1,this.multi,n==="mixed"?this.type:n,r,p,d)}if(arguments.length===3){c=""+c,h=""+h;const p=this._nodes.get(c);if(!p)throw new et(`Graph.${s}: could not find the "${c}" source node in the graph.`);if(!this._nodes.has(h))throw new et(`Graph.${s}: could not find the "${h}" target node in the graph.`);return U1(!1,n,this.multi,r,p,h,d)}throw new ut(`Graph.${s}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};const a="map"+t[0].toUpperCase()+t.slice(1);i.prototype[a]=function(){const c=Array.prototype.slice.call(arguments),h=c.pop();let d;if(c.length===0){let p=0;n!=="directed"&&(p+=this.undirectedSize),n!=="undirected"&&(p+=this.directedSize),d=new Array(p);let m=0;c.push((v,x,_,g,b,E,S)=>{d[m++]=h(v,x,_,g,b,E,S)})}else d=[],c.push((p,m,v,x,_,g,b)=>{d.push(h(p,m,v,x,_,g,b))});return this[s].apply(this,c),d};const o="filter"+t[0].toUpperCase()+t.slice(1);i.prototype[o]=function(){const c=Array.prototype.slice.call(arguments),h=c.pop(),d=[];return c.push((p,m,v,x,_,g,b)=>{h(p,m,v,x,_,g,b)&&d.push(p)}),this[s].apply(this,c),d};const l="reduce"+t[0].toUpperCase()+t.slice(1);i.prototype[l]=function(){let c=Array.prototype.slice.call(arguments);if(c.length<2||c.length>4)throw new ut(`Graph.${l}: invalid number of arguments (expecting 2, 3 or 4 and got ${c.length}).`);if(typeof c[c.length-1]=="function"&&typeof c[c.length-2]!="function")throw new ut(`Graph.${l}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let h,d;c.length===2?(h=c[0],d=c[1],c=[]):c.length===3?(h=c[1],d=c[2],c=[c[0]]):c.length===4&&(h=c[2],d=c[3],c=[c[0],c[1]]);let p=d;return c.push((m,v,x,_,g,b,E)=>{p=h(p,m,v,x,_,g,b,E)}),this[s].apply(this,c),p}}function Dk(i,e){const{name:t,type:n,direction:r}=e,s="find"+t[0].toUpperCase()+t.slice(1,-1);i.prototype[s]=function(l,c,h){if(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)return!1;if(arguments.length===1)return h=l,ZC(!0,this,n,h);if(arguments.length===2){l=""+l,h=c;const d=this._nodes.get(l);if(typeof d>"u")throw new et(`Graph.${s}: could not find the "${l}" node in the graph.`);return D1(!0,this.multi,n==="mixed"?this.type:n,r,d,h)}if(arguments.length===3){l=""+l,c=""+c;const d=this._nodes.get(l);if(!d)throw new et(`Graph.${s}: could not find the "${l}" source node in the graph.`);if(!this._nodes.has(c))throw new et(`Graph.${s}: could not find the "${c}" target node in the graph.`);return U1(!0,n,this.multi,r,d,c,h)}throw new ut(`Graph.${s}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};const a="some"+t[0].toUpperCase()+t.slice(1,-1);i.prototype[a]=function(){const l=Array.prototype.slice.call(arguments),c=l.pop();return l.push((d,p,m,v,x,_,g)=>c(d,p,m,v,x,_,g)),!!this[s].apply(this,l)};const o="every"+t[0].toUpperCase()+t.slice(1,-1);i.prototype[o]=function(){const l=Array.prototype.slice.call(arguments),c=l.pop();return l.push((d,p,m,v,x,_,g)=>!c(d,p,m,v,x,_,g)),!this[s].apply(this,l)}}function Uk(i,e){const{name:t,type:n,direction:r}=e,s=t.slice(0,-1)+"Entries";i.prototype[s]=function(a,o){if(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)return Uu();if(!arguments.length)return Ek(this,n);if(arguments.length===1){a=""+a;const l=this._nodes.get(a);if(!l)throw new et(`Graph.${s}: could not find the "${a}" node in the graph.`);return wk(n,r,l)}if(arguments.length===2){a=""+a,o=""+o;const l=this._nodes.get(a);if(!l)throw new et(`Graph.${s}: could not find the "${a}" source node in the graph.`);if(!this._nodes.has(o))throw new et(`Graph.${s}: could not find the "${o}" target node in the graph.`);return Ak(n,r,l,o)}throw new ut(`Graph.${s}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function Ok(i){vk.forEach(e=>{Ck(i,e),Rk(i,e),Dk(i,e),Uk(i,e)})}const Lk=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function f0(){this.A=null,this.B=null}f0.prototype.wrap=function(i){this.A===null?this.A=i:this.B===null&&(this.B=i)};f0.prototype.has=function(i){return this.A!==null&&i in this.A||this.B!==null&&i in this.B};function Rh(i,e,t,n,r){for(const s in n){const a=n[s],o=a.source,l=a.target,c=o===t?l:o;if(e&&e.has(c.key))continue;const h=r(c.key,c.attributes);if(i&&h)return c.key}}function O1(i,e,t,n,r){if(e!=="mixed"){if(e==="undirected")return Rh(i,null,n,n.undirected,r);if(typeof t=="string")return Rh(i,null,n,n[t],r)}const s=new f0;let a;if(e!=="undirected"){if(t!=="out"){if(a=Rh(i,null,n,n.in,r),i&&a)return a;s.wrap(n.in)}if(t!=="in"){if(a=Rh(i,s,n,n.out,r),i&&a)return a;s.wrap(n.out)}}if(e!=="directed"&&(a=Rh(i,s,n,n.undirected,r),i&&a))return a}function Ik(i,e,t){if(i!=="mixed"){if(i==="undirected")return Object.keys(t.undirected);if(typeof e=="string")return Object.keys(t[e])}const n=[];return O1(!1,i,e,t,function(r){n.push(r)}),n}function Dh(i,e,t){const n=Object.keys(t),r=n.length;let s=0;return{[Symbol.iterator](){return this},next(){let a=null;do{if(s>=r)return i&&i.wrap(t),{done:!0};const o=t[n[s++]],l=o.source,c=o.target;if(a=l===e?c:l,i&&i.has(a.key)){a=null;continue}}while(a===null);return{done:!1,value:{neighbor:a.key,attributes:a.attributes}}}}}function Nk(i,e,t){if(i!=="mixed"){if(i==="undirected")return Dh(null,t,t.undirected);if(typeof e=="string")return Dh(null,t,t[e])}let n=Uu();const r=new f0;return i!=="undirected"&&(e!=="out"&&(n=va(n,Dh(r,t,t.in))),e!=="in"&&(n=va(n,Dh(r,t,t.out)))),i!=="directed"&&(n=va(n,Dh(r,t,t.undirected))),n}function Pk(i,e){const{name:t,type:n,direction:r}=e;i.prototype[t]=function(s){if(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)return[];s=""+s;const a=this._nodes.get(s);if(typeof a>"u")throw new et(`Graph.${t}: could not find the "${s}" node in the graph.`);return Ik(n==="mixed"?this.type:n,r,a)}}function zk(i,e){const{name:t,type:n,direction:r}=e,s="forEach"+t[0].toUpperCase()+t.slice(1,-1);i.prototype[s]=function(c,h){if(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)return;c=""+c;const d=this._nodes.get(c);if(typeof d>"u")throw new et(`Graph.${s}: could not find the "${c}" node in the graph.`);O1(!1,n==="mixed"?this.type:n,r,d,h)};const a="map"+t[0].toUpperCase()+t.slice(1);i.prototype[a]=function(c,h){const d=[];return this[s](c,(p,m)=>{d.push(h(p,m))}),d};const o="filter"+t[0].toUpperCase()+t.slice(1);i.prototype[o]=function(c,h){const d=[];return this[s](c,(p,m)=>{h(p,m)&&d.push(p)}),d};const l="reduce"+t[0].toUpperCase()+t.slice(1);i.prototype[l]=function(c,h,d){if(arguments.length<3)throw new ut(`Graph.${l}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let p=d;return this[s](c,(m,v)=>{p=h(p,m,v)}),p}}function Fk(i,e){const{name:t,type:n,direction:r}=e,s=t[0].toUpperCase()+t.slice(1,-1),a="find"+s;i.prototype[a]=function(c,h){if(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)return;c=""+c;const d=this._nodes.get(c);if(typeof d>"u")throw new et(`Graph.${a}: could not find the "${c}" node in the graph.`);return O1(!0,n==="mixed"?this.type:n,r,d,h)};const o="some"+s;i.prototype[o]=function(c,h){return!!this[a](c,h)};const l="every"+s;i.prototype[l]=function(c,h){return!this[a](c,(p,m)=>!h(p,m))}}function Bk(i,e){const{name:t,type:n,direction:r}=e,s=t.slice(0,-1)+"Entries";i.prototype[s]=function(a){if(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)return Uu();a=""+a;const o=this._nodes.get(a);if(typeof o>"u")throw new et(`Graph.${s}: could not find the "${a}" node in the graph.`);return Nk(n==="mixed"?this.type:n,r,o)}}function kk(i){Lk.forEach(e=>{Pk(i,e),zk(i,e),Fk(i,e),Bk(i,e)})}function Xp(i,e,t,n,r){const s=n._nodes.values(),a=n.type;let o,l,c,h,d,p;for(;o=s.next(),o.done!==!0;){let m=!1;if(l=o.value,a!=="undirected"){h=l.out;for(c in h){d=h[c];do p=d.target,m=!0,r(l.key,p.key,l.attributes,p.attributes,d.key,d.attributes,d.undirected),d=d.next;while(d)}}if(a!=="directed"){h=l.undirected;for(c in h)if(!(e&&l.key>c)){d=h[c];do p=d.target,p.key!==c&&(p=d.source),m=!0,r(l.key,p.key,l.attributes,p.attributes,d.key,d.attributes,d.undirected),d=d.next;while(d)}}t&&!m&&r(l.key,null,l.attributes,null,null,null,null)}}function Gk(i,e){const t={key:i};return HC(e.attributes)||(t.attributes=ii({},e.attributes)),t}function Hk(i,e,t){const n={key:e,source:t.source.key,target:t.target.key};return HC(t.attributes)||(n.attributes=ii({},t.attributes)),i==="mixed"&&t.undirected&&(n.undirected=!0),n}function Vk(i){if(!gi(i))throw new ut('Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if(!("key"in i))throw new ut("Graph.import: serialized node is missing its key.");if("attributes"in i&&(!gi(i.attributes)||i.attributes===null))throw new ut("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function Wk(i){if(!gi(i))throw new ut('Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if(!("source"in i))throw new ut("Graph.import: serialized edge is missing its source.");if(!("target"in i))throw new ut("Graph.import: serialized edge is missing its target.");if("attributes"in i&&(!gi(i.attributes)||i.attributes===null))throw new ut("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in i&&typeof i.undirected!="boolean")throw new ut("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}const Xk=q5(),jk=new Set(["directed","undirected","mixed"]),tw=new Set(["domain","_events","_eventsCount","_maxListeners"]),qk=[{name:i=>`${i}Edge`,generateKey:!0},{name:i=>`${i}DirectedEdge`,generateKey:!0,type:"directed"},{name:i=>`${i}UndirectedEdge`,generateKey:!0,type:"undirected"},{name:i=>`${i}EdgeWithKey`},{name:i=>`${i}DirectedEdgeWithKey`,type:"directed"},{name:i=>`${i}UndirectedEdgeWithKey`,type:"undirected"}],Yk={allowSelfLoops:!0,multi:!1,type:"mixed"};function Zk(i,e,t){if(t&&!gi(t))throw new ut(`Graph.addNode: invalid attributes. Expecting an object but got "${t}"`);if(e=""+e,t=t||{},i._nodes.has(e))throw new xt(`Graph.addNode: the "${e}" node already exist in the graph.`);const n=new i.NodeDataClass(e,t);return i._nodes.set(e,n),i.emit("nodeAdded",{key:e,attributes:t}),n}function nw(i,e,t){const n=new i.NodeDataClass(e,t);return i._nodes.set(e,n),i.emit("nodeAdded",{key:e,attributes:t}),n}function KC(i,e,t,n,r,s,a,o){if(!n&&i.type==="undirected")throw new xt(`Graph.${e}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(n&&i.type==="directed")throw new xt(`Graph.${e}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(o&&!gi(o))throw new ut(`Graph.${e}: invalid attributes. Expecting an object but got "${o}"`);if(s=""+s,a=""+a,o=o||{},!i.allowSelfLoops&&s===a)throw new xt(`Graph.${e}: source & target are the same ("${s}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);const l=i._nodes.get(s),c=i._nodes.get(a);if(!l)throw new et(`Graph.${e}: source node "${s}" not found.`);if(!c)throw new et(`Graph.${e}: target node "${a}" not found.`);const h={key:null,undirected:n,source:s,target:a,attributes:o};if(t)r=i._edgeKeyGenerator();else if(r=""+r,i._edges.has(r))throw new xt(`Graph.${e}: the "${r}" edge already exists in the graph.`);if(!i.multi&&(n?typeof l.undirected[a]<"u":typeof l.out[a]<"u"))throw new xt(`Graph.${e}: an edge linking "${s}" to "${a}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);const d=new Ou(n,r,l,c,o);i._edges.set(r,d);const p=s===a;return n?(l.undirectedDegree++,c.undirectedDegree++,p&&(l.undirectedLoops++,i._undirectedSelfLoopCount++)):(l.outDegree++,c.inDegree++,p&&(l.directedLoops++,i._directedSelfLoopCount++)),i.multi?d.attachMulti():d.attach(),n?i._undirectedSize++:i._directedSize++,h.key=r,i.emit("edgeAdded",h),r}function Kk(i,e,t,n,r,s,a,o,l){if(!n&&i.type==="undirected")throw new xt(`Graph.${e}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(n&&i.type==="directed")throw new xt(`Graph.${e}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(o){if(l){if(typeof o!="function")throw new ut(`Graph.${e}: invalid updater function. Expecting a function but got "${o}"`)}else if(!gi(o))throw new ut(`Graph.${e}: invalid attributes. Expecting an object but got "${o}"`)}s=""+s,a=""+a;let c;if(l&&(c=o,o=void 0),!i.allowSelfLoops&&s===a)throw new xt(`Graph.${e}: source & target are the same ("${s}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let h=i._nodes.get(s),d=i._nodes.get(a),p,m;if(!t&&(p=i._edges.get(r),p)){if((p.source.key!==s||p.target.key!==a)&&(!n||p.source.key!==a||p.target.key!==s))throw new xt(`Graph.${e}: inconsistency detected when attempting to merge the "${r}" edge with "${s}" source & "${a}" target vs. ("${p.source.key}", "${p.target.key}").`);m=p}if(!m&&!i.multi&&h&&(m=n?h.undirected[a]:h.out[a]),m){const b=[m.key,!1,!1,!1];if(l?!c:!o)return b;if(l){const E=m.attributes;m.attributes=c(E),i.emit("edgeAttributesUpdated",{type:"replace",key:m.key,attributes:m.attributes})}else ii(m.attributes,o),i.emit("edgeAttributesUpdated",{type:"merge",key:m.key,attributes:m.attributes,data:o});return b}o=o||{},l&&c&&(o=c(o));const v={key:null,undirected:n,source:s,target:a,attributes:o};if(t)r=i._edgeKeyGenerator();else if(r=""+r,i._edges.has(r))throw new xt(`Graph.${e}: the "${r}" edge already exists in the graph.`);let x=!1,_=!1;h||(h=nw(i,s,{}),x=!0,s===a&&(d=h,_=!0)),d||(d=nw(i,a,{}),_=!0),p=new Ou(n,r,h,d,o),i._edges.set(r,p);const g=s===a;return n?(h.undirectedDegree++,d.undirectedDegree++,g&&(h.undirectedLoops++,i._undirectedSelfLoopCount++)):(h.outDegree++,d.inDegree++,g&&(h.directedLoops++,i._directedSelfLoopCount++)),i.multi?p.attachMulti():p.attach(),n?i._undirectedSize++:i._directedSize++,v.key=r,i.emit("edgeAdded",v),[r,!0,x,_]}function Wc(i,e){i._edges.delete(e.key);const{source:t,target:n,attributes:r}=e,s=e.undirected,a=t===n;s?(t.undirectedDegree--,n.undirectedDegree--,a&&(t.undirectedLoops--,i._undirectedSelfLoopCount--)):(t.outDegree--,n.inDegree--,a&&(t.directedLoops--,i._directedSelfLoopCount--)),i.multi?e.detachMulti():e.detach(),s?i._undirectedSize--:i._directedSize--,i.emit("edgeDropped",{key:e.key,attributes:r,source:t.key,target:n.key,undirected:s})}class un extends X5.EventEmitter{constructor(e){if(super(),e=ii({},Yk,e),typeof e.multi!="boolean")throw new ut(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${e.multi}".`);if(!jk.has(e.type))throw new ut(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${e.type}".`);if(typeof e.allowSelfLoops!="boolean")throw new ut(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${e.allowSelfLoops}".`);const t=e.type==="mixed"?VC:e.type==="directed"?WC:XC;Or(this,"NodeDataClass",t);const n="geid_"+Xk()+"_";let r=0;const s=()=>{let a;do a=n+r++;while(this._edges.has(a));return a};Or(this,"_attributes",{}),Or(this,"_nodes",new Map),Or(this,"_edges",new Map),Or(this,"_directedSize",0),Or(this,"_undirectedSize",0),Or(this,"_directedSelfLoopCount",0),Or(this,"_undirectedSelfLoopCount",0),Or(this,"_edgeKeyGenerator",s),Or(this,"_options",e),tw.forEach(a=>Or(this,a,this[a])),$r(this,"order",()=>this._nodes.size),$r(this,"size",()=>this._edges.size),$r(this,"directedSize",()=>this._directedSize),$r(this,"undirectedSize",()=>this._undirectedSize),$r(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),$r(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),$r(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),$r(this,"multi",this._options.multi),$r(this,"type",this._options.type),$r(this,"allowSelfLoops",this._options.allowSelfLoops),$r(this,"implementation",()=>"graphology")}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(e){return this._nodes.has(""+e)}hasDirectedEdge(e,t){if(this.type==="undirected")return!1;if(arguments.length===1){const n=""+e,r=this._edges.get(n);return!!r&&!r.undirected}else if(arguments.length===2){e=""+e,t=""+t;const n=this._nodes.get(e);return n?n.out.hasOwnProperty(t):!1}throw new ut(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(e,t){if(this.type==="directed")return!1;if(arguments.length===1){const n=""+e,r=this._edges.get(n);return!!r&&r.undirected}else if(arguments.length===2){e=""+e,t=""+t;const n=this._nodes.get(e);return n?n.undirected.hasOwnProperty(t):!1}throw new ut(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(e,t){if(arguments.length===1){const n=""+e;return this._edges.has(n)}else if(arguments.length===2){e=""+e,t=""+t;const n=this._nodes.get(e);return n?typeof n.out<"u"&&n.out.hasOwnProperty(t)||typeof n.undirected<"u"&&n.undirected.hasOwnProperty(t):!1}throw new ut(`Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}directedEdge(e,t){if(this.type==="undirected")return;if(e=""+e,t=""+t,this.multi)throw new xt("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");const n=this._nodes.get(e);if(!n)throw new et(`Graph.directedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new et(`Graph.directedEdge: could not find the "${t}" target node in the graph.`);const r=n.out&&n.out[t]||void 0;if(r)return r.key}undirectedEdge(e,t){if(this.type==="directed")return;if(e=""+e,t=""+t,this.multi)throw new xt("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");const n=this._nodes.get(e);if(!n)throw new et(`Graph.undirectedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new et(`Graph.undirectedEdge: could not find the "${t}" target node in the graph.`);const r=n.undirected&&n.undirected[t]||void 0;if(r)return r.key}edge(e,t){if(this.multi)throw new xt("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new et(`Graph.edge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new et(`Graph.edge: could not find the "${t}" target node in the graph.`);const r=n.out&&n.out[t]||n.undirected&&n.undirected[t]||void 0;if(r)return r.key}areDirectedNeighbors(e,t){e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new et(`Graph.areDirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type==="undirected"?!1:t in n.in||t in n.out}areOutNeighbors(e,t){e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new et(`Graph.areOutNeighbors: could not find the "${e}" node in the graph.`);return this.type==="undirected"?!1:t in n.out}areInNeighbors(e,t){e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new et(`Graph.areInNeighbors: could not find the "${e}" node in the graph.`);return this.type==="undirected"?!1:t in n.in}areUndirectedNeighbors(e,t){e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new et(`Graph.areUndirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type==="directed"?!1:t in n.undirected}areNeighbors(e,t){e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new et(`Graph.areNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&(t in n.in||t in n.out)||this.type!=="directed"&&t in n.undirected}areInboundNeighbors(e,t){e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new et(`Graph.areInboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&t in n.in||this.type!=="directed"&&t in n.undirected}areOutboundNeighbors(e,t){e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new et(`Graph.areOutboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&t in n.out||this.type!=="directed"&&t in n.undirected}inDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new et(`Graph.inDegree: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.inDegree}outDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new et(`Graph.outDegree: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.outDegree}directedDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new et(`Graph.directedDegree: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.inDegree+t.outDegree}undirectedDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new et(`Graph.undirectedDegree: could not find the "${e}" node in the graph.`);return this.type==="directed"?0:t.undirectedDegree}inboundDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new et(`Graph.inboundDegree: could not find the "${e}" node in the graph.`);let n=0;return this.type!=="directed"&&(n+=t.undirectedDegree),this.type!=="undirected"&&(n+=t.inDegree),n}outboundDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new et(`Graph.outboundDegree: could not find the "${e}" node in the graph.`);let n=0;return this.type!=="directed"&&(n+=t.undirectedDegree),this.type!=="undirected"&&(n+=t.outDegree),n}degree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new et(`Graph.degree: could not find the "${e}" node in the graph.`);let n=0;return this.type!=="directed"&&(n+=t.undirectedDegree),this.type!=="undirected"&&(n+=t.inDegree+t.outDegree),n}inDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new et(`Graph.inDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.inDegree-t.directedLoops}outDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new et(`Graph.outDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.outDegree-t.directedLoops}directedDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new et(`Graph.directedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.inDegree+t.outDegree-t.directedLoops*2}undirectedDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new et(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="directed"?0:t.undirectedDegree-t.undirectedLoops*2}inboundDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new et(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,r=0;return this.type!=="directed"&&(n+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!=="undirected"&&(n+=t.inDegree,r+=t.directedLoops),n-r}outboundDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new et(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,r=0;return this.type!=="directed"&&(n+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!=="undirected"&&(n+=t.outDegree,r+=t.directedLoops),n-r}degreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new et(`Graph.degreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,r=0;return this.type!=="directed"&&(n+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!=="undirected"&&(n+=t.inDegree+t.outDegree,r+=t.directedLoops*2),n-r}source(e){e=""+e;const t=this._edges.get(e);if(!t)throw new et(`Graph.source: could not find the "${e}" edge in the graph.`);return t.source.key}target(e){e=""+e;const t=this._edges.get(e);if(!t)throw new et(`Graph.target: could not find the "${e}" edge in the graph.`);return t.target.key}extremities(e){e=""+e;const t=this._edges.get(e);if(!t)throw new et(`Graph.extremities: could not find the "${e}" edge in the graph.`);return[t.source.key,t.target.key]}opposite(e,t){e=""+e,t=""+t;const n=this._edges.get(t);if(!n)throw new et(`Graph.opposite: could not find the "${t}" edge in the graph.`);const r=n.source.key,s=n.target.key;if(e===r)return s;if(e===s)return r;throw new et(`Graph.opposite: the "${e}" node is not attached to the "${t}" edge (${r}, ${s}).`)}hasExtremity(e,t){e=""+e,t=""+t;const n=this._edges.get(e);if(!n)throw new et(`Graph.hasExtremity: could not find the "${e}" edge in the graph.`);return n.source.key===t||n.target.key===t}isUndirected(e){e=""+e;const t=this._edges.get(e);if(!t)throw new et(`Graph.isUndirected: could not find the "${e}" edge in the graph.`);return t.undirected}isDirected(e){e=""+e;const t=this._edges.get(e);if(!t)throw new et(`Graph.isDirected: could not find the "${e}" edge in the graph.`);return!t.undirected}isSelfLoop(e){e=""+e;const t=this._edges.get(e);if(!t)throw new et(`Graph.isSelfLoop: could not find the "${e}" edge in the graph.`);return t.source===t.target}addNode(e,t){return Zk(this,e,t).key}mergeNode(e,t){if(t&&!gi(t))throw new ut(`Graph.mergeNode: invalid attributes. Expecting an object but got "${t}"`);e=""+e,t=t||{};let n=this._nodes.get(e);return n?(t&&(ii(n.attributes,t),this.emit("nodeAttributesUpdated",{type:"merge",key:e,attributes:n.attributes,data:t})),[e,!1]):(n=new this.NodeDataClass(e,t),this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:t}),[e,!0])}updateNode(e,t){if(t&&typeof t!="function")throw new ut(`Graph.updateNode: invalid updater function. Expecting a function but got "${t}"`);e=""+e;let n=this._nodes.get(e);if(n){if(t){const s=n.attributes;n.attributes=t(s),this.emit("nodeAttributesUpdated",{type:"replace",key:e,attributes:n.attributes})}return[e,!1]}const r=t?t({}):{};return n=new this.NodeDataClass(e,r),this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:r}),[e,!0]}dropNode(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new et(`Graph.dropNode: could not find the "${e}" node in the graph.`);let n;if(this.type!=="undirected"){for(const r in t.out){n=t.out[r];do Wc(this,n),n=n.next;while(n)}for(const r in t.in){n=t.in[r];do Wc(this,n),n=n.next;while(n)}}if(this.type!=="directed")for(const r in t.undirected){n=t.undirected[r];do Wc(this,n),n=n.next;while(n)}this._nodes.delete(e),this.emit("nodeDropped",{key:e,attributes:t.attributes})}dropEdge(e){let t;if(arguments.length>1){const n=""+arguments[0],r=""+arguments[1];if(t=kr(this,n,r,this.type),!t)throw new et(`Graph.dropEdge: could not find the "${n}" -> "${r}" edge in the graph.`)}else if(e=""+e,t=this._edges.get(e),!t)throw new et(`Graph.dropEdge: could not find the "${e}" edge in the graph.`);return Wc(this,t),this}dropDirectedEdge(e,t){if(arguments.length<2)throw new xt("Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new xt("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");e=""+e,t=""+t;const n=kr(this,e,t,"directed");if(!n)throw new et(`Graph.dropDirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return Wc(this,n),this}dropUndirectedEdge(e,t){if(arguments.length<2)throw new xt("Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new xt("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");const n=kr(this,e,t,"undirected");if(!n)throw new et(`Graph.dropUndirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return Wc(this,n),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")}clearEdges(){const e=this._nodes.values();let t;for(;t=e.next(),t.done!==!0;)t.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")}getAttribute(e){return this._attributes[e]}getAttributes(){return this._attributes}hasAttribute(e){return this._attributes.hasOwnProperty(e)}setAttribute(e,t){return this._attributes[e]=t,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this}updateAttribute(e,t){if(typeof t!="function")throw new ut("Graph.updateAttribute: updater should be a function.");const n=this._attributes[e];return this._attributes[e]=t(n),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this}removeAttribute(e){return delete this._attributes[e],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:e}),this}replaceAttributes(e){if(!gi(e))throw new ut("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=e,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this}mergeAttributes(e){if(!gi(e))throw new ut("Graph.mergeAttributes: provided attributes are not a plain object.");return ii(this._attributes,e),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:e}),this}updateAttributes(e){if(typeof e!="function")throw new ut("Graph.updateAttributes: provided updater is not a function.");return this._attributes=e(this._attributes),this.emit("attributesUpdated",{type:"update",attributes:this._attributes}),this}updateEachNodeAttributes(e,t){if(typeof e!="function")throw new ut("Graph.updateEachNodeAttributes: expecting an updater function.");if(t&&!ew(t))throw new ut("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const n=this._nodes.values();let r,s;for(;r=n.next(),r.done!==!0;)s=r.value,s.attributes=e(s.key,s.attributes);this.emit("eachNodeAttributesUpdated",{hints:t||null})}updateEachEdgeAttributes(e,t){if(typeof e!="function")throw new ut("Graph.updateEachEdgeAttributes: expecting an updater function.");if(t&&!ew(t))throw new ut("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const n=this._edges.values();let r,s,a,o;for(;r=n.next(),r.done!==!0;)s=r.value,a=s.source,o=s.target,s.attributes=e(s.key,s.attributes,a.key,o.key,a.attributes,o.attributes,s.undirected);this.emit("eachEdgeAttributesUpdated",{hints:t||null})}forEachAdjacencyEntry(e){if(typeof e!="function")throw new ut("Graph.forEachAdjacencyEntry: expecting a callback.");Xp(!1,!1,!1,this,e)}forEachAdjacencyEntryWithOrphans(e){if(typeof e!="function")throw new ut("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");Xp(!1,!1,!0,this,e)}forEachAssymetricAdjacencyEntry(e){if(typeof e!="function")throw new ut("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");Xp(!1,!0,!1,this,e)}forEachAssymetricAdjacencyEntryWithOrphans(e){if(typeof e!="function")throw new ut("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");Xp(!1,!0,!0,this,e)}nodes(){return Array.from(this._nodes.keys())}forEachNode(e){if(typeof e!="function")throw new ut("Graph.forEachNode: expecting a callback.");const t=this._nodes.values();let n,r;for(;n=t.next(),n.done!==!0;)r=n.value,e(r.key,r.attributes)}findNode(e){if(typeof e!="function")throw new ut("Graph.findNode: expecting a callback.");const t=this._nodes.values();let n,r;for(;n=t.next(),n.done!==!0;)if(r=n.value,e(r.key,r.attributes))return r.key}mapNodes(e){if(typeof e!="function")throw new ut("Graph.mapNode: expecting a callback.");const t=this._nodes.values();let n,r;const s=new Array(this.order);let a=0;for(;n=t.next(),n.done!==!0;)r=n.value,s[a++]=e(r.key,r.attributes);return s}someNode(e){if(typeof e!="function")throw new ut("Graph.someNode: expecting a callback.");const t=this._nodes.values();let n,r;for(;n=t.next(),n.done!==!0;)if(r=n.value,e(r.key,r.attributes))return!0;return!1}everyNode(e){if(typeof e!="function")throw new ut("Graph.everyNode: expecting a callback.");const t=this._nodes.values();let n,r;for(;n=t.next(),n.done!==!0;)if(r=n.value,!e(r.key,r.attributes))return!1;return!0}filterNodes(e){if(typeof e!="function")throw new ut("Graph.filterNodes: expecting a callback.");const t=this._nodes.values();let n,r;const s=[];for(;n=t.next(),n.done!==!0;)r=n.value,e(r.key,r.attributes)&&s.push(r.key);return s}reduceNodes(e,t){if(typeof e!="function")throw new ut("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new ut("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");let n=t;const r=this._nodes.values();let s,a;for(;s=r.next(),s.done!==!0;)a=s.value,n=e(n,a.key,a.attributes);return n}nodeEntries(){const e=this._nodes.values();return{[Symbol.iterator](){return this},next(){const t=e.next();if(t.done)return t;const n=t.value;return{value:{node:n.key,attributes:n.attributes},done:!1}}}}export(){const e=new Array(this._nodes.size);let t=0;this._nodes.forEach((r,s)=>{e[t++]=Gk(s,r)});const n=new Array(this._edges.size);return t=0,this._edges.forEach((r,s)=>{n[t++]=Hk(this.type,s,r)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:e,edges:n}}import(e,t=!1){if(e instanceof un)return e.forEachNode((l,c)=>{t?this.mergeNode(l,c):this.addNode(l,c)}),e.forEachEdge((l,c,h,d,p,m,v)=>{t?v?this.mergeUndirectedEdgeWithKey(l,h,d,c):this.mergeDirectedEdgeWithKey(l,h,d,c):v?this.addUndirectedEdgeWithKey(l,h,d,c):this.addDirectedEdgeWithKey(l,h,d,c)}),this;if(!gi(e))throw new ut("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(e.attributes){if(!gi(e.attributes))throw new ut("Graph.import: invalid attributes. Expecting a plain object.");t?this.mergeAttributes(e.attributes):this.replaceAttributes(e.attributes)}let n,r,s,a,o;if(e.nodes){if(s=e.nodes,!Array.isArray(s))throw new ut("Graph.import: invalid nodes. Expecting an array.");for(n=0,r=s.length;n<r;n++){a=s[n],Vk(a);const{key:l,attributes:c}=a;t?this.mergeNode(l,c):this.addNode(l,c)}}if(e.edges){let l=!1;if(this.type==="undirected"&&(l=!0),s=e.edges,!Array.isArray(s))throw new ut("Graph.import: invalid edges. Expecting an array.");for(n=0,r=s.length;n<r;n++){o=s[n],Wk(o);const{source:c,target:h,attributes:d,undirected:p=l}=o;let m;"key"in o?(m=t?p?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:p?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey,m.call(this,o.key,c,h,d)):(m=t?p?this.mergeUndirectedEdge:this.mergeDirectedEdge:p?this.addUndirectedEdge:this.addDirectedEdge,m.call(this,c,h,d))}}return this}nullCopy(e){const t=new un(ii({},this._options,e));return t.replaceAttributes(ii({},this.getAttributes())),t}emptyCopy(e){const t=this.nullCopy(e);return this._nodes.forEach((n,r)=>{const s=ii({},n.attributes);n=new t.NodeDataClass(r,s),t._nodes.set(r,n)}),t}copy(e){if(e=e||{},typeof e.type=="string"&&e.type!==this.type&&e.type!=="mixed")throw new xt(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${e.type}" because this would mean losing information about the current graph.`);if(typeof e.multi=="boolean"&&e.multi!==this.multi&&e.multi!==!0)throw new xt("Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.");if(typeof e.allowSelfLoops=="boolean"&&e.allowSelfLoops!==this.allowSelfLoops&&e.allowSelfLoops!==!0)throw new xt("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");const t=this.emptyCopy(e),n=this._edges.values();let r,s;for(;r=n.next(),r.done!==!0;)s=r.value,KC(t,"copy",!1,s.undirected,s.key,s.source.key,s.target.key,ii({},s.attributes));return t}toJSON(){return this.export()}toString(){return"[object Graph]"}inspect(){const e={};this._nodes.forEach((s,a)=>{e[a]=s.attributes});const t={},n={};this._edges.forEach((s,a)=>{const o=s.undirected?"--":"->";let l="",c=s.source.key,h=s.target.key,d;s.undirected&&c>h&&(d=c,c=h,h=d);const p=`(${c})${o}(${h})`;a.startsWith("geid_")?this.multi&&(typeof n[p]>"u"?n[p]=0:n[p]++,l+=`${n[p]}. `):l+=`[${a}]: `,l+=p,t[l]=s.attributes});const r={};for(const s in this)this.hasOwnProperty(s)&&!tw.has(s)&&typeof this[s]!="function"&&typeof s!="symbol"&&(r[s]=this[s]);return r.attributes=this._attributes,r.nodes=e,r.edges=t,Or(r,"constructor",this.constructor),r}}typeof Symbol<"u"&&(un.prototype[Symbol.for("nodejs.util.inspect.custom")]=un.prototype.inspect);qk.forEach(i=>{["add","merge","update"].forEach(e=>{const t=i.name(e),n=e==="add"?KC:Kk;i.generateKey?un.prototype[t]=function(r,s,a){return n(this,t,!0,(i.type||this.type)==="undirected",null,r,s,a,e==="update")}:un.prototype[t]=function(r,s,a,o){return n(this,t,!1,(i.type||this.type)==="undirected",r,s,a,o,e==="update")}})});sk(un);gk(un);Ok(un);kk(un);class JC extends un{constructor(e){const t=ii({type:"directed"},e);if("multi"in t&&t.multi!==!1)throw new ut("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(t.type!=="directed")throw new ut('DirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}class QC extends un{constructor(e){const t=ii({type:"undirected"},e);if("multi"in t&&t.multi!==!1)throw new ut("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(t.type!=="undirected")throw new ut('UndirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}class $C extends un{constructor(e){const t=ii({multi:!0},e);if("multi"in t&&t.multi!==!0)throw new ut("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");super(t)}}class eR extends un{constructor(e){const t=ii({type:"directed",multi:!0},e);if("multi"in t&&t.multi!==!0)throw new ut("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(t.type!=="directed")throw new ut('MultiDirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}class tR extends un{constructor(e){const t=ii({type:"undirected",multi:!0},e);if("multi"in t&&t.multi!==!0)throw new ut("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(t.type!=="undirected")throw new ut('MultiUndirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}function Lu(i){i.from=function(e,t){const n=ii({},e.options,t),r=new i(n);return r.import(e),r}}Lu(un);Lu(JC);Lu(QC);Lu($C);Lu(eR);Lu(tR);un.Graph=un;un.DirectedGraph=JC;un.UndirectedGraph=QC;un.MultiGraph=$C;un.MultiDirectedGraph=eR;un.MultiUndirectedGraph=tR;un.InvalidArgumentsGraphError=ut;un.NotFoundGraphError=et;un.UsageGraphError=xt;const iw=i=>{let e;const t=new Set,n=(c,h)=>{const d=typeof c=="function"?c(e):c;if(!Object.is(d,e)){const p=e;e=h??(typeof d!="object"||d===null)?d:Object.assign({},e,d),t.forEach(m=>m(e,p))}},r=()=>e,o={setState:n,getState:r,getInitialState:()=>l,subscribe:c=>(t.add(c),()=>t.delete(c))},l=e=i(n,r,o);return o},Jk=(i=>i?iw(i):iw),Qk=i=>i;function nR(i,e=Qk){const t=Ms.useSyncExternalStore(i.subscribe,Ms.useCallback(()=>e(i.getState()),[i,e]),Ms.useCallback(()=>e(i.getInitialState()),[i,e]));return Ms.useDebugValue(t),t}const rw=i=>{const e=Jk(i),t=n=>nR(e,n);return Object.assign(t,e),t},$k=(i=>i?rw(i):rw),sw=i=>Symbol.iterator in i,aw=i=>"entries"in i,ow=(i,e)=>{const t=i instanceof Map?i:new Map(i.entries()),n=e instanceof Map?e:new Map(e.entries());if(t.size!==n.size)return!1;for(const[r,s]of t)if(!n.has(r)||!Object.is(s,n.get(r)))return!1;return!0},eG=(i,e)=>{const t=i[Symbol.iterator](),n=e[Symbol.iterator]();let r=t.next(),s=n.next();for(;!r.done&&!s.done;){if(!Object.is(r.value,s.value))return!1;r=t.next(),s=n.next()}return!!r.done&&!!s.done};function tG(i,e){return Object.is(i,e)?!0:typeof i!="object"||i===null||typeof e!="object"||e===null||Object.getPrototypeOf(i)!==Object.getPrototypeOf(e)?!1:sw(i)&&sw(e)?aw(i)&&aw(e)?ow(i,e):eG(i,e):ow({entries:()=>Object.entries(i)},{entries:()=>Object.entries(e)})}function nG(i){const e=Ms.useRef(void 0);return t=>{const n=i(t);return tG(e.current,n)?e.current:e.current=n}}const Jh=(i,e)=>{const t=i[0].index!==null,n=new Set(Object.keys(i[0].attributes)),r=new Set(Object.keys(i[0].morphAttributes)),s={},a={},o=i[0].morphTargetsRelative,l=new Rt;let c=0;if(i.forEach((h,d)=>{let p=0;if(t!==(h.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+d+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(let m in h.attributes){if(!n.has(m))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+d+'. All geometries must have compatible attributes; make sure "'+m+'" attribute exists among all geometries, or in none of them.'),null;s[m]===void 0&&(s[m]=[]),s[m].push(h.attributes[m]),p++}if(p!==n.size)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+d+". Make sure all geometries have the same number of attributes."),null;if(o!==h.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+d+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(let m in h.morphAttributes){if(!r.has(m))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+d+". .morphAttributes must be consistent throughout all geometries."),null;a[m]===void 0&&(a[m]=[]),a[m].push(h.morphAttributes[m])}if(l.userData.mergedUserData=l.userData.mergedUserData||[],l.userData.mergedUserData.push(h.userData),e){let m;if(h.index)m=h.index.count;else if(h.attributes.position!==void 0)m=h.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+d+". The geometry must have either an index or a position attribute"),null;l.addGroup(c,m,d),c+=m}}),t){let h=0;const d=[];i.forEach(p=>{const m=p.index;for(let v=0;v<m.count;++v)d.push(m.getX(v)+h);h+=p.attributes.position.count}),l.setIndex(d)}for(let h in s){const d=lw(s[h]);if(!d)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+h+" attribute."),null;l.setAttribute(h,d)}for(let h in a){const d=a[h][0].length;if(d===0)break;l.morphAttributes=l.morphAttributes||{},l.morphAttributes[h]=[];for(let p=0;p<d;++p){const m=[];for(let x=0;x<a[h].length;++x)m.push(a[h][x][p]);const v=lw(m);if(!v)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+h+" morphAttribute."),null;l.morphAttributes[h].push(v)}}return l},lw=i=>{let e,t,n,r=0;if(i.forEach(s=>{if(e===void 0&&(e=s.array.constructor),e!==s.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(t===void 0&&(t=s.itemSize),t!==s.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(n===void 0&&(n=s.normalized),n!==s.normalized)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;r+=s.array.length}),e&&t){const s=new e(r);let a=0;return i.forEach(o=>{s.set(o.array,a),a+=o.array.length}),new $t(s,t,n)}};function iG(i,e=Math.PI/3){const t=Math.cos(e),n=(1+1e-10)*100,r=[new j,new j,new j],s=new j,a=new j,o=new j,l=new j;function c(x){const _=~~(x.x*n),g=~~(x.y*n),b=~~(x.z*n);return`${_},${g},${b}`}const h=i.index?i.toNonIndexed():i,d=h.attributes.position,p={};for(let x=0,_=d.count/3;x<_;x++){const g=3*x,b=r[0].fromBufferAttribute(d,g+0),E=r[1].fromBufferAttribute(d,g+1),S=r[2].fromBufferAttribute(d,g+2);s.subVectors(S,E),a.subVectors(b,E);const w=new j().crossVectors(s,a).normalize();for(let T=0;T<3;T++){const R=r[T],U=c(R);U in p||(p[U]=[]),p[U].push(w)}}const m=new Float32Array(d.count*3),v=new $t(m,3,!1);for(let x=0,_=d.count/3;x<_;x++){const g=3*x,b=r[0].fromBufferAttribute(d,g+0),E=r[1].fromBufferAttribute(d,g+1),S=r[2].fromBufferAttribute(d,g+2);s.subVectors(S,E),a.subVectors(b,E),o.crossVectors(s,a).normalize();for(let w=0;w<3;w++){const T=r[w],R=c(T),U=p[R];l.set(0,0,0);for(let A=0,D=U.length;A<D;A++){const L=U[A];o.dot(L)>t&&l.add(L)}l.normalize(),v.setXYZ(g+w,l.x,l.y,l.z)}}return h.setAttribute("normal",v),h}const t_=new Ll,n_=new j,Xc=new j,es=new j,aa=new j,xs=new j,oa=new j,la=new j,Uh=new j,Oh=new j,Lh=new j,jp=new j,Ih=new j,Nh=new j,Ph=new j;class cw{constructor(e,t,n){this.camera=e,this.scene=t,this.startPoint=new j,this.endPoint=new j,this.collection=[],this.deep=n||Number.MAX_VALUE}select(e,t){return this.startPoint=e||this.startPoint,this.endPoint=t||this.endPoint,this.collection=[],this.updateFrustum(this.startPoint,this.endPoint),this.searchChildInFrustum(t_,this.scene),this.collection}updateFrustum(e,t){if(e=e||this.startPoint,t=t||this.endPoint,e.x===t.x&&(t.x+=Number.EPSILON),e.y===t.y&&(t.y+=Number.EPSILON),this.camera.updateProjectionMatrix(),this.camera.updateMatrixWorld(),this.camera.isPerspectiveCamera){Xc.copy(e),Xc.x=Math.min(e.x,t.x),Xc.y=Math.max(e.y,t.y),t.x=Math.max(e.x,t.x),t.y=Math.min(e.y,t.y),es.setFromMatrixPosition(this.camera.matrixWorld),aa.copy(Xc),xs.set(t.x,Xc.y,0),oa.copy(t),la.set(Xc.x,t.y,0),aa.unproject(this.camera),xs.unproject(this.camera),oa.unproject(this.camera),la.unproject(this.camera),Ih.copy(aa).sub(es),Nh.copy(xs).sub(es),Ph.copy(oa).sub(es),Ih.normalize(),Nh.normalize(),Ph.normalize(),Ih.multiplyScalar(this.deep),Nh.multiplyScalar(this.deep),Ph.multiplyScalar(this.deep),Ih.add(es),Nh.add(es),Ph.add(es);var n=t_.planes;n[0].setFromCoplanarPoints(es,aa,xs),n[1].setFromCoplanarPoints(es,xs,oa),n[2].setFromCoplanarPoints(oa,la,es),n[3].setFromCoplanarPoints(la,aa,es),n[4].setFromCoplanarPoints(xs,oa,la),n[5].setFromCoplanarPoints(Ph,Nh,Ih),n[5].normal.multiplyScalar(-1)}else if(this.camera.isOrthographicCamera){const r=Math.min(e.x,t.x),s=Math.max(e.y,t.y),a=Math.max(e.x,t.x),o=Math.min(e.y,t.y);aa.set(r,s,-1),xs.set(a,s,-1),oa.set(a,o,-1),la.set(r,o,-1),Uh.set(r,s,1),Oh.set(a,s,1),Lh.set(a,o,1),jp.set(r,o,1),aa.unproject(this.camera),xs.unproject(this.camera),oa.unproject(this.camera),la.unproject(this.camera),Uh.unproject(this.camera),Oh.unproject(this.camera),Lh.unproject(this.camera),jp.unproject(this.camera);var n=t_.planes;n[0].setFromCoplanarPoints(aa,Uh,Oh),n[1].setFromCoplanarPoints(xs,Oh,Lh),n[2].setFromCoplanarPoints(Lh,jp,la),n[3].setFromCoplanarPoints(jp,Uh,aa),n[4].setFromCoplanarPoints(xs,oa,la),n[5].setFromCoplanarPoints(Lh,Oh,Uh),n[5].normal.multiplyScalar(-1)}else console.error("THREE.SelectionBox: Unsupported camera type.")}searchChildInFrustum(e,t){if((t.isMesh||t.isLine||t.isPoints)&&t.material!==void 0&&(t.geometry.boundingSphere===null&&t.geometry.computeBoundingSphere(),n_.copy(t.geometry.boundingSphere.center),n_.applyMatrix4(t.matrixWorld),e.containsPoint(n_)&&this.collection.push(t)),t.children.length>0)for(let n=0;n<t.children.length;n++)this.searchChildInFrustum(e,t.children[n])}}var zh={},i_,uw;function Aa(){return uw||(uw=1,i_=function(e){return e!==null&&typeof e=="object"&&typeof e.addUndirectedEdgeWithKey=="function"&&typeof e.dropNode=="function"&&typeof e.multi=="boolean"}),i_}var hw;function rG(){if(hw)return zh;hw=1;var i=Aa();function e(s,a,o,l){var c=a+"Centrality";if(!i(o))throw new Error("graphology-centrality/"+c+": the given graph is not a valid graphology instance.");if(a!=="degree"&&o.type==="undirected")throw new Error("graphology-centrality/"+c+": cannot compute "+a+" centrality on an undirected graph.");l=l||{};var h=l.nodeCentralityAttribute||c,d=o.order-1,p=o[a].bind(o);if(s){o.updateEachNodeAttributes(function(v,x){return x[h]=p(v)/d,x},{attributes:[h]});return}var m={};return o.forEachNode(function(v){m[v]=p(v)/d}),m}var t=e.bind(null,!1,"degree"),n=e.bind(null,!1,"inDegree"),r=e.bind(null,!1,"outDegree");return t.assign=e.bind(null,!0,"degree"),n.assign=e.bind(null,!0,"inDegree"),r.assign=e.bind(null,!0,"outDegree"),zh.degreeCentrality=t,zh.inDegreeCentrality=n,zh.outDegreeCentrality=r,zh}var sG=rG();function cm(i,e){return i==null||e==null?NaN:i<e?-1:i>e?1:i>=e?0:NaN}function aG(i,e){return i==null||e==null?NaN:e<i?-1:e>i?1:e>=i?0:NaN}function iR(i){let e,t,n;i.length!==2?(e=cm,t=(o,l)=>cm(i(o),l),n=(o,l)=>i(o)-l):(e=i===cm||i===aG?i:oG,t=i,n=i);function r(o,l,c=0,h=o.length){if(c<h){if(e(l,l)!==0)return h;do{const d=c+h>>>1;t(o[d],l)<0?c=d+1:h=d}while(c<h)}return c}function s(o,l,c=0,h=o.length){if(c<h){if(e(l,l)!==0)return h;do{const d=c+h>>>1;t(o[d],l)<=0?c=d+1:h=d}while(c<h)}return c}function a(o,l,c=0,h=o.length){const d=r(o,l,c,h-1);return d>c&&n(o[d-1],l)>-n(o[d],l)?d-1:d}return{left:r,center:a,right:s}}function oG(){return 0}function lG(i){return i===null?NaN:+i}const cG=iR(cm),uG=cG.right;iR(lG).center;const hG=Math.sqrt(50),fG=Math.sqrt(10),dG=Math.sqrt(2);function ug(i,e,t){const n=(e-i)/Math.max(0,t),r=Math.floor(Math.log10(n)),s=n/Math.pow(10,r),a=s>=hG?10:s>=fG?5:s>=dG?2:1;let o,l,c;return r<0?(c=Math.pow(10,-r)/a,o=Math.round(i*c),l=Math.round(e*c),o/c<i&&++o,l/c>e&&--l,c=-c):(c=Math.pow(10,r)*a,o=Math.round(i/c),l=Math.round(e/c),o*c<i&&++o,l*c>e&&--l),l<o&&.5<=t&&t<2?ug(i,e,t*2):[o,l,c]}function pG(i,e,t){if(e=+e,i=+i,t=+t,!(t>0))return[];if(i===e)return[i];const n=e<i,[r,s,a]=n?ug(e,i,t):ug(i,e,t);if(!(s>=r))return[];const o=s-r+1,l=new Array(o);if(n)if(a<0)for(let c=0;c<o;++c)l[c]=(s-c)/-a;else for(let c=0;c<o;++c)l[c]=(s-c)*a;else if(a<0)for(let c=0;c<o;++c)l[c]=(r+c)/-a;else for(let c=0;c<o;++c)l[c]=(r+c)*a;return l}function hx(i,e,t){return e=+e,i=+i,t=+t,ug(i,e,t)[2]}function mG(i,e,t){e=+e,i=+i,t=+t;const n=e<i,r=n?hx(e,i,t):hx(i,e,t);return(n?-1:1)*(r<0?1/-r:r)}function gG(i,e){switch(arguments.length){case 0:break;case 1:this.range(i);break;default:this.range(e).domain(i);break}return this}function L1(i,e,t){i.prototype=e.prototype=t,t.constructor=i}function rR(i,e){var t=Object.create(i.prototype);for(var n in e)t[n]=e[n];return t}function sd(){}var zf=.7,hg=1/zf,su="\\s*([+-]?\\d+)\\s*",Ff="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Rs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",vG=/^#([0-9a-f]{3,8})$/,yG=new RegExp(`^rgb\\(${su},${su},${su}\\)$`),_G=new RegExp(`^rgb\\(${Rs},${Rs},${Rs}\\)$`),xG=new RegExp(`^rgba\\(${su},${su},${su},${Ff}\\)$`),bG=new RegExp(`^rgba\\(${Rs},${Rs},${Rs},${Ff}\\)$`),SG=new RegExp(`^hsl\\(${Ff},${Rs},${Rs}\\)$`),EG=new RegExp(`^hsla\\(${Ff},${Rs},${Rs},${Ff}\\)$`),fw={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};L1(sd,Bf,{copy(i){return Object.assign(new this.constructor,this,i)},displayable(){return this.rgb().displayable()},hex:dw,formatHex:dw,formatHex8:MG,formatHsl:wG,formatRgb:pw,toString:pw});function dw(){return this.rgb().formatHex()}function MG(){return this.rgb().formatHex8()}function wG(){return sR(this).formatHsl()}function pw(){return this.rgb().formatRgb()}function Bf(i){var e,t;return i=(i+"").trim().toLowerCase(),(e=vG.exec(i))?(t=e[1].length,e=parseInt(e[1],16),t===6?mw(e):t===3?new $i(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):t===8?qp(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):t===4?qp(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=yG.exec(i))?new $i(e[1],e[2],e[3],1):(e=_G.exec(i))?new $i(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=xG.exec(i))?qp(e[1],e[2],e[3],e[4]):(e=bG.exec(i))?qp(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=SG.exec(i))?yw(e[1],e[2]/100,e[3]/100,1):(e=EG.exec(i))?yw(e[1],e[2]/100,e[3]/100,e[4]):fw.hasOwnProperty(i)?mw(fw[i]):i==="transparent"?new $i(NaN,NaN,NaN,0):null}function mw(i){return new $i(i>>16&255,i>>8&255,i&255,1)}function qp(i,e,t,n){return n<=0&&(i=e=t=NaN),new $i(i,e,t,n)}function TG(i){return i instanceof sd||(i=Bf(i)),i?(i=i.rgb(),new $i(i.r,i.g,i.b,i.opacity)):new $i}function fx(i,e,t,n){return arguments.length===1?TG(i):new $i(i,e,t,n??1)}function $i(i,e,t,n){this.r=+i,this.g=+e,this.b=+t,this.opacity=+n}L1($i,fx,rR(sd,{brighter(i){return i=i==null?hg:Math.pow(hg,i),new $i(this.r*i,this.g*i,this.b*i,this.opacity)},darker(i){return i=i==null?zf:Math.pow(zf,i),new $i(this.r*i,this.g*i,this.b*i,this.opacity)},rgb(){return this},clamp(){return new $i(El(this.r),El(this.g),El(this.b),fg(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:gw,formatHex:gw,formatHex8:AG,formatRgb:vw,toString:vw}));function gw(){return`#${_l(this.r)}${_l(this.g)}${_l(this.b)}`}function AG(){return`#${_l(this.r)}${_l(this.g)}${_l(this.b)}${_l((isNaN(this.opacity)?1:this.opacity)*255)}`}function vw(){const i=fg(this.opacity);return`${i===1?"rgb(":"rgba("}${El(this.r)}, ${El(this.g)}, ${El(this.b)}${i===1?")":`, ${i})`}`}function fg(i){return isNaN(i)?1:Math.max(0,Math.min(1,i))}function El(i){return Math.max(0,Math.min(255,Math.round(i)||0))}function _l(i){return i=El(i),(i<16?"0":"")+i.toString(16)}function yw(i,e,t,n){return n<=0?i=e=t=NaN:t<=0||t>=1?i=e=NaN:e<=0&&(i=NaN),new as(i,e,t,n)}function sR(i){if(i instanceof as)return new as(i.h,i.s,i.l,i.opacity);if(i instanceof sd||(i=Bf(i)),!i)return new as;if(i instanceof as)return i;i=i.rgb();var e=i.r/255,t=i.g/255,n=i.b/255,r=Math.min(e,t,n),s=Math.max(e,t,n),a=NaN,o=s-r,l=(s+r)/2;return o?(e===s?a=(t-n)/o+(t<n)*6:t===s?a=(n-e)/o+2:a=(e-t)/o+4,o/=l<.5?s+r:2-s-r,a*=60):o=l>0&&l<1?0:a,new as(a,o,l,i.opacity)}function CG(i,e,t,n){return arguments.length===1?sR(i):new as(i,e,t,n??1)}function as(i,e,t,n){this.h=+i,this.s=+e,this.l=+t,this.opacity=+n}L1(as,CG,rR(sd,{brighter(i){return i=i==null?hg:Math.pow(hg,i),new as(this.h,this.s,this.l*i,this.opacity)},darker(i){return i=i==null?zf:Math.pow(zf,i),new as(this.h,this.s,this.l*i,this.opacity)},rgb(){var i=this.h%360+(this.h<0)*360,e=isNaN(i)||isNaN(this.s)?0:this.s,t=this.l,n=t+(t<.5?t:1-t)*e,r=2*t-n;return new $i(r_(i>=240?i-240:i+120,r,n),r_(i,r,n),r_(i<120?i+240:i-120,r,n),this.opacity)},clamp(){return new as(_w(this.h),Yp(this.s),Yp(this.l),fg(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const i=fg(this.opacity);return`${i===1?"hsl(":"hsla("}${_w(this.h)}, ${Yp(this.s)*100}%, ${Yp(this.l)*100}%${i===1?")":`, ${i})`}`}}));function _w(i){return i=(i||0)%360,i<0?i+360:i}function Yp(i){return Math.max(0,Math.min(1,i||0))}function r_(i,e,t){return(i<60?e+(t-e)*i/60:i<180?t:i<240?e+(t-e)*(240-i)/60:e)*255}const I1=i=>()=>i;function RG(i,e){return function(t){return i+t*e}}function DG(i,e,t){return i=Math.pow(i,t),e=Math.pow(e,t)-i,t=1/t,function(n){return Math.pow(i+n*e,t)}}function UG(i){return(i=+i)==1?aR:function(e,t){return t-e?DG(e,t,i):I1(isNaN(e)?t:e)}}function aR(i,e){var t=e-i;return t?RG(i,t):I1(isNaN(i)?e:i)}const xw=(function i(e){var t=UG(e);function n(r,s){var a=t((r=fx(r)).r,(s=fx(s)).r),o=t(r.g,s.g),l=t(r.b,s.b),c=aR(r.opacity,s.opacity);return function(h){return r.r=a(h),r.g=o(h),r.b=l(h),r.opacity=c(h),r+""}}return n.gamma=i,n})(1);function OG(i,e){e||(e=[]);var t=i?Math.min(e.length,i.length):0,n=e.slice(),r;return function(s){for(r=0;r<t;++r)n[r]=i[r]*(1-s)+e[r]*s;return n}}function LG(i){return ArrayBuffer.isView(i)&&!(i instanceof DataView)}function IG(i,e){var t=e?e.length:0,n=i?Math.min(t,i.length):0,r=new Array(n),s=new Array(t),a;for(a=0;a<n;++a)r[a]=N1(i[a],e[a]);for(;a<t;++a)s[a]=e[a];return function(o){for(a=0;a<n;++a)s[a]=r[a](o);return s}}function NG(i,e){var t=new Date;return i=+i,e=+e,function(n){return t.setTime(i*(1-n)+e*n),t}}function dg(i,e){return i=+i,e=+e,function(t){return i*(1-t)+e*t}}function PG(i,e){var t={},n={},r;(i===null||typeof i!="object")&&(i={}),(e===null||typeof e!="object")&&(e={});for(r in e)r in i?t[r]=N1(i[r],e[r]):n[r]=e[r];return function(s){for(r in t)n[r]=t[r](s);return n}}var dx=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,s_=new RegExp(dx.source,"g");function zG(i){return function(){return i}}function FG(i){return function(e){return i(e)+""}}function BG(i,e){var t=dx.lastIndex=s_.lastIndex=0,n,r,s,a=-1,o=[],l=[];for(i=i+"",e=e+"";(n=dx.exec(i))&&(r=s_.exec(e));)(s=r.index)>t&&(s=e.slice(t,s),o[a]?o[a]+=s:o[++a]=s),(n=n[0])===(r=r[0])?o[a]?o[a]+=r:o[++a]=r:(o[++a]=null,l.push({i:a,x:dg(n,r)})),t=s_.lastIndex;return t<e.length&&(s=e.slice(t),o[a]?o[a]+=s:o[++a]=s),o.length<2?l[0]?FG(l[0].x):zG(e):(e=l.length,function(c){for(var h=0,d;h<e;++h)o[(d=l[h]).i]=d.x(c);return o.join("")})}function N1(i,e){var t=typeof e,n;return e==null||t==="boolean"?I1(e):(t==="number"?dg:t==="string"?(n=Bf(e))?(e=n,xw):BG:e instanceof Bf?xw:e instanceof Date?NG:LG(e)?OG:Array.isArray(e)?IG:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?PG:dg)(i,e)}function kG(i,e){return i=+i,e=+e,function(t){return Math.round(i*(1-t)+e*t)}}function GG(i){return function(){return i}}function HG(i){return+i}var bw=[0,1];function nu(i){return i}function px(i,e){return(e-=i=+i)?function(t){return(t-i)/e}:GG(isNaN(e)?NaN:.5)}function VG(i,e){var t;return i>e&&(t=i,i=e,e=t),function(n){return Math.max(i,Math.min(e,n))}}function WG(i,e,t){var n=i[0],r=i[1],s=e[0],a=e[1];return r<n?(n=px(r,n),s=t(a,s)):(n=px(n,r),s=t(s,a)),function(o){return s(n(o))}}function XG(i,e,t){var n=Math.min(i.length,e.length)-1,r=new Array(n),s=new Array(n),a=-1;for(i[n]<i[0]&&(i=i.slice().reverse(),e=e.slice().reverse());++a<n;)r[a]=px(i[a],i[a+1]),s[a]=t(e[a],e[a+1]);return function(o){var l=uG(i,o,1,n)-1;return s[l](r[l](o))}}function jG(i,e){return e.domain(i.domain()).range(i.range()).interpolate(i.interpolate()).clamp(i.clamp()).unknown(i.unknown())}function qG(){var i=bw,e=bw,t=N1,n,r,s,a=nu,o,l,c;function h(){var p=Math.min(i.length,e.length);return a!==nu&&(a=VG(i[0],i[p-1])),o=p>2?XG:WG,l=c=null,d}function d(p){return p==null||isNaN(p=+p)?s:(l||(l=o(i.map(n),e,t)))(n(a(p)))}return d.invert=function(p){return a(r((c||(c=o(e,i.map(n),dg)))(p)))},d.domain=function(p){return arguments.length?(i=Array.from(p,HG),h()):i.slice()},d.range=function(p){return arguments.length?(e=Array.from(p),h()):e.slice()},d.rangeRound=function(p){return e=Array.from(p),t=kG,h()},d.clamp=function(p){return arguments.length?(a=p?!0:nu,h()):a!==nu},d.interpolate=function(p){return arguments.length?(t=p,h()):t},d.unknown=function(p){return arguments.length?(s=p,d):s},function(p,m){return n=p,r=m,h()}}function YG(){return qG()(nu,nu)}function ZG(i){return Math.abs(i=Math.round(i))>=1e21?i.toLocaleString("en").replace(/,/g,""):i.toString(10)}function pg(i,e){if((t=(i=e?i.toExponential(e-1):i.toExponential()).indexOf("e"))<0)return null;var t,n=i.slice(0,t);return[n.length>1?n[0]+n.slice(2):n,+i.slice(t+1)]}function yu(i){return i=pg(Math.abs(i)),i?i[1]:NaN}function KG(i,e){return function(t,n){for(var r=t.length,s=[],a=0,o=i[0],l=0;r>0&&o>0&&(l+o+1>n&&(o=Math.max(1,n-l)),s.push(t.substring(r-=o,r+o)),!((l+=o+1)>n));)o=i[a=(a+1)%i.length];return s.reverse().join(e)}}function JG(i){return function(e){return e.replace(/[0-9]/g,function(t){return i[+t]})}}var QG=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function mg(i){if(!(e=QG.exec(i)))throw new Error("invalid format: "+i);var e;return new P1({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}mg.prototype=P1.prototype;function P1(i){this.fill=i.fill===void 0?" ":i.fill+"",this.align=i.align===void 0?">":i.align+"",this.sign=i.sign===void 0?"-":i.sign+"",this.symbol=i.symbol===void 0?"":i.symbol+"",this.zero=!!i.zero,this.width=i.width===void 0?void 0:+i.width,this.comma=!!i.comma,this.precision=i.precision===void 0?void 0:+i.precision,this.trim=!!i.trim,this.type=i.type===void 0?"":i.type+""}P1.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function $G(i){e:for(var e=i.length,t=1,n=-1,r;t<e;++t)switch(i[t]){case".":n=r=t;break;case"0":n===0&&(n=t),r=t;break;default:if(!+i[t])break e;n>0&&(n=0);break}return n>0?i.slice(0,n)+i.slice(r+1):i}var oR;function eH(i,e){var t=pg(i,e);if(!t)return i+"";var n=t[0],r=t[1],s=r-(oR=Math.max(-8,Math.min(8,Math.floor(r/3)))*3)+1,a=n.length;return s===a?n:s>a?n+new Array(s-a+1).join("0"):s>0?n.slice(0,s)+"."+n.slice(s):"0."+new Array(1-s).join("0")+pg(i,Math.max(0,e+s-1))[0]}function Sw(i,e){var t=pg(i,e);if(!t)return i+"";var n=t[0],r=t[1];return r<0?"0."+new Array(-r).join("0")+n:n.length>r+1?n.slice(0,r+1)+"."+n.slice(r+1):n+new Array(r-n.length+2).join("0")}const Ew={"%":(i,e)=>(i*100).toFixed(e),b:i=>Math.round(i).toString(2),c:i=>i+"",d:ZG,e:(i,e)=>i.toExponential(e),f:(i,e)=>i.toFixed(e),g:(i,e)=>i.toPrecision(e),o:i=>Math.round(i).toString(8),p:(i,e)=>Sw(i*100,e),r:Sw,s:eH,X:i=>Math.round(i).toString(16).toUpperCase(),x:i=>Math.round(i).toString(16)};function Mw(i){return i}var ww=Array.prototype.map,Tw=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function tH(i){var e=i.grouping===void 0||i.thousands===void 0?Mw:KG(ww.call(i.grouping,Number),i.thousands+""),t=i.currency===void 0?"":i.currency[0]+"",n=i.currency===void 0?"":i.currency[1]+"",r=i.decimal===void 0?".":i.decimal+"",s=i.numerals===void 0?Mw:JG(ww.call(i.numerals,String)),a=i.percent===void 0?"%":i.percent+"",o=i.minus===void 0?"−":i.minus+"",l=i.nan===void 0?"NaN":i.nan+"";function c(d){d=mg(d);var p=d.fill,m=d.align,v=d.sign,x=d.symbol,_=d.zero,g=d.width,b=d.comma,E=d.precision,S=d.trim,w=d.type;w==="n"?(b=!0,w="g"):Ew[w]||(E===void 0&&(E=12),S=!0,w="g"),(_||p==="0"&&m==="=")&&(_=!0,p="0",m="=");var T=x==="$"?t:x==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",R=x==="$"?n:/[%p]/.test(w)?a:"",U=Ew[w],A=/[defgprs%]/.test(w);E=E===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,E)):Math.max(0,Math.min(20,E));function D(L){var P=T,I=R,V,H,z;if(w==="c")I=U(L)+I,L="";else{L=+L;var O=L<0||1/L<0;if(L=isNaN(L)?l:U(Math.abs(L),E),S&&(L=$G(L)),O&&+L==0&&v!=="+"&&(O=!1),P=(O?v==="("?v:o:v==="-"||v==="("?"":v)+P,I=(w==="s"?Tw[8+oR/3]:"")+I+(O&&v==="("?")":""),A){for(V=-1,H=L.length;++V<H;)if(z=L.charCodeAt(V),48>z||z>57){I=(z===46?r+L.slice(V+1):L.slice(V))+I,L=L.slice(0,V);break}}}b&&!_&&(L=e(L,1/0));var B=P.length+L.length+I.length,G=B<g?new Array(g-B+1).join(p):"";switch(b&&_&&(L=e(G+L,G.length?g-I.length:1/0),G=""),m){case"<":L=P+L+I+G;break;case"=":L=P+G+L+I;break;case"^":L=G.slice(0,B=G.length>>1)+P+L+I+G.slice(B);break;default:L=G+P+L+I;break}return s(L)}return D.toString=function(){return d+""},D}function h(d,p){var m=c((d=mg(d),d.type="f",d)),v=Math.max(-8,Math.min(8,Math.floor(yu(p)/3)))*3,x=Math.pow(10,-v),_=Tw[8+v/3];return function(g){return m(x*g)+_}}return{format:c,formatPrefix:h}}var Zp,lR,cR;nH({thousands:",",grouping:[3],currency:["$",""]});function nH(i){return Zp=tH(i),lR=Zp.format,cR=Zp.formatPrefix,Zp}function iH(i){return Math.max(0,-yu(Math.abs(i)))}function rH(i,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(yu(e)/3)))*3-yu(Math.abs(i)))}function sH(i,e){return i=Math.abs(i),e=Math.abs(e)-i,Math.max(0,yu(e)-yu(i))+1}function aH(i,e,t,n){var r=mG(i,e,t),s;switch(n=mg(n??",f"),n.type){case"s":{var a=Math.max(Math.abs(i),Math.abs(e));return n.precision==null&&!isNaN(s=rH(r,a))&&(n.precision=s),cR(n,a)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(s=sH(r,Math.max(Math.abs(i),Math.abs(e))))&&(n.precision=s-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(s=iH(r))&&(n.precision=s-(n.type==="%")*2);break}}return lR(n)}function oH(i){var e=i.domain;return i.ticks=function(t){var n=e();return pG(n[0],n[n.length-1],t??10)},i.tickFormat=function(t,n){var r=e();return aH(r[0],r[r.length-1],t??10,n)},i.nice=function(t){t==null&&(t=10);var n=e(),r=0,s=n.length-1,a=n[r],o=n[s],l,c,h=10;for(o<a&&(c=a,a=o,o=c,c=r,r=s,s=c);h-- >0;){if(c=hx(a,o,t),c===l)return n[r]=a,n[s]=o,e(n);if(c>0)a=Math.floor(a/c)*c,o=Math.ceil(o/c)*c;else if(c<0)a=Math.ceil(a*c)/c,o=Math.floor(o*c)/c;else break;l=c}return i},i}function uR(){var i=YG();return i.copy=function(){return jG(i,uR())},gG.apply(i,arguments),oH(i)}var a_,Aw;function z1(){if(Aw)return a_;Aw=1;function i(t){return!t||typeof t!="object"||typeof t=="function"||Array.isArray(t)||t instanceof Set||t instanceof Map||t instanceof RegExp||t instanceof Date}function e(t,n){t=t||{};var r={};for(var s in n){var a=t[s],o=n[s];if(!i(o)){r[s]=e(a,o);continue}a===void 0?r[s]=o:r[s]=a}return r}return a_=e,a_}var Kp={},o_={},Cw;function hR(){return Cw||(Cw=1,(function(i){var e=Math.pow(2,8)-1,t=Math.pow(2,16)-1,n=Math.pow(2,32)-1,r=Math.pow(2,7)-1,s=Math.pow(2,15)-1,a=Math.pow(2,31)-1;i.getPointerArray=function(l){var c=l-1;if(c<=e)return Uint8Array;if(c<=t)return Uint16Array;if(c<=n)return Uint32Array;throw new Error("mnemonist: Pointer Array of size > 4294967295 is not supported.")},i.getSignedPointerArray=function(l){var c=l-1;return c<=r?Int8Array:c<=s?Int16Array:c<=a?Int32Array:Float64Array},i.getNumberType=function(l){return l===(l|0)?Math.sign(l)===-1?l<=127&&l>=-128?Int8Array:l<=32767&&l>=-32768?Int16Array:Int32Array:l<=255?Uint8Array:l<=65535?Uint16Array:Uint32Array:Float64Array};var o={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};i.getMinimalRepresentation=function(l,c){var h=null,d=0,p,m,v,x,_;for(x=0,_=l.length;x<_;x++)v=c?c(l[x]):l[x],m=i.getNumberType(v),p=o[m.name],p>d&&(d=p,h=m);return h},i.isTypedArray=function(l){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView(l)},i.concat=function(){var l=0,c,h,d;for(c=0,d=arguments.length;c<d;c++)l+=arguments[c].length;var p=new arguments[0].constructor(l);for(c=0,h=0;c<d;c++)p.set(arguments[c],h),h+=arguments[c].length;return p},i.indices=function(l){for(var c=i.getPointerArray(l),h=new c(l),d=0;d<l;d++)h[d]=d;return h}})(o_)),o_}var Fh={},Rw;function d0(){if(Rw)return Fh;Rw=1;function i(n){return typeof n!="number"||isNaN(n)?1:n}function e(n,r){var s={},a=function(c){return typeof c>"u"?r:c};typeof r=="function"&&(a=r);var o=function(c){return a(c[n])},l=function(){return a(void 0)};return typeof n=="string"?(s.fromAttributes=o,s.fromGraph=function(c,h){return o(c.getNodeAttributes(h))},s.fromEntry=function(c,h){return o(h)}):typeof n=="function"?(s.fromAttributes=function(){throw new Error("graphology-utils/getters/createNodeValueGetter: irrelevant usage.")},s.fromGraph=function(c,h){return a(n(h,c.getNodeAttributes(h)))},s.fromEntry=function(c,h){return a(n(c,h))}):(s.fromAttributes=l,s.fromGraph=l,s.fromEntry=l),s}function t(n,r){var s={},a=function(c){return typeof c>"u"?r:c};typeof r=="function"&&(a=r);var o=function(c){return a(c[n])},l=function(){return a(void 0)};return typeof n=="string"?(s.fromAttributes=o,s.fromGraph=function(c,h){return o(c.getEdgeAttributes(h))},s.fromEntry=function(c,h){return o(h)},s.fromPartialEntry=s.fromEntry,s.fromMinimalEntry=s.fromEntry):typeof n=="function"?(s.fromAttributes=function(){throw new Error("graphology-utils/getters/createEdgeValueGetter: irrelevant usage.")},s.fromGraph=function(c,h){var d=c.extremities(h);return a(n(h,c.getEdgeAttributes(h),d[0],d[1],c.getNodeAttributes(d[0]),c.getNodeAttributes(d[1]),c.isUndirected(h)))},s.fromEntry=function(c,h,d,p,m,v,x){return a(n(c,h,d,p,m,v,x))},s.fromPartialEntry=function(c,h,d,p){return a(n(c,h,d,p))},s.fromMinimalEntry=function(c,h){return a(n(c,h))}):(s.fromAttributes=l,s.fromGraph=l,s.fromEntry=l,s.fromMinimalEntry=l),s}return Fh.createNodeValueGetter=e,Fh.createEdgeValueGetter=t,Fh.createEdgeWeightGetter=function(n){return t(n,i)},Fh}var Dw;function lH(){if(Dw)return Kp;Dw=1;var i=hR(),e=d0().createEdgeWeightGetter;function t(s,a){return s==="outbound"||s==="inbound"?a.directedSize+a.undirectedSize*2:s==="in"||s==="out"||s==="directed"?a.directedSize:a.undirectedSize*2}function n(s,a){a=a||"outbound";var o=s[a+"Neighbors"].bind(s),l=t(a,s),c=i.getPointerArray(l),h=i.getPointerArray(s.order);this.graph=s,this.neighborhood=new h(l),this.starts=new c(s.order+1),this.nodes=s.nodes();var d={},p,m,v,x,_,g,b=0;for(p=0,m=s.order;p<m;p++)d[this.nodes[p]]=p;for(p=0,m=s.order;p<m;p++)for(_=this.nodes[p],g=o(_),this.starts[p]=b,v=0,x=g.length;v<x;v++)this.neighborhood[b++]=d[g[v]];this.starts[p]=l}n.prototype.bounds=function(s){return[this.starts[s],this.starts[s+1]]},n.prototype.project=function(){var s=this,a={};return s.nodes.forEach(function(o,l){a[o]=Array.from(s.neighborhood.slice(s.starts[l],s.starts[l+1])).map(function(c){return s.nodes[c]})}),a},n.prototype.collect=function(s){var a,o,l={};for(a=0,o=s.length;a<o;a++)l[this.nodes[a]]=s[a];return l},n.prototype.assign=function(s,a){var o=0;this.graph.updateEachNodeAttributes(function(l,c){return c[s]=a[o++],c},{attributes:[s]})},Kp.NeighborhoodIndex=n;function r(s,a,o){o=o||"outbound";var l=s[o+"Edges"].bind(s),c=t(o,s),h=i.getPointerArray(c),d=i.getPointerArray(s.order),p=e(a).fromMinimalEntry;this.graph=s,this.neighborhood=new d(c),this.weights=new Float64Array(c),this.outDegrees=new Float64Array(s.order),this.starts=new h(s.order+1),this.nodes=s.nodes();var m={},v,x,_,g,b,E,S,w,T,R=0;for(v=0,x=s.order;v<x;v++)m[this.nodes[v]]=v;for(v=0,x=s.order;v<x;v++)for(b=this.nodes[v],S=l(b),this.starts[v]=R,_=0,g=S.length;_<g;_++)w=S[_],E=s.opposite(b,w),T=p(w,s.getEdgeAttributes(w)),this.neighborhood[R]=m[E],this.weights[R++]=T,this.outDegrees[v]+=T;this.starts[v]=c}return r.prototype.bounds=n.prototype.bounds,r.prototype.project=n.prototype.project,r.prototype.collect=n.prototype.collect,r.prototype.assign=n.prototype.assign,Kp.WeightedNeighborhoodIndex=r,Kp}var l_,Uw;function cH(){if(Uw)return l_;Uw=1;var i=Aa(),e=z1(),t=lH().WeightedNeighborhoodIndex,n={nodePagerankAttribute:"pagerank",getEdgeWeight:"weight",alpha:.85,maxIterations:100,tolerance:1e-6};function r(a,o,l){if(!i(o))throw new Error("graphology-metrics/centrality/pagerank: the given graph is not a valid graphology instance.");l=e(l,n);var c=l.alpha,h=l.maxIterations,d=l.tolerance,p=l.nodePagerankAttribute,m=o.order,v=1/m,x=new t(o,l.getEdgeWeight),_,g,b,E,S=new Float64Array(o.order),w=new Float64Array(x.weights.length),T=[];for(_=0;_<m;_++)for(S[_]=v,b=x.starts[_+1],E=x.outDegrees[_],E===0&&T.push(_),g=x.starts[_];g<b;g++)w[g]=x.weights[g]/E;for(var R=0,U=0,A,D,L,P=!1;R<h;){for(L=S,S=new Float64Array(o.order),A=0,_=0,b=T.length;_<b;_++)A+=L[T[_]];for(A*=c,_=0;_<m;_++){for(b=x.starts[_+1],g=x.starts[_];g<b;g++)D=x.neighborhood[g],S[D]+=c*L[_]*w[g];S[_]+=A*v+(1-c)*v}for(U=0,_=0;_<m;_++)U+=Math.abs(S[_]-L[_]);if(U<m*d){P=!0;break}R++}if(!P)throw Error("graphology-metrics/centrality/pagerank: failed to converge.");if(a){x.assign(p,S);return}return x.collect(S)}var s=r.bind(null,!1);return s.assign=r.bind(null,!0),l_=s,l_}var uH=cH();const hH=mo(uH);var ts={},cl={},c_,Ow;function fH(){if(Ow)return c_;Ow=1;function i(e){if(typeof e!="function")throw new Error("obliterator/iterator: expecting a function!");this.next=e}return typeof Symbol<"u"&&(i.prototype[Symbol.iterator]=function(){return this}),i.of=function(){var e=arguments,t=e.length,n=0;return new i(function(){return n>=t?{done:!0}:{done:!1,value:e[n++]}})},i.empty=function(){var e=new i(function(){return{done:!0}});return e},i.fromSequence=function(e){var t=0,n=e.length;return new i(function(){return t>=n?{done:!0}:{done:!1,value:e[t++]}})},i.is=function(e){return e instanceof i?!0:typeof e=="object"&&e!==null&&typeof e.next=="function"},c_=i,c_}var Jp={},Lw;function dH(){return Lw||(Lw=1,Jp.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<"u",Jp.SYMBOL_SUPPORT=typeof Symbol<"u"),Jp}var u_,Iw;function F1(){if(Iw)return u_;Iw=1;var i=dH(),e=i.ARRAY_BUFFER_SUPPORT,t=i.SYMBOL_SUPPORT;return u_=function(r,s){var a,o,l,c,h;if(!r)throw new Error("obliterator/forEach: invalid iterable.");if(typeof s!="function")throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(r)||e&&ArrayBuffer.isView(r)||typeof r=="string"||r.toString()==="[object Arguments]"){for(l=0,c=r.length;l<c;l++)s(r[l],l);return}if(typeof r.forEach=="function"){r.forEach(s);return}if(t&&Symbol.iterator in r&&typeof r.next!="function"&&(r=r[Symbol.iterator]()),typeof r.next=="function"){for(a=r,l=0;h=a.next(),h.done!==!0;)s(h.value,l),l++;return}for(o in r)r.hasOwnProperty(o)&&s(r[o],o)},u_}var h_,Nw;function pH(){if(Nw)return h_;Nw=1;var i=fH(),e=F1();function t(){this.clear()}return t.prototype.clear=function(){this.items=[],this.offset=0,this.size=0},t.prototype.enqueue=function(n){return this.items.push(n),++this.size},t.prototype.dequeue=function(){if(this.size){var n=this.items[this.offset];return++this.offset*2>=this.items.length&&(this.items=this.items.slice(this.offset),this.offset=0),this.size--,n}},t.prototype.peek=function(){if(this.size)return this.items[this.offset]},t.prototype.forEach=function(n,r){r=arguments.length>1?r:this;for(var s=this.offset,a=0,o=this.items.length;s<o;s++,a++)n.call(r,this.items[s],a,this)},t.prototype.toArray=function(){return this.items.slice(this.offset)},t.prototype.values=function(){var n=this.items,r=this.offset;return new i(function(){if(r>=n.length)return{done:!0};var s=n[r];return r++,{value:s,done:!1}})},t.prototype.entries=function(){var n=this.items,r=this.offset,s=0;return new i(function(){if(r>=n.length)return{done:!0};var a=n[r];return r++,{value:[s++,a],done:!1}})},typeof Symbol<"u"&&(t.prototype[Symbol.iterator]=t.prototype.values),t.prototype.toString=function(){return this.toArray().join(",")},t.prototype.toJSON=function(){return this.toArray()},t.prototype.inspect=function(){var n=this.toArray();return Object.defineProperty(n,"constructor",{value:t,enumerable:!1}),n},typeof Symbol<"u"&&(t.prototype[Symbol.for("nodejs.util.inspect.custom")]=t.prototype.inspect),t.from=function(n){var r=new t;return e(n,function(s){r.enqueue(s)}),r},t.of=function(){return t.from(arguments)},h_=t,h_}var f_,Pw;function mH(){return Pw||(Pw=1,f_=function(e,t){var n=t.length;if(n!==0){var r=e.length;e.length+=n;for(var s=0;s<n;s++)e[r+s]=t[s]}}),f_}var zw;function gH(){if(zw)return cl;zw=1;var i=Aa(),e=pH(),t=mH();function n(c,h,d){if(!i(c))throw new Error("graphology-shortest-path: invalid graphology instance.");if(arguments.length<3)throw new Error("graphology-shortest-path: invalid number of arguments. Expecting at least 3.");if(!c.hasNode(h))throw new Error('graphology-shortest-path: the "'+h+'" source node does not exist in the given graph.');if(!c.hasNode(d))throw new Error('graphology-shortest-path: the "'+d+'" target node does not exist in the given graph.');if(h=""+h,d=""+d,h===d)return[h];var p=c.inboundNeighbors.bind(c),m=c.outboundNeighbors.bind(c),v={},x={};v[h]=null,x[d]=null;var _=[h],g=[d],b,E,S,w,T,R,U,A,D=!1;e:for(;_.length&&g.length;)if(_.length<=g.length){for(b=_,_=[],T=0,U=b.length;T<U;T++)for(E=b[T],S=m(E),R=0,A=S.length;R<A;R++)if(w=S[R],w in v||(_.push(w),v[w]=E),w in x){D=!0;break e}}else for(b=g,g=[],T=0,U=b.length;T<U;T++)for(E=b[T],S=p(E),R=0,A=S.length;R<A;R++)if(w=S[R],w in x||(g.push(w),x[w]=E),w in v){D=!0;break e}if(!D)return null;for(var L=[];w;)L.unshift(w),w=v[w];for(w=x[L[L.length-1]];w;)L.push(w),w=x[w];return L.length?L:null}function r(c,h){if(!i(c))throw new Error("graphology-shortest-path: invalid graphology instance.");if(arguments.length<2)throw new Error("graphology-shortest-path: invalid number of arguments. Expecting at least 2.");if(!c.hasNode(h))throw new Error('graphology-shortest-path: the "'+h+'" source node does not exist in the given graph.');h=""+h;var d={},p={},m,v,x,_,g,b;for(d[h]=!0,p[h]=[h];Object.keys(d).length;){m=d,d={};for(x in m)for(v=c.outboundNeighbors(x),g=0,b=v.length;g<b;g++)_=v[g],p[_]||(p[_]=p[x].concat(_),d[_]=!0)}return p}function s(c,h,d){if(!i(h))throw new Error("graphology-shortest-path: invalid graphology instance.");if(!h.hasNode(d))throw new Error('graphology-shortest-path: the "'+d+'" source node does not exist in the given graph.');d=""+d;var p=new Set,m={},v=0;m[d]=0;for(var x=[d],_,g,b;x.length!==0;){var E=[];for(_=0,g=x.length;_<g;_++)b=x[_],!p.has(b)&&(p.add(b),t(E,h[c](b)),m[b]=v);v++,x=E}return m}var a=s.bind(null,"outboundNeighbors"),o=s.bind(null,"neighbors");function l(c,h){h=""+h;var d=[],p={},m={},v=c.nodes(),x,_,g,b,E,S,w,T,R;for(S=0,T=v.length;S<T;S++)b=v[S],p[b]=[],m[b]=0;var U={};m[h]=1,U[h]=0;for(var A=e.of(h);A.size;)for(b=A.dequeue(),d.push(b),x=U[b],_=m[b],g=c.outboundNeighbors(b),w=0,R=g.length;w<R;w++)E=g[w],E in U||(A.enqueue(E),U[E]=x+1),U[E]===x+1&&(m[E]+=_,p[E].push(b));return[d,p,m]}return cl.bidirectional=n,cl.singleSource=r,cl.singleSourceLength=a,cl.undirectedSingleSourceLength=o,cl.brandes=l,cl}var d_={},Fw;function vH(){if(Fw)return d_;Fw=1;var i=function(){return!0};return d_.edgePathFromNodePath=function(e,t){var n=t.length,r,s,a,o;if(n<2)return s=t[0],o=e.multi?e.findEdge(s,s,i):e.edge(s,s),o?[o]:[];n--;var l=new Array(n);for(r=0;r<n;r++){if(s=t[r],a=t[r+1],o=e.multi?e.findOutboundEdge(s,a,i):e.edge(s,a),o===void 0)throw new Error("graphology-shortest-path: given path is impossible in given graph.");l[r]=o}return l},d_}var Bh={},jc={},Bw;function yH(){if(Bw)return jc;Bw=1;var i=function(r,s){return r<s?-1:r>s?1:0},e=function(r,s){return r<s?1:r>s?-1:0};function t(r){return function(s,a){return r(a,s)}}function n(r){return r===2?function(s,a){return s[0]<a[0]?-1:s[0]>a[0]?1:s[1]<a[1]?-1:s[1]>a[1]?1:0}:function(s,a){for(var o=0;o<r;){if(s[o]<a[o])return-1;if(s[o]>a[o])return 1;o++}return 0}}return jc.DEFAULT_COMPARATOR=i,jc.DEFAULT_REVERSE_COMPARATOR=e,jc.reverseComparator=t,jc.createTupleComparator=n,jc}var qc={},kw;function _H(){if(kw)return qc;kw=1;var i=F1(),e=hR();function t(a){return Array.isArray(a)||e.isTypedArray(a)}function n(a){if(typeof a.length=="number")return a.length;if(typeof a.size=="number")return a.size}function r(a){var o=n(a),l=typeof o=="number"?new Array(o):[],c=0;return i(a,function(h){l[c++]=h}),l}function s(a){var o=n(a),l=typeof o=="number"?e.getPointerArray(o):Array,c=typeof o=="number"?new Array(o):[],h=typeof o=="number"?new l(o):[],d=0;return i(a,function(p){c[d]=p,h[d]=d++}),[c,h]}return qc.isArrayLike=t,qc.guessLength=n,qc.toArray=r,qc.toArrayWithIndices=s,qc}var p_,Gw;function fR(){if(Gw)return p_;Gw=1;var i=F1(),e=yH(),t=_H(),n=e.DEFAULT_COMPARATOR,r=e.reverseComparator;function s(g,b,E,S){for(var w=b[S],T,R;S>E;){if(T=S-1>>1,R=b[T],g(w,R)<0){b[S]=R,S=T;continue}break}b[S]=w}function a(g,b,E){for(var S=b.length,w=E,T=b[E],R=2*E+1,U;R<S;)U=R+1,U<S&&g(b[R],b[U])>=0&&(R=U),b[E]=b[R],E=R,R=2*E+1;b[E]=T,s(g,b,w,E)}function o(g,b,E){b.push(E),s(g,b,0,b.length-1)}function l(g,b){var E=b.pop();if(b.length!==0){var S=b[0];return b[0]=E,a(g,b,0),S}return E}function c(g,b,E){if(b.length===0)throw new Error("mnemonist/heap.replace: cannot pop an empty heap.");var S=b[0];return b[0]=E,a(g,b,0),S}function h(g,b,E){var S;return b.length!==0&&g(b[0],E)<0&&(S=b[0],b[0]=E,E=S,a(g,b,0)),E}function d(g,b){for(var E=b.length,S=E>>1,w=S;--w>=0;)a(g,b,w)}function p(g,b){for(var E=b.length,S=0,w=new Array(E);S<E;)w[S++]=l(g,b);return w}function m(g,b,E){arguments.length===2&&(E=b,b=g,g=n);var S=r(g),w,T,R,U=1/0,A;if(b===1){if(t.isArrayLike(E)){for(w=0,T=E.length;w<T;w++)R=E[w],(U===1/0||g(R,U)<0)&&(U=R);return A=new E.constructor(1),A[0]=U,A}return i(E,function(L){(U===1/0||g(L,U)<0)&&(U=L)}),[U]}if(t.isArrayLike(E)){if(b>=E.length)return E.slice().sort(g);for(A=E.slice(0,b),d(S,A),w=b,T=E.length;w<T;w++)S(E[w],A[0])>0&&c(S,A,E[w]);return A.sort(g)}var D=t.guessLength(E);return D!==null&&D<b&&(b=D),A=new Array(b),w=0,i(E,function(L){w<b?A[w]=L:(w===b&&d(S,A),S(L,A[0])>0&&c(S,A,L)),w++}),A.length>w&&(A.length=w),A.sort(g)}function v(g,b,E){arguments.length===2&&(E=b,b=g,g=n);var S=r(g),w,T,R,U=-1/0,A;if(b===1){if(t.isArrayLike(E)){for(w=0,T=E.length;w<T;w++)R=E[w],(U===-1/0||g(R,U)>0)&&(U=R);return A=new E.constructor(1),A[0]=U,A}return i(E,function(L){(U===-1/0||g(L,U)>0)&&(U=L)}),[U]}if(t.isArrayLike(E)){if(b>=E.length)return E.slice().sort(S);for(A=E.slice(0,b),d(g,A),w=b,T=E.length;w<T;w++)g(E[w],A[0])>0&&c(g,A,E[w]);return A.sort(S)}var D=t.guessLength(E);return D!==null&&D<b&&(b=D),A=new Array(b),w=0,i(E,function(L){w<b?A[w]=L:(w===b&&d(g,A),g(L,A[0])>0&&c(g,A,L)),w++}),A.length>w&&(A.length=w),A.sort(S)}function x(g){if(this.clear(),this.comparator=g||n,typeof this.comparator!="function")throw new Error("mnemonist/Heap.constructor: given comparator should be a function.")}x.prototype.clear=function(){this.items=[],this.size=0},x.prototype.push=function(g){return o(this.comparator,this.items,g),++this.size},x.prototype.peek=function(){return this.items[0]},x.prototype.pop=function(){return this.size!==0&&this.size--,l(this.comparator,this.items)},x.prototype.replace=function(g){return c(this.comparator,this.items,g)},x.prototype.pushpop=function(g){return h(this.comparator,this.items,g)},x.prototype.consume=function(){return this.size=0,p(this.comparator,this.items)},x.prototype.toArray=function(){return p(this.comparator,this.items.slice())},x.prototype.inspect=function(){var g=this.toArray();return Object.defineProperty(g,"constructor",{value:x,enumerable:!1}),g},typeof Symbol<"u"&&(x.prototype[Symbol.for("nodejs.util.inspect.custom")]=x.prototype.inspect);function _(g){if(this.clear(),this.comparator=g||n,typeof this.comparator!="function")throw new Error("mnemonist/MaxHeap.constructor: given comparator should be a function.");this.comparator=r(this.comparator)}return _.prototype=x.prototype,x.from=function(g,b){var E=new x(b),S;return t.isArrayLike(g)?S=g.slice():S=t.toArray(g),d(E.comparator,S),E.items=S,E.size=S.length,E},_.from=function(g,b){var E=new _(b),S;return t.isArrayLike(g)?S=g.slice():S=t.toArray(g),d(E.comparator,S),E.items=S,E.size=S.length,E},x.siftUp=a,x.siftDown=s,x.push=o,x.pop=l,x.replace=c,x.pushpop=h,x.heapify=d,x.consume=p,x.nsmallest=m,x.nlargest=v,x.MinHeap=x,x.MaxHeap=_,p_=x,p_}var Hw;function xH(){if(Hw)return Bh;Hw=1;var i=Aa(),e=d0().createEdgeWeightGetter,t=fR(),n="weight";function r(d,p){return d[0]>p[0]?1:d[0]<p[0]?-1:d[1]>p[1]?1:d[1]<p[1]?-1:d[2]>p[2]?1:d[2]<p[2]?-1:0}function s(d,p){return d[0]>p[0]?1:d[0]<p[0]?-1:d[1]>p[1]?1:d[1]<p[1]?-1:d[2]>p[2]?1:d[2]<p[2]?-1:d[3]>p[3]?1:d[3]<p[3]?-1:0}function a(d,p,m,v){if(p=""+p,m=""+m,!i(d))throw new Error("graphology-shortest-path/dijkstra: invalid graphology instance.");if(p&&!d.hasNode(p))throw new Error('graphology-shortest-path/dijkstra: the "'+p+'" source node does not exist in the given graph.');if(m&&!d.hasNode(m))throw new Error('graphology-shortest-path/dijkstra: the "'+m+'" target node does not exist in the given graph.');if(v=e(v||n).fromMinimalEntry,p===m)return[0,[p]];var x=[{},{}],_=[{},{}],g=[new t(r),new t(r)],b=[{},{}];_[0][p]=[p],_[1][m]=[m],b[0][p]=0,b[1][m]=0;var E=[],S=1/0,w=0,T=1,R,U,A,D,L,P,I,V,H;for(g[0].push([0,w++,p]),g[1].push([0,w++,m]);g[0].size&&g[1].size;)if(T=1-T,R=g[T].pop(),D=R[0],L=R[2],!(L in x[T])){if(x[T][L]=D,L in x[1-T])return[S,E];for(U=T===1?d.inboundEdges(L):d.outboundEdges(L),V=0,H=U.length;V<H;V++){if(I=U[V],P=d.opposite(L,I),A=x[T][L]+v(I,d.getEdgeAttributes(I)),P in x[T]&&A<x[T][P])throw Error("graphology-shortest-path/dijkstra: contradictory paths found. Do some of your edges have a negative weight?");(!(P in b[T])||A<b[T][P])&&(b[T][P]=A,g[T].push([A,w++,P]),_[T][P]=_[T][L].concat(P),P in b[0]&&P in b[1]&&(D=b[0][P]+b[1][P],(E.length===0||S>D)&&(S=D,E=_[0][P].concat(_[1][P].slice(0,-1).reverse()))))}}return[1/0,null]}function o(d,p,m,v,x,_){if(!i(d))throw new Error("graphology-shortest-path/dijkstra: invalid graphology instance.");m=e(m||n).fromMinimalEntry;var g={},b={},E=new t(r),S=0,w,T,R,U,A,D,L,P,I,V,H;for(P=0,V=p.length;P<V;P++)U=p[P],b[U]=0,E.push([0,S++,U]),_&&(_[U]=[U]);for(;E.size;)if(T=E.pop(),L=T[0],U=T[2],!(U in g)){if(g[U]=L,U===x)break;for(w=d.outboundEdges(U),I=0,H=w.length;I<H;I++){if(D=w[I],A=d.opposite(U,D),R=m(D,d.getEdgeAttributes(D))+g[U],A in g&&R<g[A])throw Error("graphology-shortest-path/dijkstra: contradictory paths found. Do some of your edges have a negative weight?");(!(A in b)||R<b[A])&&(b[A]=R,E.push([R,S++,A]),_&&(_[A]=_[U].concat(A)))}}return g}function l(d,p,m){var v={};return o(d,[p],m,0,null,v),v}function c(d,p,m,v){return a(d,p,m,v)[1]}function h(d,p,m){p=""+p,m=e(m||n).fromMinimalEntry;var v=[],x={},_={},g=d.nodes(),b,E,S,w,T,R,U,A,D,L;for(D=0,L=g.length;D<L;D++)R=g[D],x[R]=[],_[R]=0;var P={};_[p]=1;var I={};I[p]=0;var V=0,H=new t(s);for(H.push([0,V++,p,p]);H.size;)if(E=H.pop(),w=E[0],S=E[2],R=E[3],!(R in P))for(_[R]+=_[S],v.push(R),P[R]=w,b=d.outboundEdges(R),D=0,L=b.length;D<L;D++)A=b[D],U=d.opposite(R,A),T=w+m(A,d.getEdgeAttributes(A)),!(U in P)&&(!(U in I)||T<I[U])?(I[U]=T,H.push([T,V++,R,U]),_[U]=0,x[U]=[R]):T===I[U]&&(_[U]+=_[R],x[U].push(R));return[v,x,_]}return Bh.bidirectional=c,Bh.singleSource=l,Bh.brandes=h,Bh}var m_={},Vw;function bH(){if(Vw)return m_;Vw=1;var i=Aa(),e=d0().createEdgeWeightGetter,t=fR(),n="weight";function r(a,o){return a[0]>o[0]?1:a[0]<o[0]?-1:a[1]>o[1]?1:a[1]<o[1]?-1:0}function s(a,o,l,c,h,d){if(!i(a))throw new Error("graphology-shortest-path/astar: invalid graphology instance.");if(o&&!a.hasNode(o))throw new Error('graphology-shortest-path/astar: the "'+o+'" source node does not exist in the given graph.');if(l&&!a.hasNode(l))throw new Error('graphology-shortest-path/astar: the "'+l+'" target node does not exist in the given graph.');if(c=e(c||n).fromMinimalEntry,o===l)return[o];h=h||function(){return 0},d=d||{};var p=0,m=new t(r);m.push([0,p++,o,0,null]);var v={},x={},_,g,b,E,S,w,T,R,U,A,D,L;function P(I,V,H,z){if(L=g===H?z:H,A=c(I,V),A!==null){if(D=E+A,v.hasOwnProperty(L)){if(b=v[L],R=b[0],U=b[1],R<=D)return}else U=h(L,l);d.cutoff&&D+U>d.cutoff||(v[L]=[D,U],m.push([D+U,p++,L,D,g]))}}for(;m.size!==0;){if(_=m.pop(),g=_[2],E=_[3],S=_[4],g===l){for(w=[g],T=S;T!==null;)w.push(T),T=x[T];return w.reverse(),w}x.hasOwnProperty(g)&&(x[g]===null||(R=v[g][0],R<E))||(x[g]=S,a.forEachOutboundEdge(g,P))}return null}return m_.bidirectional=s,m_}var Ww;function SH(){if(Ww)return ts;Ww=1;var i=gH(),e=vH();return ts.unweighted=i,ts.dijkstra=xH(),ts.astar=bH(),ts.bidirectional=i.bidirectional,ts.singleSource=i.singleSource,ts.singleSourceLength=i.singleSourceLength,ts.undirectedSingleSourceLength=i.undirectedSingleSourceLength,ts.brandes=i.brandes,ts.edgePathFromNodePath=e.edgePathFromNodePath,ts}var EH=SH(),B1=od(),Ct=i=>ad(i,B1),k1=od();Ct.write=i=>ad(i,k1);var p0=od();Ct.onStart=i=>ad(i,p0);var G1=od();Ct.onFrame=i=>ad(i,G1);var H1=od();Ct.onFinish=i=>ad(i,H1);var au=[];Ct.setTimeout=(i,e)=>{const t=Ct.now()+e,n=()=>{const s=au.findIndex(a=>a.cancel==n);~s&&au.splice(s,1),oo-=~s?1:0},r={time:t,handler:i,cancel:n};return au.splice(dR(t),0,r),oo+=1,pR(),r};var dR=i=>~(~au.findIndex(e=>e.time>i)||~au.length);Ct.cancel=i=>{p0.delete(i),G1.delete(i),H1.delete(i),B1.delete(i),k1.delete(i)};Ct.sync=i=>{mx=!0,Ct.batchedUpdates(i),mx=!1};Ct.throttle=i=>{let e;function t(){try{i(...e)}finally{e=null}}function n(...r){e=r,Ct.onStart(t)}return n.handler=i,n.cancel=()=>{p0.delete(t),e=null},n};var V1=typeof window<"u"?window.requestAnimationFrame:(()=>{});Ct.use=i=>V1=i;Ct.now=typeof performance<"u"?()=>performance.now():Date.now;Ct.batchedUpdates=i=>i();Ct.catch=console.error;Ct.frameLoop="always";Ct.advance=()=>{Ct.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):gR()};var ao=-1,oo=0,mx=!1;function ad(i,e){mx?(e.delete(i),i(0)):(e.add(i),pR())}function pR(){ao<0&&(ao=0,Ct.frameLoop!=="demand"&&V1(mR))}function MH(){ao=-1}function mR(){~ao&&(V1(mR),Ct.batchedUpdates(gR))}function gR(){const i=ao;ao=Ct.now();const e=dR(ao);if(e&&(vR(au.splice(0,e),t=>t.handler()),oo-=e),!oo){MH();return}p0.flush(),B1.flush(i?Math.min(64,ao-i):16.667),G1.flush(),k1.flush(),H1.flush()}function od(){let i=new Set,e=i;return{add(t){oo+=e==i&&!i.has(t)?1:0,i.add(t)},delete(t){return oo-=e==i&&i.has(t)?1:0,i.delete(t)},flush(t){e.size&&(i=new Set,oo-=e.size,vR(e,n=>n(t)&&i.add(n)),oo+=i.size,e=i)}}}function vR(i,e){i.forEach(t=>{try{e(t)}catch(n){Ct.catch(n)}})}var wH=Object.defineProperty,TH=(i,e)=>{for(var t in e)wH(i,t,{get:e[t],enumerable:!0})},cs={};TH(cs,{assign:()=>CH,colors:()=>co,createStringInterpolator:()=>X1,skipAnimation:()=>_R,to:()=>yR,willAdvance:()=>j1});function gx(){}var AH=(i,e,t)=>Object.defineProperty(i,e,{value:t,writable:!0,configurable:!0}),nt={arr:Array.isArray,obj:i=>!!i&&i.constructor.name==="Object",fun:i=>typeof i=="function",str:i=>typeof i=="string",num:i=>typeof i=="number",und:i=>i===void 0};function ua(i,e){if(nt.arr(i)){if(!nt.arr(e)||i.length!==e.length)return!1;for(let t=0;t<i.length;t++)if(i[t]!==e[t])return!1;return!0}return i===e}var rn=(i,e)=>i.forEach(e);function Ea(i,e,t){if(nt.arr(i)){for(let n=0;n<i.length;n++)e.call(t,i[n],`${n}`);return}for(const n in i)i.hasOwnProperty(n)&&e.call(t,i[n],n)}var Br=i=>nt.und(i)?[]:nt.arr(i)?i:[i];function pf(i,e){if(i.size){const t=Array.from(i);i.clear(),rn(t,e)}}var Qh=(i,...e)=>pf(i,t=>t(...e)),W1=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),X1,yR,co=null,_R=!1,j1=gx,CH=i=>{i.to&&(yR=i.to),i.now&&(Ct.now=i.now),i.colors!==void 0&&(co=i.colors),i.skipAnimation!=null&&(_R=i.skipAnimation),i.createStringInterpolator&&(X1=i.createStringInterpolator),i.requestAnimationFrame&&Ct.use(i.requestAnimationFrame),i.batchedUpdates&&(Ct.batchedUpdates=i.batchedUpdates),i.willAdvance&&(j1=i.willAdvance),i.frameLoop&&(Ct.frameLoop=i.frameLoop)},mf=new Set,zr=[],g_=[],gg=0,m0={get idle(){return!mf.size&&!zr.length},start(i){gg>i.priority?(mf.add(i),Ct.onStart(RH)):(xR(i),Ct(vx))},advance:vx,sort(i){if(gg)Ct.onFrame(()=>m0.sort(i));else{const e=zr.indexOf(i);~e&&(zr.splice(e,1),bR(i))}},clear(){zr=[],mf.clear()}};function RH(){mf.forEach(xR),mf.clear(),Ct(vx)}function xR(i){zr.includes(i)||bR(i)}function bR(i){zr.splice(DH(zr,e=>e.priority>i.priority),0,i)}function vx(i){const e=g_;for(let t=0;t<zr.length;t++){const n=zr[t];gg=n.priority,n.idle||(j1(n),n.advance(i),n.idle||e.push(n))}return gg=0,g_=zr,g_.length=0,zr=e,zr.length>0}function DH(i,e){const t=i.findIndex(e);return t<0?i.length:t}var UH={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},ls="[-+]?\\d*\\.?\\d+",vg=ls+"%";function g0(...i){return"\\(\\s*("+i.join(")\\s*,\\s*(")+")\\s*\\)"}var OH=new RegExp("rgb"+g0(ls,ls,ls)),LH=new RegExp("rgba"+g0(ls,ls,ls,ls)),IH=new RegExp("hsl"+g0(ls,vg,vg)),NH=new RegExp("hsla"+g0(ls,vg,vg,ls)),PH=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,zH=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,FH=/^#([0-9a-fA-F]{6})$/,BH=/^#([0-9a-fA-F]{8})$/;function kH(i){let e;return typeof i=="number"?i>>>0===i&&i>=0&&i<=4294967295?i:null:(e=FH.exec(i))?parseInt(e[1]+"ff",16)>>>0:co&&co[i]!==void 0?co[i]:(e=OH.exec(i))?(Yc(e[1])<<24|Yc(e[2])<<16|Yc(e[3])<<8|255)>>>0:(e=LH.exec(i))?(Yc(e[1])<<24|Yc(e[2])<<16|Yc(e[3])<<8|qw(e[4]))>>>0:(e=PH.exec(i))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+"ff",16)>>>0:(e=BH.exec(i))?parseInt(e[1],16)>>>0:(e=zH.exec(i))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+e[4]+e[4],16)>>>0:(e=IH.exec(i))?(Xw(jw(e[1]),Qp(e[2]),Qp(e[3]))|255)>>>0:(e=NH.exec(i))?(Xw(jw(e[1]),Qp(e[2]),Qp(e[3]))|qw(e[4]))>>>0:null}function v_(i,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?i+(e-i)*6*t:t<1/2?e:t<2/3?i+(e-i)*(2/3-t)*6:i}function Xw(i,e,t){const n=t<.5?t*(1+e):t+e-t*e,r=2*t-n,s=v_(r,n,i+1/3),a=v_(r,n,i),o=v_(r,n,i-1/3);return Math.round(s*255)<<24|Math.round(a*255)<<16|Math.round(o*255)<<8}function Yc(i){const e=parseInt(i,10);return e<0?0:e>255?255:e}function jw(i){return(parseFloat(i)%360+360)%360/360}function qw(i){const e=parseFloat(i);return e<0?0:e>1?255:Math.round(e*255)}function Qp(i){const e=parseFloat(i);return e<0?0:e>100?1:e/100}function Yw(i){let e=kH(i);if(e===null)return i;e=e||0;const t=(e&4278190080)>>>24,n=(e&16711680)>>>16,r=(e&65280)>>>8,s=(e&255)/255;return`rgba(${t}, ${n}, ${r}, ${s})`}var kf=(i,e,t)=>{if(nt.fun(i))return i;if(nt.arr(i))return kf({range:i,output:e,extrapolate:t});if(nt.str(i.output[0]))return X1(i);const n=i,r=n.output,s=n.range||[0,1],a=n.extrapolateLeft||n.extrapolate||"extend",o=n.extrapolateRight||n.extrapolate||"extend",l=n.easing||(c=>c);return c=>{const h=HH(c,s);return GH(c,s[h],s[h+1],r[h],r[h+1],l,a,o,n.map)}};function GH(i,e,t,n,r,s,a,o,l){let c=l?l(i):i;if(c<e){if(a==="identity")return c;a==="clamp"&&(c=e)}if(c>t){if(o==="identity")return c;o==="clamp"&&(c=t)}return n===r?n:e===t?i<=e?n:r:(e===-1/0?c=-c:t===1/0?c=c-e:c=(c-e)/(t-e),c=s(c),n===-1/0?c=-c:r===1/0?c=c+n:c=c*(r-n)+n,c)}function HH(i,e){for(var t=1;t<e.length-1&&!(e[t]>=i);++t);return t-1}var VH={linear:i=>i},Gf=Symbol.for("FluidValue.get"),_u=Symbol.for("FluidValue.observers"),Es=i=>!!(i&&i[Gf]),Ir=i=>i&&i[Gf]?i[Gf]():i,Zw=i=>i[_u]||null;function WH(i,e){i.eventObserved?i.eventObserved(e):i(e)}function yg(i,e){const t=i[_u];t&&t.forEach(n=>{WH(n,e)})}var XH=class{constructor(i){if(!i&&!(i=this.get))throw Error("Unknown getter");jH(this,i)}},jH=(i,e)=>SR(i,Gf,e);function ld(i,e){if(i[Gf]){let t=i[_u];t||SR(i,_u,t=new Set),t.has(e)||(t.add(e),i.observerAdded&&i.observerAdded(t.size,e))}return e}function _g(i,e){const t=i[_u];if(t&&t.has(e)){const n=t.size-1;n?t.delete(e):i[_u]=null,i.observerRemoved&&i.observerRemoved(n,e)}}var SR=(i,e,t)=>Object.defineProperty(i,e,{value:t,writable:!0,configurable:!0}),um=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,qH=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,Kw=new RegExp(`(${um.source})(%|[a-z]+)`,"i"),YH=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,v0=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,ER=i=>{const[e,t]=ZH(i);if(!e||W1())return i;const n=window.getComputedStyle(document.documentElement).getPropertyValue(e);if(n)return n.trim();if(t&&t.startsWith("--")){const r=window.getComputedStyle(document.documentElement).getPropertyValue(t);return r||i}else{if(t&&v0.test(t))return ER(t);if(t)return t}return i},ZH=i=>{const e=v0.exec(i);if(!e)return[,];const[,t,n]=e;return[t,n]},y_,KH=(i,e,t,n,r)=>`rgba(${Math.round(e)}, ${Math.round(t)}, ${Math.round(n)}, ${r})`,MR=i=>{y_||(y_=co?new RegExp(`(${Object.keys(co).join("|")})(?!\\w)`,"g"):/^\b$/);const e=i.output.map(s=>Ir(s).replace(v0,ER).replace(qH,Yw).replace(y_,Yw)),t=e.map(s=>s.match(um).map(Number)),r=t[0].map((s,a)=>t.map(o=>{if(!(a in o))throw Error('The arity of each "output" value must be equal');return o[a]})).map(s=>kf({...i,output:s}));return s=>{const a=!Kw.test(e[0])&&e.find(l=>Kw.test(l))?.replace(um,"");let o=0;return e[0].replace(um,()=>`${r[o++](s)}${a||""}`).replace(YH,KH)}},q1="react-spring: ",wR=i=>{const e=i;let t=!1;if(typeof e!="function")throw new TypeError(`${q1}once requires a function parameter`);return(...n)=>{t||(e(...n),t=!0)}},JH=wR(console.warn);function QH(){JH(`${q1}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var $H=wR(console.warn);function eV(){$H(`${q1}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function y0(i){return nt.str(i)&&(i[0]=="#"||/\d/.test(i)||!W1()&&v0.test(i)||i in(co||{}))}var Y1=W1()?K.useEffect:K.useLayoutEffect,tV=()=>{const i=K.useRef(!1);return Y1(()=>(i.current=!0,()=>{i.current=!1}),[]),i};function TR(){const i=K.useState()[1],e=tV();return()=>{e.current&&i(Math.random())}}var AR=i=>K.useEffect(i,nV),nV=[];function Jw(i){const e=K.useRef(void 0);return K.useEffect(()=>{e.current=i}),e.current}var Hf=Symbol.for("Animated:node"),iV=i=>!!i&&i[Hf]===i,Ss=i=>i&&i[Hf],Z1=(i,e)=>AH(i,Hf,e),_0=i=>i&&i[Hf]&&i[Hf].getPayload(),CR=class{constructor(){Z1(this,this)}getPayload(){return this.payload||[]}},x0=class RR extends CR{constructor(e){super(),this._value=e,this.done=!0,this.durationProgress=0,nt.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new RR(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return nt.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value===e?!1:(this._value=e,!0)}reset(){const{done:e}=this;this.done=!1,nt.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},xg=class DR extends x0{constructor(e){super(0),this._string=null,this._toString=kf({output:[e,e]})}static create(e){return new DR(e)}getValue(){const e=this._string;return e??(this._string=this._toString(this._value))}setValue(e){if(nt.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else if(super.setValue(e))this._string=null;else return!1;return!0}reset(e){e&&(this._toString=kf({output:[this.getValue(),e]})),this._value=0,super.reset()}},bg={dependencies:null},K1=class extends CR{constructor(i){super(),this.source=i,this.setValue(i)}getValue(i){const e={};return Ea(this.source,(t,n)=>{iV(t)?e[n]=t.getValue(i):Es(t)?e[n]=Ir(t):i||(e[n]=t)}),e}setValue(i){this.source=i,this.payload=this._makePayload(i)}reset(){this.payload&&rn(this.payload,i=>i.reset())}_makePayload(i){if(i){const e=new Set;return Ea(i,this._addToPayload,e),Array.from(e)}}_addToPayload(i){bg.dependencies&&Es(i)&&bg.dependencies.add(i);const e=_0(i);e&&rn(e,t=>this.add(t))}},rV=class UR extends K1{constructor(e){super(e)}static create(e){return new UR(e)}getValue(){return this.source.map(e=>e.getValue())}setValue(e){const t=this.getPayload();return e.length==t.length?t.map((n,r)=>n.setValue(e[r])).some(Boolean):(super.setValue(e.map(sV)),!0)}};function sV(i){return(y0(i)?xg:x0).create(i)}function yx(i){const e=Ss(i);return e?e.constructor:nt.arr(i)?rV:y0(i)?xg:x0}var Qw=(i,e)=>{const t=!nt.fun(i)||i.prototype&&i.prototype.isReactComponent;return K.forwardRef((n,r)=>{const s=K.useRef(null),a=t&&K.useCallback(v=>{s.current=lV(r,v)},[r]),[o,l]=oV(n,e),c=TR(),h=()=>{const v=s.current;if(t&&!v)return;(v?e.applyAnimatedValues(v,o.getValue(!0)):!1)===!1&&c()},d=new aV(h,l),p=K.useRef(void 0);Y1(()=>(p.current=d,rn(l,v=>ld(v,d)),()=>{p.current&&(rn(p.current.deps,v=>_g(v,p.current)),Ct.cancel(p.current.update))})),K.useEffect(h,[]),AR(()=>()=>{const v=p.current;rn(v.deps,x=>_g(x,v))});const m=e.getComponentProps(o.getValue());return K.createElement(i,{...m,ref:a})})},aV=class{constructor(i,e){this.update=i,this.deps=e}eventObserved(i){i.type=="change"&&Ct.write(this.update)}};function oV(i,e){const t=new Set;return bg.dependencies=t,i.style&&(i={...i,style:e.createAnimatedStyle(i.style)}),i=new K1(i),bg.dependencies=null,[i,t]}function lV(i,e){return i&&(nt.fun(i)?i(e):i.current=e),e}var $w=Symbol.for("AnimatedComponent"),cV=(i,{applyAnimatedValues:e=()=>!1,createAnimatedStyle:t=r=>new K1(r),getComponentProps:n=r=>r}={})=>{const r={applyAnimatedValues:e,createAnimatedStyle:t,getComponentProps:n},s=a=>{const o=eT(a)||"Anonymous";return nt.str(a)?a=s[a]||(s[a]=Qw(a,r)):a=a[$w]||(a[$w]=Qw(a,r)),a.displayName=`Animated(${o})`,a};return Ea(i,(a,o)=>{nt.arr(i)&&(o=eT(a)),s[o]=s(a)}),{animated:s}},eT=i=>nt.str(i)?i:i&&nt.str(i.displayName)?i.displayName:nt.fun(i)&&i.name||null;function ml(i,...e){return nt.fun(i)?i(...e):i}var gf=(i,e)=>i===!0||!!(e&&i&&(nt.fun(i)?i(e):Br(i).includes(e))),OR=(i,e)=>nt.obj(i)?e&&i[e]:i,LR=(i,e)=>i.default===!0?i[e]:i.default?i.default[e]:void 0,uV=i=>i,J1=(i,e=uV)=>{let t=hV;i.default&&i.default!==!0&&(i=i.default,t=Object.keys(i));const n={};for(const r of t){const s=e(i[r],r);nt.und(s)||(n[r]=s)}return n},hV=["config","onProps","onStart","onChange","onPause","onResume","onRest"],fV={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function dV(i){const e={};let t=0;if(Ea(i,(n,r)=>{fV[r]||(e[r]=n,t++)}),t)return e}function IR(i){const e=dV(i);if(e){const t={to:e};return Ea(i,(n,r)=>r in e||(t[r]=n)),t}return{...i}}function Vf(i){return i=Ir(i),nt.arr(i)?i.map(Vf):y0(i)?cs.createStringInterpolator({range:[0,1],output:[i,i]})(1):i}function pV(i){for(const e in i)return!0;return!1}function _x(i){return nt.fun(i)||nt.arr(i)&&nt.obj(i[0])}function mV(i,e){i.ref?.delete(i),e?.delete(i)}function gV(i,e){e&&i.ref!==e&&(i.ref?.delete(i),e.add(i),i.ref=e)}var vV={default:{tension:170,friction:26}},xx={...vV.default,mass:1,damping:1,easing:VH.linear,clamp:!1},yV=class{constructor(){this.velocity=0,Object.assign(this,xx)}};function _V(i,e,t){t&&(t={...t},tT(t,e),e={...t,...e}),tT(i,e),Object.assign(i,e);for(const a in xx)i[a]==null&&(i[a]=xx[a]);let{frequency:n,damping:r}=i;const{mass:s}=i;return nt.und(n)||(n<.01&&(n=.01),r<0&&(r=0),i.tension=Math.pow(2*Math.PI/n,2)*s,i.friction=4*Math.PI*r*s/n),i}function tT(i,e){if(!nt.und(e.decay))i.duration=void 0;else{const t=!nt.und(e.tension)||!nt.und(e.friction);(t||!nt.und(e.frequency)||!nt.und(e.damping)||!nt.und(e.mass))&&(i.duration=void 0,i.decay=void 0),t&&(i.frequency=void 0)}}var nT=[],xV=class{constructor(){this.changed=!1,this.values=nT,this.toValues=null,this.fromValues=nT,this.config=new yV,this.immediate=!1}};function NR(i,{key:e,props:t,defaultProps:n,state:r,actions:s}){return new Promise((a,o)=>{let l,c,h=gf(t.cancel??n?.cancel,e);if(h)m();else{nt.und(t.pause)||(r.paused=gf(t.pause,e));let v=n?.pause;v!==!0&&(v=r.paused||gf(v,e)),l=ml(t.delay||0,e),v?(r.resumeQueue.add(p),s.pause()):(s.resume(),p())}function d(){r.resumeQueue.add(p),r.timeouts.delete(c),c.cancel(),l=c.time-Ct.now()}function p(){l>0&&!cs.skipAnimation?(r.delayed=!0,c=Ct.setTimeout(m,l),r.pauseQueue.add(d),r.timeouts.add(c)):m()}function m(){r.delayed&&(r.delayed=!1),r.pauseQueue.delete(d),r.timeouts.delete(c),i<=(r.cancelId||0)&&(h=!0);try{s.start({...t,callId:i,cancel:h},a)}catch(v){o(v)}}})}var Q1=(i,e)=>e.length==1?e[0]:e.some(t=>t.cancelled)?ou(i.get()):e.every(t=>t.noop)?PR(i.get()):ss(i.get(),e.every(t=>t.finished)),PR=i=>({value:i,noop:!0,finished:!0,cancelled:!1}),ss=(i,e,t=!1)=>({value:i,finished:e,cancelled:t}),ou=i=>({value:i,cancelled:!0,finished:!1});function zR(i,e,t,n){const{callId:r,parentId:s,onRest:a}=e,{asyncTo:o,promise:l}=t;return!s&&i===o&&!e.reset?l:t.promise=(async()=>{t.asyncId=r,t.asyncTo=i;const c=J1(e,(_,g)=>g==="onRest"?void 0:_);let h,d;const p=new Promise((_,g)=>(h=_,d=g)),m=_=>{const g=r<=(t.cancelId||0)&&ou(n)||r!==t.asyncId&&ss(n,!1);if(g)throw _.result=g,d(_),_},v=(_,g)=>{const b=new iT,E=new rT;return(async()=>{if(cs.skipAnimation)throw Wf(t),E.result=ss(n,!1),d(E),E;m(b);const S=nt.obj(_)?{..._}:{...g,to:_};S.parentId=r,Ea(c,(T,R)=>{nt.und(S[R])&&(S[R]=T)});const w=await n.start(S);return m(b),t.paused&&await new Promise(T=>{t.resumeQueue.add(T)}),w})()};let x;if(cs.skipAnimation)return Wf(t),ss(n,!1);try{let _;nt.arr(i)?_=(async g=>{for(const b of g)await v(b)})(i):_=Promise.resolve(i(v,n.stop.bind(n))),await Promise.all([_.then(h),p]),x=ss(n.get(),!0,!1)}catch(_){if(_ instanceof iT)x=_.result;else if(_ instanceof rT)x=_.result;else throw _}finally{r==t.asyncId&&(t.asyncId=s,t.asyncTo=s?o:void 0,t.promise=s?l:void 0)}return nt.fun(a)&&Ct.batchedUpdates(()=>{a(x,n,n.item)}),x})()}function Wf(i,e){pf(i.timeouts,t=>t.cancel()),i.pauseQueue.clear(),i.resumeQueue.clear(),i.asyncId=i.asyncTo=i.promise=void 0,e&&(i.cancelId=e)}var iT=class extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},rT=class extends Error{constructor(){super("SkipAnimationSignal")}},bx=i=>i instanceof $1,bV=1,$1=class extends XH{constructor(){super(...arguments),this.id=bV++,this._priority=0}get priority(){return this._priority}set priority(i){this._priority!=i&&(this._priority=i,this._onPriorityChange(i))}get(){const i=Ss(this);return i&&i.getValue()}to(...i){return cs.to(this,i)}interpolate(...i){return QH(),cs.to(this,i)}toJSON(){return this.get()}observerAdded(i){i==1&&this._attach()}observerRemoved(i){i==0&&this._detach()}_attach(){}_detach(){}_onChange(i,e=!1){yg(this,{type:"change",parent:this,value:i,idle:e})}_onPriorityChange(i){this.idle||m0.sort(this),yg(this,{type:"priority",parent:this,priority:i})}},Ul=Symbol.for("SpringPhase"),FR=1,Sx=2,Ex=4,__=i=>(i[Ul]&FR)>0,to=i=>(i[Ul]&Sx)>0,kh=i=>(i[Ul]&Ex)>0,sT=(i,e)=>e?i[Ul]|=Sx|FR:i[Ul]&=~Sx,aT=(i,e)=>e?i[Ul]|=Ex:i[Ul]&=~Ex,SV=class extends $1{constructor(i,e){if(super(),this.animation=new xV,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!nt.und(i)||!nt.und(e)){const t=nt.obj(i)?{...i}:{...e,from:i};nt.und(t.default)&&(t.default=!0),this.start(t)}}get idle(){return!(to(this)||this._state.asyncTo)||kh(this)}get goal(){return Ir(this.animation.to)}get velocity(){const i=Ss(this);return i instanceof x0?i.lastVelocity||0:i.getPayload().map(e=>e.lastVelocity||0)}get hasAnimated(){return __(this)}get isAnimating(){return to(this)}get isPaused(){return kh(this)}get isDelayed(){return this._state.delayed}advance(i){let e=!0,t=!1;const n=this.animation;let{toValues:r}=n;const{config:s}=n,a=_0(n.to);!a&&Es(n.to)&&(r=Br(Ir(n.to))),n.values.forEach((c,h)=>{if(c.done)return;const d=c.constructor==xg?1:a?a[h].lastPosition:r[h];let p=n.immediate,m=d;if(!p){if(m=c.lastPosition,s.tension<=0){c.done=!0;return}let v=c.elapsedTime+=i;const x=n.fromValues[h],_=c.v0!=null?c.v0:c.v0=nt.arr(s.velocity)?s.velocity[h]:s.velocity;let g;const b=s.precision||(x==d?.005:Math.min(1,Math.abs(d-x)*.001));if(nt.und(s.duration))if(s.decay){const E=s.decay===!0?.998:s.decay,S=Math.exp(-(1-E)*v);m=x+_/(1-E)*(1-S),p=Math.abs(c.lastPosition-m)<=b,g=_*S}else{g=c.lastVelocity==null?_:c.lastVelocity;const E=s.restVelocity||b/10,S=s.clamp?0:s.bounce,w=!nt.und(S),T=x==d?c.v0>0:x<d;let R,U=!1;const A=1,D=Math.ceil(i/A);for(let L=0;L<D&&(R=Math.abs(g)>E,!(!R&&(p=Math.abs(d-m)<=b,p)));++L){w&&(U=m==d||m>d==T,U&&(g=-g*S,m=d));const P=-s.tension*1e-6*(m-d),I=-s.friction*.001*g,V=(P+I)/s.mass;g=g+V*A,m=m+g*A}}else{let E=1;s.duration>0&&(this._memoizedDuration!==s.duration&&(this._memoizedDuration=s.duration,c.durationProgress>0&&(c.elapsedTime=s.duration*c.durationProgress,v=c.elapsedTime+=i)),E=(s.progress||0)+v/this._memoizedDuration,E=E>1?1:E<0?0:E,c.durationProgress=E),m=x+s.easing(E)*(d-x),g=(m-c.lastPosition)/i,p=E==1}c.lastVelocity=g,Number.isNaN(m)&&(console.warn("Got NaN while animating:",this),p=!0)}a&&!a[h].done&&(p=!1),p?c.done=!0:e=!1,c.setValue(m,s.round)&&(t=!0)});const o=Ss(this),l=o.getValue();if(e){const c=Ir(n.to);(l!==c||t)&&!s.decay?(o.setValue(c),this._onChange(c)):t&&s.decay&&this._onChange(l),this._stop()}else t&&this._onChange(l)}set(i){return Ct.batchedUpdates(()=>{this._stop(),this._focus(i),this._set(i)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(to(this)){const{to:i,config:e}=this.animation;Ct.batchedUpdates(()=>{this._onStart(),e.decay||this._set(i,!1),this._stop()})}return this}update(i){return(this.queue||(this.queue=[])).push(i),this}start(i,e){let t;return nt.und(i)?(t=this.queue||[],this.queue=[]):t=[nt.obj(i)?i:{...e,to:i}],Promise.all(t.map(n=>this._update(n))).then(n=>Q1(this,n))}stop(i){const{to:e}=this.animation;return this._focus(this.get()),Wf(this._state,i&&this._lastCallId),Ct.batchedUpdates(()=>this._stop(e,i)),this}reset(){this._update({reset:!0})}eventObserved(i){i.type=="change"?this._start():i.type=="priority"&&(this.priority=i.priority+1)}_prepareNode(i){const e=this.key||"";let{to:t,from:n}=i;t=nt.obj(t)?t[e]:t,(t==null||_x(t))&&(t=void 0),n=nt.obj(n)?n[e]:n,n==null&&(n=void 0);const r={to:t,from:n};return __(this)||(i.reverse&&([t,n]=[n,t]),n=Ir(n),nt.und(n)?Ss(this)||this._set(t):this._set(n)),r}_update({...i},e){const{key:t,defaultProps:n}=this;i.default&&Object.assign(n,J1(i,(a,o)=>/^on/.test(o)?OR(a,t):a)),lT(this,i,"onProps"),Hh(this,"onProps",i,this);const r=this._prepareNode(i);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const s=this._state;return NR(++this._lastCallId,{key:t,props:i,defaultProps:n,state:s,actions:{pause:()=>{kh(this)||(aT(this,!0),Qh(s.pauseQueue),Hh(this,"onPause",ss(this,Gh(this,this.animation.to)),this))},resume:()=>{kh(this)&&(aT(this,!1),to(this)&&this._resume(),Qh(s.resumeQueue),Hh(this,"onResume",ss(this,Gh(this,this.animation.to)),this))},start:this._merge.bind(this,r)}}).then(a=>{if(i.loop&&a.finished&&!(e&&a.noop)){const o=BR(i);if(o)return this._update(o,!0)}return a})}_merge(i,e,t){if(e.cancel)return this.stop(!0),t(ou(this));const n=!nt.und(i.to),r=!nt.und(i.from);if(n||r)if(e.callId>this._lastToId)this._lastToId=e.callId;else return t(ou(this));const{key:s,defaultProps:a,animation:o}=this,{to:l,from:c}=o;let{to:h=l,from:d=c}=i;r&&!n&&(!e.default||nt.und(h))&&(h=d),e.reverse&&([h,d]=[d,h]);const p=!ua(d,c);p&&(o.from=d),d=Ir(d);const m=!ua(h,l);m&&this._focus(h);const v=_x(e.to),{config:x}=o,{decay:_,velocity:g}=x;(n||r)&&(x.velocity=0),e.config&&!v&&_V(x,ml(e.config,s),e.config!==a.config?ml(a.config,s):void 0);let b=Ss(this);if(!b||nt.und(h))return t(ss(this,!0));const E=nt.und(e.reset)?r&&!e.default:!nt.und(d)&&gf(e.reset,s),S=E?d:this.get(),w=Vf(h),T=nt.num(w)||nt.arr(w)||y0(w),R=!v&&(!T||gf(a.immediate||e.immediate,s));if(m){const L=yx(h);if(L!==b.constructor)if(R)b=this._set(w);else throw Error(`Cannot animate between ${b.constructor.name} and ${L.name}, as the "to" prop suggests`)}const U=b.constructor;let A=Es(h),D=!1;if(!A){const L=E||!__(this)&&p;(m||L)&&(D=ua(Vf(S),w),A=!D),(!ua(o.immediate,R)&&!R||!ua(x.decay,_)||!ua(x.velocity,g))&&(A=!0)}if(D&&to(this)&&(o.changed&&!E?A=!0:A||this._stop(l)),!v&&((A||Es(l))&&(o.values=b.getPayload(),o.toValues=Es(h)?null:U==xg?[1]:Br(w)),o.immediate!=R&&(o.immediate=R,!R&&!E&&this._set(l)),A)){const{onRest:L}=o;rn(MV,I=>lT(this,e,I));const P=ss(this,Gh(this,l));Qh(this._pendingCalls,P),this._pendingCalls.add(t),o.changed&&Ct.batchedUpdates(()=>{o.changed=!E,L?.(P,this),E?ml(a.onRest,P):o.onStart?.(P,this)})}E&&this._set(S),v?t(zR(e.to,e,this._state,this)):A?this._start():to(this)&&!m?this._pendingCalls.add(t):t(PR(S))}_focus(i){const e=this.animation;i!==e.to&&(Zw(this)&&this._detach(),e.to=i,Zw(this)&&this._attach())}_attach(){let i=0;const{to:e}=this.animation;Es(e)&&(ld(e,this),bx(e)&&(i=e.priority+1)),this.priority=i}_detach(){const{to:i}=this.animation;Es(i)&&_g(i,this)}_set(i,e=!0){const t=Ir(i);if(!nt.und(t)){const n=Ss(this);if(!n||!ua(t,n.getValue())){const r=yx(t);!n||n.constructor!=r?Z1(this,r.create(t)):n.setValue(t),n&&Ct.batchedUpdates(()=>{this._onChange(t,e)})}}return Ss(this)}_onStart(){const i=this.animation;i.changed||(i.changed=!0,Hh(this,"onStart",ss(this,Gh(this,i.to)),this))}_onChange(i,e){e||(this._onStart(),ml(this.animation.onChange,i,this)),ml(this.defaultProps.onChange,i,this),super._onChange(i,e)}_start(){const i=this.animation;Ss(this).reset(Ir(i.to)),i.immediate||(i.fromValues=i.values.map(e=>e.lastPosition)),to(this)||(sT(this,!0),kh(this)||this._resume())}_resume(){cs.skipAnimation?this.finish():m0.start(this)}_stop(i,e){if(to(this)){sT(this,!1);const t=this.animation;rn(t.values,r=>{r.done=!0}),t.toValues&&(t.onChange=t.onPause=t.onResume=void 0),yg(this,{type:"idle",parent:this});const n=e?ou(this.get()):ss(this.get(),Gh(this,i??t.to));Qh(this._pendingCalls,n),t.changed&&(t.changed=!1,Hh(this,"onRest",n,this))}}};function Gh(i,e){const t=Vf(e),n=Vf(i.get());return ua(n,t)}function BR(i,e=i.loop,t=i.to){const n=ml(e);if(n){const r=n!==!0&&IR(n),s=(r||i).reverse,a=!r||r.reset;return Xf({...i,loop:e,default:!1,pause:void 0,to:!s||_x(t)?t:void 0,from:a?i.from:void 0,reset:a,...r})}}function Xf(i){const{to:e,from:t}=i=IR(i),n=new Set;return nt.obj(e)&&oT(e,n),nt.obj(t)&&oT(t,n),i.keys=n.size?Array.from(n):null,i}function EV(i){const e=Xf(i);return nt.und(e.default)&&(e.default=J1(e)),e}function oT(i,e){Ea(i,(t,n)=>t!=null&&e.add(n))}var MV=["onStart","onRest","onChange","onPause","onResume"];function lT(i,e,t){i.animation[t]=e[t]!==LR(e,t)?OR(e[t],i.key):void 0}function Hh(i,e,...t){i.animation[e]?.(...t),i.defaultProps[e]?.(...t)}var wV=["onStart","onChange","onRest"],TV=1,AV=class{constructor(e,t){this.id=TV++,this.springs={},this.queue=[],this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(e=>e.idle&&!e.isDelayed&&!e.isPaused)}get item(){return this._item}set item(e){this._item=e}get(){const e={};return this.each((t,n)=>e[n]=t.get()),e}set(e){for(const t in e){const n=e[t];nt.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(Xf(e)),this}start(e){let{queue:t}=this;return e?t=Br(e).map(Xf):this.queue=[],this._flush?this._flush(this,t):(WR(this,t),Mx(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;rn(Br(t),r=>n[r].stop(!!e))}else Wf(this._state,this._lastAsyncId),this.each(n=>n.stop(!!e));return this}pause(e){if(nt.und(e))this.start({pause:!0});else{const t=this.springs;rn(Br(e),n=>t[n].pause())}return this}resume(e){if(nt.und(e))this.start({pause:!1});else{const t=this.springs;rn(Br(e),n=>t[n].resume())}return this}each(e){Ea(this.springs,e)}_onFrame(){const{onStart:e,onChange:t,onRest:n}=this._events,r=this._active.size>0,s=this._changed.size>0;(r&&!this._started||s&&!this._started)&&(this._started=!0,pf(e,([l,c])=>{c.value=this.get(),l(c,this,this._item)}));const a=!r&&this._started,o=s||a&&n.size?this.get():null;s&&t.size&&pf(t,([l,c])=>{c.value=o,l(c,this,this._item)}),a&&(this._started=!1,pf(n,([l,c])=>{c.value=o,l(c,this,this._item)}))}eventObserved(e){if(e.type=="change")this._changed.add(e.parent),e.idle||this._active.add(e.parent);else if(e.type=="idle")this._active.delete(e.parent);else return;Ct.onFrame(this._onFrame)}};function Mx(i,e){return Promise.all(e.map(t=>kR(i,t))).then(t=>Q1(i,t))}async function kR(i,e,t){const{keys:n,to:r,from:s,loop:a,onRest:o,onResolve:l}=e,c=nt.obj(e.default)&&e.default;a&&(e.loop=!1),r===!1&&(e.to=null),s===!1&&(e.from=null);const h=nt.arr(r)||nt.fun(r)?r:void 0;h?(e.to=void 0,e.onRest=void 0,c&&(c.onRest=void 0)):rn(wV,x=>{const _=e[x];if(nt.fun(_)){const g=i._events[x];e[x]=({finished:b,cancelled:E})=>{const S=g.get(_);S?(b||(S.finished=!1),E&&(S.cancelled=!0)):g.set(_,{value:null,finished:b||!1,cancelled:E||!1})},c&&(c[x]=e[x])}});const d=i._state;e.pause===!d.paused?(d.paused=e.pause,Qh(e.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(e.pause=!0);const p=(n||Object.keys(i.springs)).map(x=>i.springs[x].start(e)),m=e.cancel===!0||LR(e,"cancel")===!0;(h||m&&d.asyncId)&&p.push(NR(++i._lastAsyncId,{props:e,state:d,actions:{pause:gx,resume:gx,start(x,_){m?(Wf(d,i._lastAsyncId),_(ou(i))):(x.onRest=o,_(zR(h,x,d,i)))}}})),d.paused&&await new Promise(x=>{d.resumeQueue.add(x)});const v=Q1(i,await Promise.all(p));if(a&&v.finished&&!(t&&v.noop)){const x=BR(e,a,r);if(x)return WR(i,[x]),kR(i,x,!0)}return l&&Ct.batchedUpdates(()=>l(v,i,i.item)),v}function cT(i,e){const t={...i.springs};return e&&rn(Br(e),n=>{nt.und(n.keys)&&(n=Xf(n)),nt.obj(n.to)||(n={...n,to:void 0}),VR(t,n,r=>HR(r))}),GR(i,t),t}function GR(i,e){Ea(e,(t,n)=>{i.springs[n]||(i.springs[n]=t,ld(t,i))})}function HR(i,e){const t=new SV;return t.key=i,e&&ld(t,e),t}function VR(i,e,t){e.keys&&rn(e.keys,n=>{(i[n]||(i[n]=t(n)))._prepareNode(e)})}function WR(i,e){rn(e,t=>{VR(i.springs,t,n=>HR(n,i))})}var CV=K.createContext({pause:!1,immediate:!1}),RV=()=>{const i=[],e=function(n){eV();const r=[];return rn(i,(s,a)=>{if(nt.und(n))r.push(s.start());else{const o=t(n,s,a);o&&r.push(s.start(o))}}),r};e.current=i,e.add=function(n){i.includes(n)||i.push(n)},e.delete=function(n){const r=i.indexOf(n);~r&&i.splice(r,1)},e.pause=function(){return rn(i,n=>n.pause(...arguments)),this},e.resume=function(){return rn(i,n=>n.resume(...arguments)),this},e.set=function(n){rn(i,(r,s)=>{const a=nt.fun(n)?n(s,r):n;a&&r.set(a)})},e.start=function(n){const r=[];return rn(i,(s,a)=>{if(nt.und(n))r.push(s.start());else{const o=this._getProps(n,s,a);o&&r.push(s.start(o))}}),r},e.stop=function(){return rn(i,n=>n.stop(...arguments)),this},e.update=function(n){return rn(i,(r,s)=>r.update(this._getProps(n,r,s))),this};const t=function(n,r,s){return nt.fun(n)?n(s,r):n};return e._getProps=t,e};function DV(i,e,t){const n=nt.fun(e)&&e;n&&!t&&(t=[]);const r=K.useMemo(()=>n||arguments.length==3?RV():void 0,[]),s=K.useRef(0),a=TR(),o=K.useMemo(()=>({ctrls:[],queue:[],flush(g,b){const E=cT(g,b);return s.current>0&&!o.queue.length&&!Object.keys(E).some(w=>!g.springs[w])?Mx(g,b):new Promise(w=>{GR(g,E),o.queue.push(()=>{w(Mx(g,b))}),a()})}}),[]),l=K.useRef([...o.ctrls]),c=K.useRef([]),h=Jw(i)||0;K.useMemo(()=>{rn(l.current.slice(i,h),g=>{mV(g,r),g.stop(!0)}),l.current.length=i,d(h,i)},[i]),K.useMemo(()=>{d(0,Math.min(h,i))},t);function d(g,b){for(let E=g;E<b;E++){const S=l.current[E]||(l.current[E]=new AV(null,o.flush)),w=n?n(E,S):e[E];w&&(c.current[E]=EV(w))}}const p=l.current.map((g,b)=>cT(g,c.current[b])),m=K.useContext(CV),v=Jw(m),x=m!==v&&pV(m);Y1(()=>{s.current++,o.ctrls=l.current;const{queue:g}=o;g.length&&(o.queue=[],rn(g,b=>b())),rn(l.current,(b,E)=>{r?.add(b),x&&b.start({default:m});const S=c.current[E];S&&(gV(b,S.ref),b.ref?b.queue.push(S):b.start(S))})}),AR(()=>()=>{rn(o.ctrls,g=>g.stop(!0))});const _=p.map(g=>({...g}));return r?[_,r]:_}function er(i,e){const t=nt.fun(i),[[n],r]=DV(1,t?i:[i],t?e||[]:e);return t||arguments.length==2?[n,r]:n}var UV=class extends $1{constructor(i,e){super(),this.source=i,this.idle=!0,this._active=new Set,this.calc=kf(...e);const t=this._get(),n=yx(t);Z1(this,n.create(t))}advance(i){const e=this._get(),t=this.get();ua(e,t)||(Ss(this).setValue(e),this._onChange(e,this.idle)),!this.idle&&uT(this._active)&&x_(this)}_get(){const i=nt.arr(this.source)?this.source.map(Ir):Br(Ir(this.source));return this.calc(...i)}_start(){this.idle&&!uT(this._active)&&(this.idle=!1,rn(_0(this),i=>{i.done=!1}),cs.skipAnimation?(Ct.batchedUpdates(()=>this.advance()),x_(this)):m0.start(this))}_attach(){let i=1;rn(Br(this.source),e=>{Es(e)&&ld(e,this),bx(e)&&(e.idle||this._active.add(e),i=Math.max(i,e.priority+1))}),this.priority=i,this._start()}_detach(){rn(Br(this.source),i=>{Es(i)&&_g(i,this)}),this._active.clear(),x_(this)}eventObserved(i){i.type=="change"?i.idle?this.advance():(this._active.add(i.parent),this._start()):i.type=="idle"?this._active.delete(i.parent):i.type=="priority"&&(this.priority=Br(this.source).reduce((e,t)=>Math.max(e,(bx(t)?t.priority:0)+1),0))}};function OV(i){return i.idle!==!1}function uT(i){return!i.size||Array.from(i).every(OV)}function x_(i){i.idle||(i.idle=!0,rn(_0(i),e=>{e.done=!0}),yg(i,{type:"idle",parent:i}))}cs.assign({createStringInterpolator:MR,to:(i,e)=>new UV(i,e)});var LV=["primitive"].concat(Object.keys(xC).filter(i=>/^[A-Z]/.test(i)).map(i=>i[0].toLowerCase()+i.slice(1)));cs.assign({createStringInterpolator:MR,colors:UH,frameLoop:"demand"});R5(()=>{Ct.advance()});var IV=cV(LV,{applyAnimatedValues:pa}),An=IV.animated;const cd=new j,eb=new j,NV=new j,hT=new ke;function PV(i,e,t){const n=cd.setFromMatrixPosition(i.matrixWorld);n.project(e);const r=t.width/2,s=t.height/2;return[n.x*r+r,-(n.y*s)+s]}function zV(i,e){const t=cd.setFromMatrixPosition(i.matrixWorld),n=eb.setFromMatrixPosition(e.matrixWorld),r=t.sub(n),s=e.getWorldDirection(NV);return r.angleTo(s)>Math.PI/2}function FV(i,e,t,n){const r=cd.setFromMatrixPosition(i.matrixWorld),s=r.clone();s.project(e),hT.set(s.x,s.y),t.setFromCamera(hT,e);const a=t.intersectObjects(n,!0);if(a.length){const o=a[0].distance;return r.distanceTo(t.ray.origin)<o}return!0}function BV(i,e){if(e instanceof Pl)return e.zoom;if(e instanceof Kn){const t=cd.setFromMatrixPosition(i.matrixWorld),n=eb.setFromMatrixPosition(e.matrixWorld),r=e.fov*Math.PI/180,s=t.distanceTo(n);return 1/(2*Math.tan(r/2)*s)}else return 1}function kV(i,e,t){if(e instanceof Kn||e instanceof Pl){const n=cd.setFromMatrixPosition(i.matrixWorld),r=eb.setFromMatrixPosition(e.matrixWorld),s=n.distanceTo(r),a=(t[1]-t[0])/(e.far-e.near),o=t[1]-a*e.far;return Math.round(a*s+o)}}const wx=i=>Math.abs(i)<1e-10?0:i;function XR(i,e,t=""){let n="matrix3d(";for(let r=0;r!==16;r++)n+=wx(e[r]*i.elements[r])+(r!==15?",":")");return t+n}const GV=(i=>e=>XR(e,i))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),HV=(i=>(e,t)=>XR(e,i(t),"translate(-50%,-50%)"))(i=>[1/i,1/i,1/i,1,-1/i,-1/i,-1/i,-1,1/i,1/i,1/i,1,1,1,1,1]);function VV(i){return i&&typeof i=="object"&&"current"in i}const tb=K.forwardRef(({children:i,eps:e=.001,style:t,className:n,prepend:r,center:s,fullscreen:a,portal:o,distanceFactor:l,sprite:c=!1,transform:h=!1,occlude:d,onOcclude:p,castShadow:m,receiveShadow:v,material:x,geometry:_,zIndexRange:g=[16777271,0],calculatePosition:b=PV,as:E="div",wrapperClass:S,pointerEvents:w="auto",...T},R)=>{const{gl:U,camera:A,scene:D,size:L,raycaster:P,events:I,viewport:V}=Jn(),[H]=K.useState(()=>document.createElement(E)),z=K.useRef(null),O=K.useRef(null),B=K.useRef(0),G=K.useRef([0,0]),X=K.useRef(null),k=K.useRef(null),Y=o?.current||I.connected||U.domElement.parentNode,Q=K.useRef(null),te=K.useRef(!1),ee=K.useMemo(()=>d&&d!=="blending"||Array.isArray(d)&&d.length&&VV(d[0]),[d]);K.useLayoutEffect(()=>{const Me=U.domElement;d&&d==="blending"?(Me.style.zIndex=`${Math.floor(g[0]/2)}`,Me.style.position="absolute",Me.style.pointerEvents="none"):(Me.style.zIndex=null,Me.style.position=null,Me.style.pointerEvents=null)},[d]),K.useLayoutEffect(()=>{if(O.current){const Me=z.current=VU.createRoot(H);if(D.updateMatrixWorld(),h)H.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{const ve=b(O.current,A,L);H.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${ve[0]}px,${ve[1]}px,0);transform-origin:0 0;`}return Y&&(r?Y.prepend(H):Y.appendChild(H)),()=>{Y&&Y.removeChild(H),Me.unmount()}}},[Y,h]),K.useLayoutEffect(()=>{S&&(H.className=S)},[S]);const ie=K.useMemo(()=>h?{position:"absolute",top:0,left:0,width:L.width,height:L.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:s?"translate3d(-50%,-50%,0)":"none",...a&&{top:-L.height/2,left:-L.width/2,width:L.width,height:L.height},...t},[t,s,a,L,h]),re=K.useMemo(()=>({position:"absolute",pointerEvents:w}),[w]);K.useLayoutEffect(()=>{if(te.current=!1,h){var Me;(Me=z.current)==null||Me.render(K.createElement("div",{ref:X,style:ie},K.createElement("div",{ref:k,style:re},K.createElement("div",{ref:R,className:n,style:t,children:i}))))}else{var ve;(ve=z.current)==null||ve.render(K.createElement("div",{ref:R,style:ie,className:n,children:i}))}});const de=K.useRef(!0);u0(Me=>{if(O.current){A.updateMatrixWorld(),O.current.updateWorldMatrix(!0,!1);const ve=h?G.current:b(O.current,A,L);if(h||Math.abs(B.current-A.zoom)>e||Math.abs(G.current[0]-ve[0])>e||Math.abs(G.current[1]-ve[1])>e){const fe=zV(O.current,A);let J=!1;ee&&(Array.isArray(d)?J=d.map(pe=>pe.current):d!=="blending"&&(J=[D]));const oe=de.current;if(J){const pe=FV(O.current,A,P,J);de.current=pe&&!fe}else de.current=!fe;oe!==de.current&&(p?p(!de.current):H.style.display=de.current?"block":"none");const se=Math.floor(g[0]/2),$=d?ee?[g[0],se]:[se-1,0]:g;if(H.style.zIndex=`${kV(O.current,A,$)}`,h){const[pe,ye]=[L.width/2,L.height/2],xe=A.projectionMatrix.elements[5]*ye,{isOrthographicCamera:be,top:ue,left:He,bottom:W,right:F}=A,ne=GV(A.matrixWorldInverse),Se=be?`scale(${xe})translate(${wx(-(F+He)/2)}px,${wx((ue+W)/2)}px)`:`translateZ(${xe}px)`;let _e=O.current.matrixWorld;c&&(_e=A.matrixWorldInverse.clone().transpose().copyPosition(_e).scale(O.current.scale),_e.elements[3]=_e.elements[7]=_e.elements[11]=0,_e.elements[15]=1),H.style.width=L.width+"px",H.style.height=L.height+"px",H.style.perspective=be?"":`${xe}px`,X.current&&k.current&&(X.current.style.transform=`${Se}${ne}translate(${pe}px,${ye}px)`,k.current.style.transform=HV(_e,1/((l||10)/400)))}else{const pe=l===void 0?1:BV(O.current,A)*l;H.style.transform=`translate3d(${ve[0]}px,${ve[1]}px,0) scale(${pe})`}G.current=ve,B.current=A.zoom}}if(!ee&&Q.current&&!te.current)if(h){if(X.current){const ve=X.current.children[0];if(ve!=null&&ve.clientWidth&&ve!=null&&ve.clientHeight){const{isOrthographicCamera:fe}=A;if(fe||_)T.scale&&(Array.isArray(T.scale)?T.scale instanceof j?Q.current.scale.copy(T.scale.clone().divideScalar(1)):Q.current.scale.set(1/T.scale[0],1/T.scale[1],1/T.scale[2]):Q.current.scale.setScalar(1/T.scale));else{const J=(l||10)/400,oe=ve.clientWidth*J,se=ve.clientHeight*J;Q.current.scale.set(oe,se,1)}te.current=!0}}}else{const ve=H.children[0];if(ve!=null&&ve.clientWidth&&ve!=null&&ve.clientHeight){const fe=1/V.factor,J=ve.clientWidth*fe,oe=ve.clientHeight*fe;Q.current.scale.set(J,oe,1),te.current=!0}Q.current.lookAt(Me.camera.position)}});const Ae=K.useMemo(()=>({vertexShader:h?void 0:`
|
|
3844
3844
|
/*
|
|
3845
3845
|
This shader is from the THREE's SpriteMaterial.
|
|
3846
3846
|
We need to turn the backing plane into a Sprite
|
|
@@ -3877,7 +3877,7 @@ No matching component was found for:
|
|
|
3877
3877
|
void main() {
|
|
3878
3878
|
gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
|
|
3879
3879
|
}
|
|
3880
|
-
`}),[h]);return K.createElement("group",Zf({},T,{ref:O}),d&&!ee&&K.createElement("mesh",{castShadow:m,receiveShadow:v,ref:Q},_||K.createElement("planeGeometry",null),x||K.createElement("shaderMaterial",{side:zn,vertexShader:Ae.vertexShader,fragmentShader:Ae.fragmentShader})))});function Ml(i,e="pointer",t="auto",n=document.body){K.useEffect(()=>{if(i)return n.style.cursor=e,()=>void(n.style.cursor=t)},[i])}function WV(i,e,t){return Math.max(e,Math.min(i,t))}const _n={toVector(i,e){return i===void 0&&(i=e),Array.isArray(i)?i:[i,i]},add(i,e){return[i[0]+e[0],i[1]+e[1]]},sub(i,e){return[i[0]-e[0],i[1]-e[1]]},addTo(i,e){i[0]+=e[0],i[1]+=e[1]},subTo(i,e){i[0]-=e[0],i[1]-=e[1]}};function fT(i,e,t){return e===0||Math.abs(e)===1/0?Math.pow(i,t*5):i*e*t/(e+t*i)}function dT(i,e,t,n=.15){return n===0?WV(i,e,t):i<e?-fT(e-i,t-e,n)+e:i>t?+fT(i-t,t-e,n)+t:i}function XV(i,[e,t],[n,r]){const[[s,a],[o,l]]=i;return[dT(e,s,a,n),dT(t,o,l,r)]}function jV(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function qV(i){var e=jV(i,"string");return typeof e=="symbol"?e:String(e)}function Zn(i,e,t){return e=qV(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function pT(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),t.push.apply(t,n)}return t}function Cn(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?pT(Object(t),!0).forEach(function(n){Zn(i,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):pT(Object(t)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(t,n))})}return i}const jR={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function mT(i){return i?i[0].toUpperCase()+i.slice(1):""}const YV=["enter","leave"];function ZV(i=!1,e){return i&&!YV.includes(e)}function KV(i,e="",t=!1){const n=jR[i],r=n&&n[e]||e;return"on"+mT(i)+mT(r)+(ZV(t,r)?"Capture":"")}const JV=["gotpointercapture","lostpointercapture"];function QV(i){let e=i.substring(2).toLowerCase();const t=!!~e.indexOf("passive");t&&(e=e.replace("passive",""));const n=JV.includes(e)?"capturecapture":"capture",r=!!~e.indexOf(n);return r&&(e=e.replace("capture","")),{device:e,capture:r,passive:t}}function $V(i,e=""){const t=jR[i],n=t&&t[e]||e;return i+n}function b0(i){return"touches"in i}function qR(i){return b0(i)?"touch":"pointerType"in i?i.pointerType:"mouse"}function e6(i){return Array.from(i.touches).filter(e=>{var t,n;return e.target===i.currentTarget||((t=i.currentTarget)===null||t===void 0||(n=t.contains)===null||n===void 0?void 0:n.call(t,e.target))})}function t6(i){return i.type==="touchend"||i.type==="touchcancel"?i.changedTouches:i.targetTouches}function YR(i){return b0(i)?t6(i)[0]:i}function Tx(i,e){try{const t=e.clientX-i.clientX,n=e.clientY-i.clientY,r=(e.clientX+i.clientX)/2,s=(e.clientY+i.clientY)/2,a=Math.hypot(t,n);return{angle:-(Math.atan2(t,n)*180)/Math.PI,distance:a,origin:[r,s]}}catch{}return null}function n6(i){return e6(i).map(e=>e.identifier)}function gT(i,e){const[t,n]=Array.from(i.touches).filter(r=>e.includes(r.identifier));return Tx(t,n)}function b_(i){const e=YR(i);return b0(i)?e.identifier:e.pointerId}function xu(i){const e=YR(i);return[e.clientX,e.clientY]}const vT=40,yT=800;function ZR(i){let{deltaX:e,deltaY:t,deltaMode:n}=i;return n===1?(e*=vT,t*=vT):n===2&&(e*=yT,t*=yT),[e,t]}function i6(i){var e,t;const{scrollX:n,scrollY:r,scrollLeft:s,scrollTop:a}=i.currentTarget;return[(e=n??s)!==null&&e!==void 0?e:0,(t=r??a)!==null&&t!==void 0?t:0]}function r6(i){const e={};if("buttons"in i&&(e.buttons=i.buttons),"shiftKey"in i){const{shiftKey:t,altKey:n,metaKey:r,ctrlKey:s}=i;Object.assign(e,{shiftKey:t,altKey:n,metaKey:r,ctrlKey:s})}return e}function Sg(i,...e){return typeof i=="function"?i(...e):i}function s6(){}function a6(...i){return i.length===0?s6:i.length===1?i[0]:function(){let e;for(const t of i)e=t.apply(this,arguments)||e;return e}}function _T(i,e){return Object.assign({},e,i||{})}const o6=32;class KR{constructor(e,t,n){this.ctrl=e,this.args=t,this.key=n,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:e,shared:t,ingKey:n,args:r}=this;t[n]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=r,e.axis=void 0,e.memo=void 0,e.elapsedTime=e.timeDelta=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){const t=this.state,n=this.config;t._active||(this.reset(),this.computeInitial(),t._active=!0,t.target=e.target,t.currentTarget=e.currentTarget,t.lastOffset=n.from?Sg(n.from,t):t.offset,t.offset=t.lastOffset,t.startTime=t.timeStamp=e.timeStamp)}computeValues(e){const t=this.state;t._values=e,t.values=this.config.transform(e)}computeInitial(){const e=this.state;e._initial=e._values,e.initial=e.values}compute(e){const{state:t,config:n,shared:r}=this;t.args=this.args;let s=0;if(e&&(t.event=e,n.preventDefault&&e.cancelable&&t.event.preventDefault(),t.type=e.type,r.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,r.locked=!!document.pointerLockElement,Object.assign(r,r6(e)),r.down=r.pressed=r.buttons%2===1||r.touches>0,s=e.timeStamp-t.timeStamp,t.timeStamp=e.timeStamp,t.elapsedTime=t.timeStamp-t.startTime),t._active){const T=t._delta.map(Math.abs);_n.addTo(t._distance,T)}this.axisIntent&&this.axisIntent(e);const[a,o]=t._movement,[l,c]=n.threshold,{_step:h,values:d}=t;if(n.hasCustomTransform?(h[0]===!1&&(h[0]=Math.abs(a)>=l&&d[0]),h[1]===!1&&(h[1]=Math.abs(o)>=c&&d[1])):(h[0]===!1&&(h[0]=Math.abs(a)>=l&&Math.sign(a)*l),h[1]===!1&&(h[1]=Math.abs(o)>=c&&Math.sign(o)*c)),t.intentional=h[0]!==!1||h[1]!==!1,!t.intentional)return;const p=[0,0];if(n.hasCustomTransform){const[T,R]=d;p[0]=h[0]!==!1?T-h[0]:0,p[1]=h[1]!==!1?R-h[1]:0}else p[0]=h[0]!==!1?a-h[0]:0,p[1]=h[1]!==!1?o-h[1]:0;this.restrictToAxis&&!t._blocked&&this.restrictToAxis(p);const m=t.offset,v=t._active&&!t._blocked||t.active;v&&(t.first=t._active&&!t.active,t.last=!t._active&&t.active,t.active=r[this.ingKey]=t._active,e&&(t.first&&("bounds"in n&&(t._bounds=Sg(n.bounds,t)),this.setup&&this.setup()),t.movement=p,this.computeOffset()));const[x,_]=t.offset,[[g,b],[E,S]]=t._bounds;t.overflow=[x<g?-1:x>b?1:0,_<E?-1:_>S?1:0],t._movementBound[0]=t.overflow[0]?t._movementBound[0]===!1?t._movement[0]:t._movementBound[0]:!1,t._movementBound[1]=t.overflow[1]?t._movementBound[1]===!1?t._movement[1]:t._movementBound[1]:!1;const w=t._active?n.rubberband||[0,0]:[0,0];if(t.offset=XV(t._bounds,t.offset,w),t.delta=_n.sub(t.offset,m),this.computeMovement(),v&&(!t.last||s>o6)){t.delta=_n.sub(t.offset,m);const T=t.delta.map(Math.abs);_n.addTo(t.distance,T),t.direction=t.delta.map(Math.sign),t._direction=t._delta.map(Math.sign),!t.first&&s>0&&(t.velocity=[T[0]/s,T[1]/s],t.timeDelta=s)}}emit(){const e=this.state,t=this.shared,n=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!n.triggerAllEvents)return;const r=this.handler(Cn(Cn(Cn({},t),e),{},{[this.aliasKey]:e.values}));r!==void 0&&(e.memo=r)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function l6([i,e],t){const n=Math.abs(i),r=Math.abs(e);if(n>r&&n>t)return"x";if(r>n&&r>t)return"y"}class ud extends KR{constructor(...e){super(...e),Zn(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=_n.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=_n.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){const t=this.state,n=this.config;if(!t.axis&&e){const r=typeof n.axisThreshold=="object"?n.axisThreshold[qR(e)]:n.axisThreshold;t.axis=l6(t._movement,r)}t._blocked=(n.lockDirection||!!n.axis)&&!t.axis||!!n.axis&&n.axis!==t.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0;break}}}const c6=i=>i,xT=.15,JR={enabled(i=!0){return i},eventOptions(i,e,t){return Cn(Cn({},t.shared.eventOptions),i)},preventDefault(i=!1){return i},triggerAllEvents(i=!1){return i},rubberband(i=0){switch(i){case!0:return[xT,xT];case!1:return[0,0];default:return _n.toVector(i)}},from(i){if(typeof i=="function")return i;if(i!=null)return _n.toVector(i)},transform(i,e,t){const n=i||t.shared.transform;return this.hasCustomTransform=!!n,n||c6},threshold(i){return _n.toVector(i,0)}},u6=0,zl=Cn(Cn({},JR),{},{axis(i,e,{axis:t}){if(this.lockDirection=t==="lock",!this.lockDirection)return t},axisThreshold(i=u6){return i},bounds(i={}){if(typeof i=="function")return s=>zl.bounds(i(s));if("current"in i)return()=>i.current;if(typeof HTMLElement=="function"&&i instanceof HTMLElement)return i;const{left:e=-1/0,right:t=1/0,top:n=-1/0,bottom:r=1/0}=i;return[[e,t],[n,r]]}}),bT={ArrowRight:(i,e=1)=>[i*e,0],ArrowLeft:(i,e=1)=>[-1*i*e,0],ArrowUp:(i,e=1)=>[0,-1*i*e],ArrowDown:(i,e=1)=>[0,i*e]};class h6 extends ud{constructor(...e){super(...e),Zn(this,"ingKey","dragging")}reset(){super.reset();const e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){const e=this.state;if(e._bounds instanceof HTMLElement){const t=e._bounds.getBoundingClientRect(),n=e.currentTarget.getBoundingClientRect(),r={left:t.left-n.left+e.offset[0],right:t.right-n.right+e.offset[0],top:t.top-n.top+e.offset[1],bottom:t.bottom-n.bottom+e.offset[1]};e._bounds=zl.bounds(r)}}cancel(){const e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){const t=this.config,n=this.state;if(e.buttons!=null&&(Array.isArray(t.pointerButtons)?!t.pointerButtons.includes(e.buttons):t.pointerButtons!==-1&&t.pointerButtons!==e.buttons))return;const r=this.ctrl.setEventIds(e);t.pointerCapture&&e.target.setPointerCapture(e.pointerId),!(r&&r.size>1&&n._pointerActive)&&(this.start(e),this.setupPointer(e),n._pointerId=b_(e),n._pointerActive=!0,this.computeValues(xu(e)),this.computeInitial(),t.preventScrollAxis&&qR(e)!=="mouse"?(n._active=!1,this.setupScrollPrevention(e)):t.delay>0?(this.setupDelayTrigger(e),t.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e))}startPointerDrag(e){const t=this.state;t._active=!0,t._preventScroll=!0,t._delayed=!1,this.compute(e),this.emit()}pointerMove(e){const t=this.state,n=this.config;if(!t._pointerActive)return;const r=b_(e);if(t._pointerId!==void 0&&r!==t._pointerId)return;const s=xu(e);if(document.pointerLockElement===e.target?t._delta=[e.movementX,e.movementY]:(t._delta=_n.sub(s,t._values),this.computeValues(s)),_n.addTo(t._movement,t._delta),this.compute(e),t._delayed&&t.intentional){this.timeoutStore.remove("dragDelay"),t.active=!1,this.startPointerDrag(e);return}if(n.preventScrollAxis&&!t._preventScroll)if(t.axis)if(t.axis===n.preventScrollAxis||n.preventScrollAxis==="xy"){t._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(e);return}else return;this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch{}const t=this.state,n=this.config;if(!t._active||!t._pointerActive)return;const r=b_(e);if(t._pointerId!==void 0&&r!==t._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);const[s,a]=t._distance;if(t.tap=s<=n.tapsThreshold&&a<=n.tapsThreshold,t.tap&&n.filterTaps)t._force=!0;else{const[o,l]=t._delta,[c,h]=t._movement,[d,p]=n.swipe.velocity,[m,v]=n.swipe.distance,x=n.swipe.duration;if(t.elapsedTime<x){const _=Math.abs(o/t.timeDelta),g=Math.abs(l/t.timeDelta);_>d&&Math.abs(c)>m&&(t.swipe[0]=Math.sign(o)),g>p&&Math.abs(h)>v&&(t.swipe[1]=Math.sign(l))}}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){const t=this.config,n=t.device;t.pointerLock&&e.currentTarget.requestPointerLock(),t.pointerCapture||(this.eventStore.add(this.sharedConfig.window,n,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,n,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,n,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){this.state._preventScroll=!1,f6(e);const t=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",t),this.eventStore.add(this.sharedConfig.window,"touch","cancel",t),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(e)},this.config.delay)}keyDown(e){const t=bT[e.key];if(t){const n=this.state,r=e.shiftKey?10:e.altKey?.1:1;this.start(e),n._delta=t(this.config.keyboardDisplacement,r),n._keyboardActive=!0,_n.addTo(n._movement,n._delta),this.compute(e),this.emit()}}keyUp(e){e.key in bT&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){const t=this.config.device;e(t,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(e(t,"change",this.pointerMove.bind(this)),e(t,"end",this.pointerUp.bind(this)),e(t,"cancel",this.pointerUp.bind(this)),e("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(e("key","down",this.keyDown.bind(this)),e("key","up",this.keyUp.bind(this))),this.config.filterTaps&&e("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}}function f6(i){"persist"in i&&typeof i.persist=="function"&&i.persist()}const hd=typeof window<"u"&&window.document&&window.document.createElement;function QR(){return hd&&"ontouchstart"in window}function d6(){return QR()||hd&&window.navigator.maxTouchPoints>1}function p6(){return hd&&"onpointerdown"in window}function m6(){return hd&&"exitPointerLock"in window.document}function g6(){try{return"constructor"in GestureEvent}catch{return!1}}const Nr={isBrowser:hd,gesture:g6(),touch:QR(),touchscreen:d6(),pointer:p6(),pointerLock:m6()},v6=250,y6=180,_6=.5,x6=50,b6=250,S6=10,ST={mouse:0,touch:0,pen:8},E6=Cn(Cn({},zl),{},{device(i,e,{pointer:{touch:t=!1,lock:n=!1,mouse:r=!1}={}}){return this.pointerLock=n&&Nr.pointerLock,Nr.touch&&t?"touch":this.pointerLock?"mouse":Nr.pointer&&!r?"pointer":Nr.touch?"touch":"mouse"},preventScrollAxis(i,e,{preventScroll:t}){if(this.preventScrollDelay=typeof t=="number"?t:t||t===void 0&&i?v6:void 0,!(!Nr.touchscreen||t===!1))return i||(t!==void 0?"y":void 0)},pointerCapture(i,e,{pointer:{capture:t=!0,buttons:n=1,keys:r=!0}={}}){return this.pointerButtons=n,this.keys=r,!this.pointerLock&&this.device==="pointer"&&t},threshold(i,e,{filterTaps:t=!1,tapsThreshold:n=3,axis:r=void 0}){const s=_n.toVector(i,t?n:r?1:0);return this.filterTaps=t,this.tapsThreshold=n,s},swipe({velocity:i=_6,distance:e=x6,duration:t=b6}={}){return{velocity:this.transform(_n.toVector(i)),distance:this.transform(_n.toVector(e)),duration:t}},delay(i=0){switch(i){case!0:return y6;case!1:return 0;default:return i}},axisThreshold(i){return i?Cn(Cn({},ST),i):ST},keyboardDisplacement(i=S6){return i}});function $R(i){const[e,t]=i.overflow,[n,r]=i._delta,[s,a]=i._direction;(e<0&&n>0&&s<0||e>0&&n<0&&s>0)&&(i._movement[0]=i._movementBound[0]),(t<0&&r>0&&a<0||t>0&&r<0&&a>0)&&(i._movement[1]=i._movementBound[1])}const M6=30,w6=100;class T6 extends KR{constructor(...e){super(...e),Zn(this,"ingKey","pinching"),Zn(this,"aliasKey","da")}init(){this.state.offset=[1,0],this.state.lastOffset=[1,0],this.state._pointerEvents=new Map}reset(){super.reset();const e=this.state;e._touchIds=[],e.canceled=!1,e.cancel=this.cancel.bind(this),e.turns=0}computeOffset(){const{type:e,movement:t,lastOffset:n}=this.state;e==="wheel"?this.state.offset=_n.add(t,n):this.state.offset=[(1+t[0])*n[0],t[1]+n[1]]}computeMovement(){const{offset:e,lastOffset:t}=this.state;this.state.movement=[e[0]/t[0],e[1]-t[1]]}axisIntent(){const e=this.state,[t,n]=e._movement;if(!e.axis){const r=Math.abs(t)*M6-Math.abs(n);r<0?e.axis="angle":r>0&&(e.axis="scale")}}restrictToAxis(e){this.config.lockDirection&&(this.state.axis==="scale"?e[1]=0:this.state.axis==="angle"&&(e[0]=0))}cancel(){const e=this.state;e.canceled||setTimeout(()=>{e.canceled=!0,e._active=!1,this.compute(),this.emit()},0)}touchStart(e){this.ctrl.setEventIds(e);const t=this.state,n=this.ctrl.touchIds;if(t._active&&t._touchIds.every(s=>n.has(s))||n.size<2)return;this.start(e),t._touchIds=Array.from(n).slice(0,2);const r=gT(e,t._touchIds);r&&this.pinchStart(e,r)}pointerStart(e){if(e.buttons!=null&&e.buttons%2!==1)return;this.ctrl.setEventIds(e),e.target.setPointerCapture(e.pointerId);const t=this.state,n=t._pointerEvents,r=this.ctrl.pointerIds;if(t._active&&Array.from(n.keys()).every(a=>r.has(a))||(n.size<2&&n.set(e.pointerId,e),t._pointerEvents.size<2))return;this.start(e);const s=Tx(...Array.from(n.values()));s&&this.pinchStart(e,s)}pinchStart(e,t){const n=this.state;n.origin=t.origin,this.computeValues([t.distance,t.angle]),this.computeInitial(),this.compute(e),this.emit()}touchMove(e){if(!this.state._active)return;const t=gT(e,this.state._touchIds);t&&this.pinchMove(e,t)}pointerMove(e){const t=this.state._pointerEvents;if(t.has(e.pointerId)&&t.set(e.pointerId,e),!this.state._active)return;const n=Tx(...Array.from(t.values()));n&&this.pinchMove(e,n)}pinchMove(e,t){const n=this.state,r=n._values[1],s=t.angle-r;let a=0;Math.abs(s)>270&&(a+=Math.sign(s)),this.computeValues([t.distance,t.angle-360*a]),n.origin=t.origin,n.turns=a,n._movement=[n._values[0]/n._initial[0]-1,n._values[1]-n._initial[1]],this.compute(e),this.emit()}touchEnd(e){this.ctrl.setEventIds(e),this.state._active&&this.state._touchIds.some(t=>!this.ctrl.touchIds.has(t))&&(this.state._active=!1,this.compute(e),this.emit())}pointerEnd(e){const t=this.state;this.ctrl.setEventIds(e);try{e.target.releasePointerCapture(e.pointerId)}catch{}t._pointerEvents.has(e.pointerId)&&t._pointerEvents.delete(e.pointerId),t._active&&t._pointerEvents.size<2&&(t._active=!1,this.compute(e),this.emit())}gestureStart(e){e.cancelable&&e.preventDefault();const t=this.state;t._active||(this.start(e),this.computeValues([e.scale,e.rotation]),t.origin=[e.clientX,e.clientY],this.compute(e),this.emit())}gestureMove(e){if(e.cancelable&&e.preventDefault(),!this.state._active)return;const t=this.state;this.computeValues([e.scale,e.rotation]),t.origin=[e.clientX,e.clientY];const n=t._movement;t._movement=[e.scale-1,e.rotation],t._delta=_n.sub(t._movement,n),this.compute(e),this.emit()}gestureEnd(e){this.state._active&&(this.state._active=!1,this.compute(e),this.emit())}wheel(e){const t=this.config.modifierKey;t&&(Array.isArray(t)?!t.find(n=>e[n]):!e[t])||(this.state._active?this.wheelChange(e):this.wheelStart(e),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this)))}wheelStart(e){this.start(e),this.wheelChange(e)}wheelChange(e){"uv"in e||e.cancelable&&e.preventDefault();const n=this.state;n._delta=[-ZR(e)[1]/w6*n.offset[0],0],_n.addTo(n._movement,n._delta),$R(n),this.state.origin=[e.clientX,e.clientY],this.compute(e),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){const t=this.config.device;t&&(e(t,"start",this[t+"Start"].bind(this)),e(t,"change",this[t+"Move"].bind(this)),e(t,"end",this[t+"End"].bind(this)),e(t,"cancel",this[t+"End"].bind(this)),e("lostPointerCapture","",this[t+"End"].bind(this))),this.config.pinchOnWheel&&e("wheel","",this.wheel.bind(this),{passive:!1})}}const A6=Cn(Cn({},JR),{},{device(i,e,{shared:t,pointer:{touch:n=!1}={}}){if(t.target&&!Nr.touch&&Nr.gesture)return"gesture";if(Nr.touch&&n)return"touch";if(Nr.touchscreen){if(Nr.pointer)return"pointer";if(Nr.touch)return"touch"}},bounds(i,e,{scaleBounds:t={},angleBounds:n={}}){const r=a=>{const o=_T(Sg(t,a),{min:-1/0,max:1/0});return[o.min,o.max]},s=a=>{const o=_T(Sg(n,a),{min:-1/0,max:1/0});return[o.min,o.max]};return typeof t!="function"&&typeof n!="function"?[r(),s()]:a=>[r(a),s(a)]},threshold(i,e,t){return this.lockDirection=t.axis==="lock",_n.toVector(i,this.lockDirection?[.1,3]:0)},modifierKey(i){return i===void 0?"ctrlKey":i},pinchOnWheel(i=!0){return i}});class C6 extends ud{constructor(...e){super(...e),Zn(this,"ingKey","moving")}move(e){this.config.mouseOnly&&e.pointerType!=="mouse"||(this.state._active?this.moveChange(e):this.moveStart(e),this.timeoutStore.add("moveEnd",this.moveEnd.bind(this)))}moveStart(e){this.start(e),this.computeValues(xu(e)),this.compute(e),this.computeInitial(),this.emit()}moveChange(e){if(!this.state._active)return;const t=xu(e),n=this.state;n._delta=_n.sub(t,n._values),_n.addTo(n._movement,n._delta),this.computeValues(t),this.compute(e),this.emit()}moveEnd(e){this.state._active&&(this.state._active=!1,this.compute(e),this.emit())}bind(e){e("pointer","change",this.move.bind(this)),e("pointer","leave",this.moveEnd.bind(this))}}const R6=Cn(Cn({},zl),{},{mouseOnly:(i=!0)=>i});class D6 extends ud{constructor(...e){super(...e),Zn(this,"ingKey","scrolling")}scroll(e){this.state._active||this.start(e),this.scrollChange(e),this.timeoutStore.add("scrollEnd",this.scrollEnd.bind(this))}scrollChange(e){e.cancelable&&e.preventDefault();const t=this.state,n=i6(e);t._delta=_n.sub(n,t._values),_n.addTo(t._movement,t._delta),this.computeValues(n),this.compute(e),this.emit()}scrollEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){e("scroll","",this.scroll.bind(this))}}const U6=zl;class O6 extends ud{constructor(...e){super(...e),Zn(this,"ingKey","wheeling")}wheel(e){this.state._active||this.start(e),this.wheelChange(e),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this))}wheelChange(e){const t=this.state;t._delta=ZR(e),_n.addTo(t._movement,t._delta),$R(t),this.compute(e),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){e("wheel","",this.wheel.bind(this))}}const L6=zl;class I6 extends ud{constructor(...e){super(...e),Zn(this,"ingKey","hovering")}enter(e){this.config.mouseOnly&&e.pointerType!=="mouse"||(this.start(e),this.computeValues(xu(e)),this.compute(e),this.emit())}leave(e){if(this.config.mouseOnly&&e.pointerType!=="mouse")return;const t=this.state;if(!t._active)return;t._active=!1;const n=xu(e);t._movement=t._delta=_n.sub(n,t._values),this.computeValues(n),this.compute(e),t.delta=t.movement,this.emit()}bind(e){e("pointer","enter",this.enter.bind(this)),e("pointer","leave",this.leave.bind(this))}}const N6=Cn(Cn({},zl),{},{mouseOnly:(i=!0)=>i}),nb=new Map,Ax=new Map;function P6(i){nb.set(i.key,i.engine),Ax.set(i.key,i.resolver)}const z6={key:"drag",engine:h6,resolver:E6},F6={key:"hover",engine:I6,resolver:N6},B6={key:"move",engine:C6,resolver:R6},k6={key:"pinch",engine:T6,resolver:A6},G6={key:"scroll",engine:D6,resolver:U6},H6={key:"wheel",engine:O6,resolver:L6};function V6(i,e){if(i==null)return{};var t={},n=Object.keys(i),r,s;for(s=0;s<n.length;s++)r=n[s],!(e.indexOf(r)>=0)&&(t[r]=i[r]);return t}function W6(i,e){if(i==null)return{};var t=V6(i,e),n,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(i);for(r=0;r<s.length;r++)n=s[r],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(i,n)&&(t[n]=i[n])}return t}const X6={target(i){if(i)return()=>"current"in i?i.current:i},enabled(i=!0){return i},window(i=Nr.isBrowser?window:void 0){return i},eventOptions({passive:i=!0,capture:e=!1}={}){return{passive:i,capture:e}},transform(i){return i}},j6=["target","eventOptions","window","enabled","transform"];function hm(i={},e){const t={};for(const[n,r]of Object.entries(e))switch(typeof r){case"function":t[n]=r.call(t,i[n],n,i);break;case"object":t[n]=hm(i[n],r);break;case"boolean":r&&(t[n]=i[n]);break}return t}function q6(i,e,t={}){const n=i,{target:r,eventOptions:s,window:a,enabled:o,transform:l}=n,c=W6(n,j6);if(t.shared=hm({target:r,eventOptions:s,window:a,enabled:o,transform:l},X6),e){const h=Ax.get(e);t[e]=hm(Cn({shared:t.shared},c),h)}else for(const h in c){const d=Ax.get(h);d&&(t[h]=hm(Cn({shared:t.shared},c[h]),d))}return t}class eD{constructor(e,t){Zn(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=t}add(e,t,n,r,s){const a=this._listeners,o=$V(t,n),l=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},c=Cn(Cn({},l),s);e.addEventListener(o,r,c);const h=()=>{e.removeEventListener(o,r,c),a.delete(h)};return a.add(h),h}clean(){this._listeners.forEach(e=>e()),this._listeners.clear()}}class Y6{constructor(){Zn(this,"_timeouts",new Map)}add(e,t,n=140,...r){this.remove(e),this._timeouts.set(e,window.setTimeout(t,n,...r))}remove(e){const t=this._timeouts.get(e);t&&window.clearTimeout(t)}clean(){this._timeouts.forEach(e=>void window.clearTimeout(e)),this._timeouts.clear()}}class Z6{constructor(e){Zn(this,"gestures",new Set),Zn(this,"_targetEventStore",new eD(this)),Zn(this,"gestureEventStores",{}),Zn(this,"gestureTimeoutStores",{}),Zn(this,"handlers",{}),Zn(this,"config",{}),Zn(this,"pointerIds",new Set),Zn(this,"touchIds",new Set),Zn(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),K6(this,e)}setEventIds(e){if(b0(e))return this.touchIds=new Set(n6(e)),this.touchIds;if("pointerId"in e)return e.type==="pointerup"||e.type==="pointercancel"?this.pointerIds.delete(e.pointerId):e.type==="pointerdown"&&this.pointerIds.add(e.pointerId),this.pointerIds}applyHandlers(e,t){this.handlers=e,this.nativeHandlers=t}applyConfig(e,t){this.config=q6(e,t,this.config)}clean(){this._targetEventStore.clean();for(const e of this.gestures)this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){const t=this.config.shared,n={};let r;if(!(t.target&&(r=t.target(),!r))){if(t.enabled){for(const a of this.gestures){const o=this.config[a],l=ET(n,o.eventOptions,!!r);if(o.enabled){const c=nb.get(a);new c(this,e,a).bind(l)}}const s=ET(n,t.eventOptions,!!r);for(const a in this.nativeHandlers)s(a,"",o=>this.nativeHandlers[a](Cn(Cn({},this.state.shared),{},{event:o,args:e})),void 0,!0)}for(const s in n)n[s]=a6(...n[s]);if(!r)return n;for(const s in n){const{device:a,capture:o,passive:l}=QV(s);this._targetEventStore.add(r,a,"",n[s],{capture:o,passive:l})}}}}function Zc(i,e){i.gestures.add(e),i.gestureEventStores[e]=new eD(i,e),i.gestureTimeoutStores[e]=new Y6}function K6(i,e){e.drag&&Zc(i,"drag"),e.wheel&&Zc(i,"wheel"),e.scroll&&Zc(i,"scroll"),e.move&&Zc(i,"move"),e.pinch&&Zc(i,"pinch"),e.hover&&Zc(i,"hover")}const ET=(i,e,t)=>(n,r,s,a={},o=!1)=>{var l,c;const h=(l=a.capture)!==null&&l!==void 0?l:e.capture,d=(c=a.passive)!==null&&c!==void 0?c:e.passive;let p=o?n:KV(n,r,h);t&&d&&(p+="Passive"),i[p]=i[p]||[],i[p].push(s)},J6=/^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/;function Q6(i){const e={},t={},n=new Set;for(let r in i)J6.test(r)?(n.add(RegExp.lastMatch),t[r]=i[r]):e[r]=i[r];return[t,e,n]}function Kc(i,e,t,n,r,s){if(!i.has(t)||!nb.has(n))return;const a=t+"Start",o=t+"End",l=c=>{let h;return c.first&&a in e&&e[a](c),t in e&&(h=e[t](c)),c.last&&o in e&&e[o](c),h};r[n]=l,s[n]=s[n]||{}}function $6(i,e){const[t,n,r]=Q6(i),s={};return Kc(r,t,"onDrag","drag",s,e),Kc(r,t,"onWheel","wheel",s,e),Kc(r,t,"onScroll","scroll",s,e),Kc(r,t,"onPinch","pinch",s,e),Kc(r,t,"onMove","move",s,e),Kc(r,t,"onHover","hover",s,e),{handlers:s,config:e,nativeHandlers:n}}function e8(i,e={},t,n){const r=Ms.useMemo(()=>new Z6(i),[]);if(r.applyHandlers(i,n),r.applyConfig(e,t),Ms.useEffect(r.effect.bind(r)),Ms.useEffect(()=>r.clean.bind(r),[]),e.target===void 0)return r.bind.bind(r)}function t8(i){return i.forEach(P6),function(t,n){const{handlers:r,nativeHandlers:s,config:a}=$6(t,n||{});return e8(r,a,void 0,s)}}function n8(i,e){return t8([z6,k6,G6,H6,B6,F6])(i,e||{})}const tD=K.forwardRef(function({children:e,follow:t=!0,lockX:n=!1,lockY:r=!1,lockZ:s=!1,...a},o){const l=K.useRef(null),c=K.useRef(null),h=new yi;return u0(({camera:d})=>{if(!t||!c.current)return;const p=l.current.rotation.clone();c.current.updateMatrix(),c.current.updateWorldMatrix(!1,!1),c.current.getWorldQuaternion(h),d.getWorldQuaternion(l.current.quaternion).premultiply(h.invert()),n&&(l.current.rotation.x=p.x),r&&(l.current.rotation.y=p.y),s&&(l.current.rotation.z=p.z)}),K.useImperativeHandle(o,()=>c.current,[]),K.createElement("group",Zf({ref:c},a),K.createElement("group",{ref:l},e))});function i8(){var i=Object.create(null);function e(r,s){var a=r.id,o=r.name,l=r.dependencies;l===void 0&&(l=[]);var c=r.init;c===void 0&&(c=function(){});var h=r.getTransferables;if(h===void 0&&(h=null),!i[a])try{l=l.map(function(p){return p&&p.isWorkerModule&&(e(p,function(m){if(m instanceof Error)throw m}),p=i[p.id].value),p}),c=n("<"+o+">.init",c),h&&(h=n("<"+o+">.getTransferables",h));var d=null;typeof c=="function"?d=c.apply(void 0,l):console.error("worker module init function failed to rehydrate"),i[a]={id:a,value:d,getTransferables:h},s(d)}catch(p){p&&p.noLog||console.error(p),s(p)}}function t(r,s){var a,o=r.id,l=r.args;(!i[o]||typeof i[o].value!="function")&&s(new Error("Worker module "+o+": not found or its 'init' did not return a function"));try{var c=(a=i[o]).value.apply(a,l);c&&typeof c.then=="function"?c.then(h,function(d){return s(d instanceof Error?d:new Error(""+d))}):h(c)}catch(d){s(d)}function h(d){try{var p=i[o].getTransferables&&i[o].getTransferables(d);(!p||!Array.isArray(p)||!p.length)&&(p=void 0),s(d,p)}catch(m){console.error(m),s(m)}}}function n(r,s){var a=void 0;self.troikaDefine=function(l){return a=l};var o=URL.createObjectURL(new Blob(["/** "+r.replace(/\*/g,"")+` **/
|
|
3880
|
+
`}),[h]);return K.createElement("group",Zf({},T,{ref:O}),d&&!ee&&K.createElement("mesh",{castShadow:m,receiveShadow:v,ref:Q},_||K.createElement("planeGeometry",null),x||K.createElement("shaderMaterial",{side:zn,vertexShader:Ae.vertexShader,fragmentShader:Ae.fragmentShader})))});function Ml(i,e="pointer",t="auto",n=document.body){K.useEffect(()=>{if(i)return n.style.cursor=e,()=>{n.style.cursor=t}},[i])}function WV(i,e,t){return Math.max(e,Math.min(i,t))}const _n={toVector(i,e){return i===void 0&&(i=e),Array.isArray(i)?i:[i,i]},add(i,e){return[i[0]+e[0],i[1]+e[1]]},sub(i,e){return[i[0]-e[0],i[1]-e[1]]},addTo(i,e){i[0]+=e[0],i[1]+=e[1]},subTo(i,e){i[0]-=e[0],i[1]-=e[1]}};function fT(i,e,t){return e===0||Math.abs(e)===1/0?Math.pow(i,t*5):i*e*t/(e+t*i)}function dT(i,e,t,n=.15){return n===0?WV(i,e,t):i<e?-fT(e-i,t-e,n)+e:i>t?+fT(i-t,t-e,n)+t:i}function XV(i,[e,t],[n,r]){const[[s,a],[o,l]]=i;return[dT(e,s,a,n),dT(t,o,l,r)]}function jV(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function qV(i){var e=jV(i,"string");return typeof e=="symbol"?e:String(e)}function Zn(i,e,t){return e=qV(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function pT(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),t.push.apply(t,n)}return t}function Cn(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?pT(Object(t),!0).forEach(function(n){Zn(i,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):pT(Object(t)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(t,n))})}return i}const jR={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function mT(i){return i?i[0].toUpperCase()+i.slice(1):""}const YV=["enter","leave"];function ZV(i=!1,e){return i&&!YV.includes(e)}function KV(i,e="",t=!1){const n=jR[i],r=n&&n[e]||e;return"on"+mT(i)+mT(r)+(ZV(t,r)?"Capture":"")}const JV=["gotpointercapture","lostpointercapture"];function QV(i){let e=i.substring(2).toLowerCase();const t=!!~e.indexOf("passive");t&&(e=e.replace("passive",""));const n=JV.includes(e)?"capturecapture":"capture",r=!!~e.indexOf(n);return r&&(e=e.replace("capture","")),{device:e,capture:r,passive:t}}function $V(i,e=""){const t=jR[i],n=t&&t[e]||e;return i+n}function b0(i){return"touches"in i}function qR(i){return b0(i)?"touch":"pointerType"in i?i.pointerType:"mouse"}function e6(i){return Array.from(i.touches).filter(e=>{var t,n;return e.target===i.currentTarget||((t=i.currentTarget)===null||t===void 0||(n=t.contains)===null||n===void 0?void 0:n.call(t,e.target))})}function t6(i){return i.type==="touchend"||i.type==="touchcancel"?i.changedTouches:i.targetTouches}function YR(i){return b0(i)?t6(i)[0]:i}function Tx(i,e){try{const t=e.clientX-i.clientX,n=e.clientY-i.clientY,r=(e.clientX+i.clientX)/2,s=(e.clientY+i.clientY)/2,a=Math.hypot(t,n);return{angle:-(Math.atan2(t,n)*180)/Math.PI,distance:a,origin:[r,s]}}catch{}return null}function n6(i){return e6(i).map(e=>e.identifier)}function gT(i,e){const[t,n]=Array.from(i.touches).filter(r=>e.includes(r.identifier));return Tx(t,n)}function b_(i){const e=YR(i);return b0(i)?e.identifier:e.pointerId}function xu(i){const e=YR(i);return[e.clientX,e.clientY]}const vT=40,yT=800;function ZR(i){let{deltaX:e,deltaY:t,deltaMode:n}=i;return n===1?(e*=vT,t*=vT):n===2&&(e*=yT,t*=yT),[e,t]}function i6(i){var e,t;const{scrollX:n,scrollY:r,scrollLeft:s,scrollTop:a}=i.currentTarget;return[(e=n??s)!==null&&e!==void 0?e:0,(t=r??a)!==null&&t!==void 0?t:0]}function r6(i){const e={};if("buttons"in i&&(e.buttons=i.buttons),"shiftKey"in i){const{shiftKey:t,altKey:n,metaKey:r,ctrlKey:s}=i;Object.assign(e,{shiftKey:t,altKey:n,metaKey:r,ctrlKey:s})}return e}function Sg(i,...e){return typeof i=="function"?i(...e):i}function s6(){}function a6(...i){return i.length===0?s6:i.length===1?i[0]:function(){let e;for(const t of i)e=t.apply(this,arguments)||e;return e}}function _T(i,e){return Object.assign({},e,i||{})}const o6=32;class KR{constructor(e,t,n){this.ctrl=e,this.args=t,this.key=n,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:e,shared:t,ingKey:n,args:r}=this;t[n]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=r,e.axis=void 0,e.memo=void 0,e.elapsedTime=e.timeDelta=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){const t=this.state,n=this.config;t._active||(this.reset(),this.computeInitial(),t._active=!0,t.target=e.target,t.currentTarget=e.currentTarget,t.lastOffset=n.from?Sg(n.from,t):t.offset,t.offset=t.lastOffset,t.startTime=t.timeStamp=e.timeStamp)}computeValues(e){const t=this.state;t._values=e,t.values=this.config.transform(e)}computeInitial(){const e=this.state;e._initial=e._values,e.initial=e.values}compute(e){const{state:t,config:n,shared:r}=this;t.args=this.args;let s=0;if(e&&(t.event=e,n.preventDefault&&e.cancelable&&t.event.preventDefault(),t.type=e.type,r.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,r.locked=!!document.pointerLockElement,Object.assign(r,r6(e)),r.down=r.pressed=r.buttons%2===1||r.touches>0,s=e.timeStamp-t.timeStamp,t.timeStamp=e.timeStamp,t.elapsedTime=t.timeStamp-t.startTime),t._active){const T=t._delta.map(Math.abs);_n.addTo(t._distance,T)}this.axisIntent&&this.axisIntent(e);const[a,o]=t._movement,[l,c]=n.threshold,{_step:h,values:d}=t;if(n.hasCustomTransform?(h[0]===!1&&(h[0]=Math.abs(a)>=l&&d[0]),h[1]===!1&&(h[1]=Math.abs(o)>=c&&d[1])):(h[0]===!1&&(h[0]=Math.abs(a)>=l&&Math.sign(a)*l),h[1]===!1&&(h[1]=Math.abs(o)>=c&&Math.sign(o)*c)),t.intentional=h[0]!==!1||h[1]!==!1,!t.intentional)return;const p=[0,0];if(n.hasCustomTransform){const[T,R]=d;p[0]=h[0]!==!1?T-h[0]:0,p[1]=h[1]!==!1?R-h[1]:0}else p[0]=h[0]!==!1?a-h[0]:0,p[1]=h[1]!==!1?o-h[1]:0;this.restrictToAxis&&!t._blocked&&this.restrictToAxis(p);const m=t.offset,v=t._active&&!t._blocked||t.active;v&&(t.first=t._active&&!t.active,t.last=!t._active&&t.active,t.active=r[this.ingKey]=t._active,e&&(t.first&&("bounds"in n&&(t._bounds=Sg(n.bounds,t)),this.setup&&this.setup()),t.movement=p,this.computeOffset()));const[x,_]=t.offset,[[g,b],[E,S]]=t._bounds;t.overflow=[x<g?-1:x>b?1:0,_<E?-1:_>S?1:0],t._movementBound[0]=t.overflow[0]?t._movementBound[0]===!1?t._movement[0]:t._movementBound[0]:!1,t._movementBound[1]=t.overflow[1]?t._movementBound[1]===!1?t._movement[1]:t._movementBound[1]:!1;const w=t._active?n.rubberband||[0,0]:[0,0];if(t.offset=XV(t._bounds,t.offset,w),t.delta=_n.sub(t.offset,m),this.computeMovement(),v&&(!t.last||s>o6)){t.delta=_n.sub(t.offset,m);const T=t.delta.map(Math.abs);_n.addTo(t.distance,T),t.direction=t.delta.map(Math.sign),t._direction=t._delta.map(Math.sign),!t.first&&s>0&&(t.velocity=[T[0]/s,T[1]/s],t.timeDelta=s)}}emit(){const e=this.state,t=this.shared,n=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!n.triggerAllEvents)return;const r=this.handler(Cn(Cn(Cn({},t),e),{},{[this.aliasKey]:e.values}));r!==void 0&&(e.memo=r)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function l6([i,e],t){const n=Math.abs(i),r=Math.abs(e);if(n>r&&n>t)return"x";if(r>n&&r>t)return"y"}class ud extends KR{constructor(...e){super(...e),Zn(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=_n.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=_n.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){const t=this.state,n=this.config;if(!t.axis&&e){const r=typeof n.axisThreshold=="object"?n.axisThreshold[qR(e)]:n.axisThreshold;t.axis=l6(t._movement,r)}t._blocked=(n.lockDirection||!!n.axis)&&!t.axis||!!n.axis&&n.axis!==t.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0;break}}}const c6=i=>i,xT=.15,JR={enabled(i=!0){return i},eventOptions(i,e,t){return Cn(Cn({},t.shared.eventOptions),i)},preventDefault(i=!1){return i},triggerAllEvents(i=!1){return i},rubberband(i=0){switch(i){case!0:return[xT,xT];case!1:return[0,0];default:return _n.toVector(i)}},from(i){if(typeof i=="function")return i;if(i!=null)return _n.toVector(i)},transform(i,e,t){const n=i||t.shared.transform;return this.hasCustomTransform=!!n,n||c6},threshold(i){return _n.toVector(i,0)}},u6=0,zl=Cn(Cn({},JR),{},{axis(i,e,{axis:t}){if(this.lockDirection=t==="lock",!this.lockDirection)return t},axisThreshold(i=u6){return i},bounds(i={}){if(typeof i=="function")return s=>zl.bounds(i(s));if("current"in i)return()=>i.current;if(typeof HTMLElement=="function"&&i instanceof HTMLElement)return i;const{left:e=-1/0,right:t=1/0,top:n=-1/0,bottom:r=1/0}=i;return[[e,t],[n,r]]}}),bT={ArrowRight:(i,e=1)=>[i*e,0],ArrowLeft:(i,e=1)=>[-1*i*e,0],ArrowUp:(i,e=1)=>[0,-1*i*e],ArrowDown:(i,e=1)=>[0,i*e]};class h6 extends ud{constructor(...e){super(...e),Zn(this,"ingKey","dragging")}reset(){super.reset();const e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){const e=this.state;if(e._bounds instanceof HTMLElement){const t=e._bounds.getBoundingClientRect(),n=e.currentTarget.getBoundingClientRect(),r={left:t.left-n.left+e.offset[0],right:t.right-n.right+e.offset[0],top:t.top-n.top+e.offset[1],bottom:t.bottom-n.bottom+e.offset[1]};e._bounds=zl.bounds(r)}}cancel(){const e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){const t=this.config,n=this.state;if(e.buttons!=null&&(Array.isArray(t.pointerButtons)?!t.pointerButtons.includes(e.buttons):t.pointerButtons!==-1&&t.pointerButtons!==e.buttons))return;const r=this.ctrl.setEventIds(e);t.pointerCapture&&e.target.setPointerCapture(e.pointerId),!(r&&r.size>1&&n._pointerActive)&&(this.start(e),this.setupPointer(e),n._pointerId=b_(e),n._pointerActive=!0,this.computeValues(xu(e)),this.computeInitial(),t.preventScrollAxis&&qR(e)!=="mouse"?(n._active=!1,this.setupScrollPrevention(e)):t.delay>0?(this.setupDelayTrigger(e),t.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e))}startPointerDrag(e){const t=this.state;t._active=!0,t._preventScroll=!0,t._delayed=!1,this.compute(e),this.emit()}pointerMove(e){const t=this.state,n=this.config;if(!t._pointerActive)return;const r=b_(e);if(t._pointerId!==void 0&&r!==t._pointerId)return;const s=xu(e);if(document.pointerLockElement===e.target?t._delta=[e.movementX,e.movementY]:(t._delta=_n.sub(s,t._values),this.computeValues(s)),_n.addTo(t._movement,t._delta),this.compute(e),t._delayed&&t.intentional){this.timeoutStore.remove("dragDelay"),t.active=!1,this.startPointerDrag(e);return}if(n.preventScrollAxis&&!t._preventScroll)if(t.axis)if(t.axis===n.preventScrollAxis||n.preventScrollAxis==="xy"){t._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(e);return}else return;this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch{}const t=this.state,n=this.config;if(!t._active||!t._pointerActive)return;const r=b_(e);if(t._pointerId!==void 0&&r!==t._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);const[s,a]=t._distance;if(t.tap=s<=n.tapsThreshold&&a<=n.tapsThreshold,t.tap&&n.filterTaps)t._force=!0;else{const[o,l]=t._delta,[c,h]=t._movement,[d,p]=n.swipe.velocity,[m,v]=n.swipe.distance,x=n.swipe.duration;if(t.elapsedTime<x){const _=Math.abs(o/t.timeDelta),g=Math.abs(l/t.timeDelta);_>d&&Math.abs(c)>m&&(t.swipe[0]=Math.sign(o)),g>p&&Math.abs(h)>v&&(t.swipe[1]=Math.sign(l))}}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){const t=this.config,n=t.device;t.pointerLock&&e.currentTarget.requestPointerLock(),t.pointerCapture||(this.eventStore.add(this.sharedConfig.window,n,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,n,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,n,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){this.state._preventScroll=!1,f6(e);const t=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",t),this.eventStore.add(this.sharedConfig.window,"touch","cancel",t),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(e)},this.config.delay)}keyDown(e){const t=bT[e.key];if(t){const n=this.state,r=e.shiftKey?10:e.altKey?.1:1;this.start(e),n._delta=t(this.config.keyboardDisplacement,r),n._keyboardActive=!0,_n.addTo(n._movement,n._delta),this.compute(e),this.emit()}}keyUp(e){e.key in bT&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){const t=this.config.device;e(t,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(e(t,"change",this.pointerMove.bind(this)),e(t,"end",this.pointerUp.bind(this)),e(t,"cancel",this.pointerUp.bind(this)),e("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(e("key","down",this.keyDown.bind(this)),e("key","up",this.keyUp.bind(this))),this.config.filterTaps&&e("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}}function f6(i){"persist"in i&&typeof i.persist=="function"&&i.persist()}const hd=typeof window<"u"&&window.document&&window.document.createElement;function QR(){return hd&&"ontouchstart"in window}function d6(){return QR()||hd&&window.navigator.maxTouchPoints>1}function p6(){return hd&&"onpointerdown"in window}function m6(){return hd&&"exitPointerLock"in window.document}function g6(){try{return"constructor"in GestureEvent}catch{return!1}}const Nr={isBrowser:hd,gesture:g6(),touch:QR(),touchscreen:d6(),pointer:p6(),pointerLock:m6()},v6=250,y6=180,_6=.5,x6=50,b6=250,S6=10,ST={mouse:0,touch:0,pen:8},E6=Cn(Cn({},zl),{},{device(i,e,{pointer:{touch:t=!1,lock:n=!1,mouse:r=!1}={}}){return this.pointerLock=n&&Nr.pointerLock,Nr.touch&&t?"touch":this.pointerLock?"mouse":Nr.pointer&&!r?"pointer":Nr.touch?"touch":"mouse"},preventScrollAxis(i,e,{preventScroll:t}){if(this.preventScrollDelay=typeof t=="number"?t:t||t===void 0&&i?v6:void 0,!(!Nr.touchscreen||t===!1))return i||(t!==void 0?"y":void 0)},pointerCapture(i,e,{pointer:{capture:t=!0,buttons:n=1,keys:r=!0}={}}){return this.pointerButtons=n,this.keys=r,!this.pointerLock&&this.device==="pointer"&&t},threshold(i,e,{filterTaps:t=!1,tapsThreshold:n=3,axis:r=void 0}){const s=_n.toVector(i,t?n:r?1:0);return this.filterTaps=t,this.tapsThreshold=n,s},swipe({velocity:i=_6,distance:e=x6,duration:t=b6}={}){return{velocity:this.transform(_n.toVector(i)),distance:this.transform(_n.toVector(e)),duration:t}},delay(i=0){switch(i){case!0:return y6;case!1:return 0;default:return i}},axisThreshold(i){return i?Cn(Cn({},ST),i):ST},keyboardDisplacement(i=S6){return i}});function $R(i){const[e,t]=i.overflow,[n,r]=i._delta,[s,a]=i._direction;(e<0&&n>0&&s<0||e>0&&n<0&&s>0)&&(i._movement[0]=i._movementBound[0]),(t<0&&r>0&&a<0||t>0&&r<0&&a>0)&&(i._movement[1]=i._movementBound[1])}const M6=30,w6=100;class T6 extends KR{constructor(...e){super(...e),Zn(this,"ingKey","pinching"),Zn(this,"aliasKey","da")}init(){this.state.offset=[1,0],this.state.lastOffset=[1,0],this.state._pointerEvents=new Map}reset(){super.reset();const e=this.state;e._touchIds=[],e.canceled=!1,e.cancel=this.cancel.bind(this),e.turns=0}computeOffset(){const{type:e,movement:t,lastOffset:n}=this.state;e==="wheel"?this.state.offset=_n.add(t,n):this.state.offset=[(1+t[0])*n[0],t[1]+n[1]]}computeMovement(){const{offset:e,lastOffset:t}=this.state;this.state.movement=[e[0]/t[0],e[1]-t[1]]}axisIntent(){const e=this.state,[t,n]=e._movement;if(!e.axis){const r=Math.abs(t)*M6-Math.abs(n);r<0?e.axis="angle":r>0&&(e.axis="scale")}}restrictToAxis(e){this.config.lockDirection&&(this.state.axis==="scale"?e[1]=0:this.state.axis==="angle"&&(e[0]=0))}cancel(){const e=this.state;e.canceled||setTimeout(()=>{e.canceled=!0,e._active=!1,this.compute(),this.emit()},0)}touchStart(e){this.ctrl.setEventIds(e);const t=this.state,n=this.ctrl.touchIds;if(t._active&&t._touchIds.every(s=>n.has(s))||n.size<2)return;this.start(e),t._touchIds=Array.from(n).slice(0,2);const r=gT(e,t._touchIds);r&&this.pinchStart(e,r)}pointerStart(e){if(e.buttons!=null&&e.buttons%2!==1)return;this.ctrl.setEventIds(e),e.target.setPointerCapture(e.pointerId);const t=this.state,n=t._pointerEvents,r=this.ctrl.pointerIds;if(t._active&&Array.from(n.keys()).every(a=>r.has(a))||(n.size<2&&n.set(e.pointerId,e),t._pointerEvents.size<2))return;this.start(e);const s=Tx(...Array.from(n.values()));s&&this.pinchStart(e,s)}pinchStart(e,t){const n=this.state;n.origin=t.origin,this.computeValues([t.distance,t.angle]),this.computeInitial(),this.compute(e),this.emit()}touchMove(e){if(!this.state._active)return;const t=gT(e,this.state._touchIds);t&&this.pinchMove(e,t)}pointerMove(e){const t=this.state._pointerEvents;if(t.has(e.pointerId)&&t.set(e.pointerId,e),!this.state._active)return;const n=Tx(...Array.from(t.values()));n&&this.pinchMove(e,n)}pinchMove(e,t){const n=this.state,r=n._values[1],s=t.angle-r;let a=0;Math.abs(s)>270&&(a+=Math.sign(s)),this.computeValues([t.distance,t.angle-360*a]),n.origin=t.origin,n.turns=a,n._movement=[n._values[0]/n._initial[0]-1,n._values[1]-n._initial[1]],this.compute(e),this.emit()}touchEnd(e){this.ctrl.setEventIds(e),this.state._active&&this.state._touchIds.some(t=>!this.ctrl.touchIds.has(t))&&(this.state._active=!1,this.compute(e),this.emit())}pointerEnd(e){const t=this.state;this.ctrl.setEventIds(e);try{e.target.releasePointerCapture(e.pointerId)}catch{}t._pointerEvents.has(e.pointerId)&&t._pointerEvents.delete(e.pointerId),t._active&&t._pointerEvents.size<2&&(t._active=!1,this.compute(e),this.emit())}gestureStart(e){e.cancelable&&e.preventDefault();const t=this.state;t._active||(this.start(e),this.computeValues([e.scale,e.rotation]),t.origin=[e.clientX,e.clientY],this.compute(e),this.emit())}gestureMove(e){if(e.cancelable&&e.preventDefault(),!this.state._active)return;const t=this.state;this.computeValues([e.scale,e.rotation]),t.origin=[e.clientX,e.clientY];const n=t._movement;t._movement=[e.scale-1,e.rotation],t._delta=_n.sub(t._movement,n),this.compute(e),this.emit()}gestureEnd(e){this.state._active&&(this.state._active=!1,this.compute(e),this.emit())}wheel(e){const t=this.config.modifierKey;t&&(Array.isArray(t)?!t.find(n=>e[n]):!e[t])||(this.state._active?this.wheelChange(e):this.wheelStart(e),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this)))}wheelStart(e){this.start(e),this.wheelChange(e)}wheelChange(e){"uv"in e||e.cancelable&&e.preventDefault();const n=this.state;n._delta=[-ZR(e)[1]/w6*n.offset[0],0],_n.addTo(n._movement,n._delta),$R(n),this.state.origin=[e.clientX,e.clientY],this.compute(e),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){const t=this.config.device;t&&(e(t,"start",this[t+"Start"].bind(this)),e(t,"change",this[t+"Move"].bind(this)),e(t,"end",this[t+"End"].bind(this)),e(t,"cancel",this[t+"End"].bind(this)),e("lostPointerCapture","",this[t+"End"].bind(this))),this.config.pinchOnWheel&&e("wheel","",this.wheel.bind(this),{passive:!1})}}const A6=Cn(Cn({},JR),{},{device(i,e,{shared:t,pointer:{touch:n=!1}={}}){if(t.target&&!Nr.touch&&Nr.gesture)return"gesture";if(Nr.touch&&n)return"touch";if(Nr.touchscreen){if(Nr.pointer)return"pointer";if(Nr.touch)return"touch"}},bounds(i,e,{scaleBounds:t={},angleBounds:n={}}){const r=a=>{const o=_T(Sg(t,a),{min:-1/0,max:1/0});return[o.min,o.max]},s=a=>{const o=_T(Sg(n,a),{min:-1/0,max:1/0});return[o.min,o.max]};return typeof t!="function"&&typeof n!="function"?[r(),s()]:a=>[r(a),s(a)]},threshold(i,e,t){return this.lockDirection=t.axis==="lock",_n.toVector(i,this.lockDirection?[.1,3]:0)},modifierKey(i){return i===void 0?"ctrlKey":i},pinchOnWheel(i=!0){return i}});class C6 extends ud{constructor(...e){super(...e),Zn(this,"ingKey","moving")}move(e){this.config.mouseOnly&&e.pointerType!=="mouse"||(this.state._active?this.moveChange(e):this.moveStart(e),this.timeoutStore.add("moveEnd",this.moveEnd.bind(this)))}moveStart(e){this.start(e),this.computeValues(xu(e)),this.compute(e),this.computeInitial(),this.emit()}moveChange(e){if(!this.state._active)return;const t=xu(e),n=this.state;n._delta=_n.sub(t,n._values),_n.addTo(n._movement,n._delta),this.computeValues(t),this.compute(e),this.emit()}moveEnd(e){this.state._active&&(this.state._active=!1,this.compute(e),this.emit())}bind(e){e("pointer","change",this.move.bind(this)),e("pointer","leave",this.moveEnd.bind(this))}}const R6=Cn(Cn({},zl),{},{mouseOnly:(i=!0)=>i});class D6 extends ud{constructor(...e){super(...e),Zn(this,"ingKey","scrolling")}scroll(e){this.state._active||this.start(e),this.scrollChange(e),this.timeoutStore.add("scrollEnd",this.scrollEnd.bind(this))}scrollChange(e){e.cancelable&&e.preventDefault();const t=this.state,n=i6(e);t._delta=_n.sub(n,t._values),_n.addTo(t._movement,t._delta),this.computeValues(n),this.compute(e),this.emit()}scrollEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){e("scroll","",this.scroll.bind(this))}}const U6=zl;class O6 extends ud{constructor(...e){super(...e),Zn(this,"ingKey","wheeling")}wheel(e){this.state._active||this.start(e),this.wheelChange(e),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this))}wheelChange(e){const t=this.state;t._delta=ZR(e),_n.addTo(t._movement,t._delta),$R(t),this.compute(e),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){e("wheel","",this.wheel.bind(this))}}const L6=zl;class I6 extends ud{constructor(...e){super(...e),Zn(this,"ingKey","hovering")}enter(e){this.config.mouseOnly&&e.pointerType!=="mouse"||(this.start(e),this.computeValues(xu(e)),this.compute(e),this.emit())}leave(e){if(this.config.mouseOnly&&e.pointerType!=="mouse")return;const t=this.state;if(!t._active)return;t._active=!1;const n=xu(e);t._movement=t._delta=_n.sub(n,t._values),this.computeValues(n),this.compute(e),t.delta=t.movement,this.emit()}bind(e){e("pointer","enter",this.enter.bind(this)),e("pointer","leave",this.leave.bind(this))}}const N6=Cn(Cn({},zl),{},{mouseOnly:(i=!0)=>i}),nb=new Map,Ax=new Map;function P6(i){nb.set(i.key,i.engine),Ax.set(i.key,i.resolver)}const z6={key:"drag",engine:h6,resolver:E6},F6={key:"hover",engine:I6,resolver:N6},B6={key:"move",engine:C6,resolver:R6},k6={key:"pinch",engine:T6,resolver:A6},G6={key:"scroll",engine:D6,resolver:U6},H6={key:"wheel",engine:O6,resolver:L6};function V6(i,e){if(i==null)return{};var t={},n=Object.keys(i),r,s;for(s=0;s<n.length;s++)r=n[s],!(e.indexOf(r)>=0)&&(t[r]=i[r]);return t}function W6(i,e){if(i==null)return{};var t=V6(i,e),n,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(i);for(r=0;r<s.length;r++)n=s[r],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(i,n)&&(t[n]=i[n])}return t}const X6={target(i){if(i)return()=>"current"in i?i.current:i},enabled(i=!0){return i},window(i=Nr.isBrowser?window:void 0){return i},eventOptions({passive:i=!0,capture:e=!1}={}){return{passive:i,capture:e}},transform(i){return i}},j6=["target","eventOptions","window","enabled","transform"];function hm(i={},e){const t={};for(const[n,r]of Object.entries(e))switch(typeof r){case"function":t[n]=r.call(t,i[n],n,i);break;case"object":t[n]=hm(i[n],r);break;case"boolean":r&&(t[n]=i[n]);break}return t}function q6(i,e,t={}){const n=i,{target:r,eventOptions:s,window:a,enabled:o,transform:l}=n,c=W6(n,j6);if(t.shared=hm({target:r,eventOptions:s,window:a,enabled:o,transform:l},X6),e){const h=Ax.get(e);t[e]=hm(Cn({shared:t.shared},c),h)}else for(const h in c){const d=Ax.get(h);d&&(t[h]=hm(Cn({shared:t.shared},c[h]),d))}return t}class eD{constructor(e,t){Zn(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=t}add(e,t,n,r,s){const a=this._listeners,o=$V(t,n),l=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},c=Cn(Cn({},l),s);e.addEventListener(o,r,c);const h=()=>{e.removeEventListener(o,r,c),a.delete(h)};return a.add(h),h}clean(){this._listeners.forEach(e=>e()),this._listeners.clear()}}class Y6{constructor(){Zn(this,"_timeouts",new Map)}add(e,t,n=140,...r){this.remove(e),this._timeouts.set(e,window.setTimeout(t,n,...r))}remove(e){const t=this._timeouts.get(e);t&&window.clearTimeout(t)}clean(){this._timeouts.forEach(e=>{window.clearTimeout(e)}),this._timeouts.clear()}}class Z6{constructor(e){Zn(this,"gestures",new Set),Zn(this,"_targetEventStore",new eD(this)),Zn(this,"gestureEventStores",{}),Zn(this,"gestureTimeoutStores",{}),Zn(this,"handlers",{}),Zn(this,"config",{}),Zn(this,"pointerIds",new Set),Zn(this,"touchIds",new Set),Zn(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),K6(this,e)}setEventIds(e){if(b0(e))return this.touchIds=new Set(n6(e)),this.touchIds;if("pointerId"in e)return e.type==="pointerup"||e.type==="pointercancel"?this.pointerIds.delete(e.pointerId):e.type==="pointerdown"&&this.pointerIds.add(e.pointerId),this.pointerIds}applyHandlers(e,t){this.handlers=e,this.nativeHandlers=t}applyConfig(e,t){this.config=q6(e,t,this.config)}clean(){this._targetEventStore.clean();for(const e of this.gestures)this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){const t=this.config.shared,n={};let r;if(!(t.target&&(r=t.target(),!r))){if(t.enabled){for(const a of this.gestures){const o=this.config[a],l=ET(n,o.eventOptions,!!r);if(o.enabled){const c=nb.get(a);new c(this,e,a).bind(l)}}const s=ET(n,t.eventOptions,!!r);for(const a in this.nativeHandlers)s(a,"",o=>this.nativeHandlers[a](Cn(Cn({},this.state.shared),{},{event:o,args:e})),void 0,!0)}for(const s in n)n[s]=a6(...n[s]);if(!r)return n;for(const s in n){const{device:a,capture:o,passive:l}=QV(s);this._targetEventStore.add(r,a,"",n[s],{capture:o,passive:l})}}}}function Zc(i,e){i.gestures.add(e),i.gestureEventStores[e]=new eD(i,e),i.gestureTimeoutStores[e]=new Y6}function K6(i,e){e.drag&&Zc(i,"drag"),e.wheel&&Zc(i,"wheel"),e.scroll&&Zc(i,"scroll"),e.move&&Zc(i,"move"),e.pinch&&Zc(i,"pinch"),e.hover&&Zc(i,"hover")}const ET=(i,e,t)=>(n,r,s,a={},o=!1)=>{var l,c;const h=(l=a.capture)!==null&&l!==void 0?l:e.capture,d=(c=a.passive)!==null&&c!==void 0?c:e.passive;let p=o?n:KV(n,r,h);t&&d&&(p+="Passive"),i[p]=i[p]||[],i[p].push(s)},J6=/^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/;function Q6(i){const e={},t={},n=new Set;for(let r in i)J6.test(r)?(n.add(RegExp.lastMatch),t[r]=i[r]):e[r]=i[r];return[t,e,n]}function Kc(i,e,t,n,r,s){if(!i.has(t)||!nb.has(n))return;const a=t+"Start",o=t+"End",l=c=>{let h;return c.first&&a in e&&e[a](c),t in e&&(h=e[t](c)),c.last&&o in e&&e[o](c),h};r[n]=l,s[n]=s[n]||{}}function $6(i,e){const[t,n,r]=Q6(i),s={};return Kc(r,t,"onDrag","drag",s,e),Kc(r,t,"onWheel","wheel",s,e),Kc(r,t,"onScroll","scroll",s,e),Kc(r,t,"onPinch","pinch",s,e),Kc(r,t,"onMove","move",s,e),Kc(r,t,"onHover","hover",s,e),{handlers:s,config:e,nativeHandlers:n}}function e8(i,e={},t,n){const r=Ms.useMemo(()=>new Z6(i),[]);if(r.applyHandlers(i,n),r.applyConfig(e,t),Ms.useEffect(r.effect.bind(r)),Ms.useEffect(()=>r.clean.bind(r),[]),e.target===void 0)return r.bind.bind(r)}function t8(i){return i.forEach(P6),function(t,n){const{handlers:r,nativeHandlers:s,config:a}=$6(t,n||{});return e8(r,a,void 0,s)}}function n8(i,e){return t8([z6,k6,G6,H6,B6,F6])(i,e||{})}const tD=K.forwardRef(function({children:e,follow:t=!0,lockX:n=!1,lockY:r=!1,lockZ:s=!1,...a},o){const l=K.useRef(null),c=K.useRef(null),h=new yi;return u0(({camera:d})=>{if(!t||!c.current)return;const p=l.current.rotation.clone();c.current.updateMatrix(),c.current.updateWorldMatrix(!1,!1),c.current.getWorldQuaternion(h),d.getWorldQuaternion(l.current.quaternion).premultiply(h.invert()),n&&(l.current.rotation.x=p.x),r&&(l.current.rotation.y=p.y),s&&(l.current.rotation.z=p.z)}),K.useImperativeHandle(o,()=>c.current,[]),K.createElement("group",Zf({ref:c},a),K.createElement("group",{ref:l},e))});function i8(){var i=Object.create(null);function e(r,s){var a=r.id,o=r.name,l=r.dependencies;l===void 0&&(l=[]);var c=r.init;c===void 0&&(c=function(){});var h=r.getTransferables;if(h===void 0&&(h=null),!i[a])try{l=l.map(function(p){return p&&p.isWorkerModule&&(e(p,function(m){if(m instanceof Error)throw m}),p=i[p.id].value),p}),c=n("<"+o+">.init",c),h&&(h=n("<"+o+">.getTransferables",h));var d=null;typeof c=="function"?d=c.apply(void 0,l):console.error("worker module init function failed to rehydrate"),i[a]={id:a,value:d,getTransferables:h},s(d)}catch(p){p&&p.noLog||console.error(p),s(p)}}function t(r,s){var a,o=r.id,l=r.args;(!i[o]||typeof i[o].value!="function")&&s(new Error("Worker module "+o+": not found or its 'init' did not return a function"));try{var c=(a=i[o]).value.apply(a,l);c&&typeof c.then=="function"?c.then(h,function(d){return s(d instanceof Error?d:new Error(""+d))}):h(c)}catch(d){s(d)}function h(d){try{var p=i[o].getTransferables&&i[o].getTransferables(d);(!p||!Array.isArray(p)||!p.length)&&(p=void 0),s(d,p)}catch(m){console.error(m),s(m)}}}function n(r,s){var a=void 0;self.troikaDefine=function(l){return a=l};var o=URL.createObjectURL(new Blob(["/** "+r.replace(/\*/g,"")+` **/
|
|
3881
3881
|
|
|
3882
3882
|
troikaDefine(
|
|
3883
3883
|
`+s+`
|
|
@@ -4080,7 +4080,7 @@ if (edgeAlpha == 0.0) {
|
|
|
4080
4080
|
`;function q8(i){const e=Dx(i,{chained:!0,extensions:{derivatives:!0},uniforms:{uTroikaSDFTexture:{value:null},uTroikaSDFTextureSize:{value:new ke},uTroikaSDFGlyphSize:{value:0},uTroikaSDFExponent:{value:0},uTroikaTotalBounds:{value:new Bt(0,0,0,0)},uTroikaClipRect:{value:new Bt(0,0,0,0)},uTroikaEdgeOffset:{value:0},uTroikaFillOpacity:{value:1},uTroikaPositionOffset:{value:new ke},uTroikaCurveRadius:{value:0},uTroikaBlurRadius:{value:0},uTroikaStrokeWidth:{value:0},uTroikaStrokeColor:{value:new Ye},uTroikaStrokeOpacity:{value:1},uTroikaOrient:{value:new At},uTroikaUseGlyphColors:{value:!0},uTroikaSDFDebug:{value:!1}},vertexDefs:V8,vertexTransform:W8,fragmentDefs:X8,fragmentColorTransform:j8,customRewriter({vertexShader:t,fragmentShader:n}){let r=/\buniform\s+vec3\s+diffuse\b/;return r.test(n)&&(n=n.replace(r,"varying vec3 vTroikaGlyphColor").replace(/\bdiffuse\b/g,"vTroikaGlyphColor"),r.test(t)||(t=t.replace(rD,`uniform vec3 diffuse;
|
|
4081
4081
|
$&
|
|
4082
4082
|
vTroikaGlyphColor = uTroikaUseGlyphColors ? aTroikaGlyphColor / 255.0 : diffuse;
|
|
4083
|
-
`))),{vertexShader:t,fragmentShader:n}}});return e.transparent=!0,e.forceSinglePass=!0,Object.defineProperties(e,{isTroikaTextMaterial:{value:!0},shadowSide:{get(){return this.side},set(){}}}),e}const ib=new Ma({color:16777215,side:zn,transparent:!0}),NT=8421504,PT=new bt,em=new j,E_=new j,Vh=[],Y8=new j,M_="+x+y";function zT(i){return Array.isArray(i)?i[0]:i}let uD=()=>{const i=new mn(new wa(1,1),ib);return uD=()=>i,i},hD=()=>{const i=new mn(new wa(1,1,32,1),ib);return hD=()=>i,i};const Z8={type:"syncstart"},K8={type:"synccomplete"},fD=["font","fontSize","fontStyle","fontWeight","lang","letterSpacing","lineHeight","maxWidth","overflowWrap","text","direction","textAlign","textIndent","whiteSpace","anchorX","anchorY","colorRanges","sdfGlyphSize"],J8=fD.concat("material","color","depthOffset","clipRect","curveRadius","orientation","glyphGeometryDetail");let dD=class extends mn{constructor(){const e=new H8;super(e,null),this.text="",this.anchorX=0,this.anchorY=0,this.curveRadius=0,this.direction="auto",this.font=null,this.unicodeFontsURL=null,this.fontSize=.1,this.fontWeight="normal",this.fontStyle="normal",this.lang=null,this.letterSpacing=0,this.lineHeight="normal",this.maxWidth=1/0,this.overflowWrap="normal",this.textAlign="left",this.textIndent=0,this.whiteSpace="normal",this.material=null,this.color=null,this.colorRanges=null,this.outlineWidth=0,this.outlineColor=0,this.outlineOpacity=1,this.outlineBlur=0,this.outlineOffsetX=0,this.outlineOffsetY=0,this.strokeWidth=0,this.strokeColor=NT,this.strokeOpacity=1,this.fillOpacity=1,this.depthOffset=0,this.clipRect=null,this.orientation=M_,this.glyphGeometryDetail=1,this.sdfGlyphSize=null,this.gpuAccelerateSDF=!0,this.debugSDF=!1}sync(e){this._needsSync&&(this._needsSync=!1,this._isSyncing?(this._queuedSyncs||(this._queuedSyncs=[])).push(e):(this._isSyncing=!0,this.dispatchEvent(Z8),aD({text:this.text,font:this.font,lang:this.lang,fontSize:this.fontSize||.1,fontWeight:this.fontWeight||"normal",fontStyle:this.fontStyle||"normal",letterSpacing:this.letterSpacing||0,lineHeight:this.lineHeight||"normal",maxWidth:this.maxWidth,direction:this.direction||"auto",textAlign:this.textAlign,textIndent:this.textIndent,whiteSpace:this.whiteSpace,overflowWrap:this.overflowWrap,anchorX:this.anchorX,anchorY:this.anchorY,colorRanges:this.colorRanges,includeCaretPositions:!0,sdfGlyphSize:this.sdfGlyphSize,gpuAccelerateSDF:this.gpuAccelerateSDF,unicodeFontsURL:this.unicodeFontsURL},t=>{this._isSyncing=!1,this._textRenderInfo=t,this.geometry.updateGlyphs(t.glyphBounds,t.glyphAtlasIndices,t.blockBounds,t.chunkedBounds,t.glyphColors);const n=this._queuedSyncs;n&&(this._queuedSyncs=null,this._needsSync=!0,this.sync(()=>{n.forEach(r=>r&&r())})),this.dispatchEvent(K8),e&&e()})))}onBeforeRender(e,t,n,r,s,a){this.sync(),s.isTroikaTextMaterial&&this._prepareForRender(s)}dispose(){this.geometry.dispose()}get textRenderInfo(){return this._textRenderInfo||null}createDerivedMaterial(e){return q8(e)}get material(){let e=this._derivedMaterial;const t=this._baseMaterial||this._defaultMaterial||(this._defaultMaterial=ib.clone());if((!e||!e.isDerivedFrom(t))&&(e=this._derivedMaterial=this.createDerivedMaterial(t),t.addEventListener("dispose",function n(){t.removeEventListener("dispose",n),e.dispose()})),this.hasOutline()){let n=e._outlineMtl;return n||(n=e._outlineMtl=Object.create(e,{id:{value:e.id+.1}}),n.isTextOutlineMaterial=!0,n.depthWrite=!1,n.map=null,e.addEventListener("dispose",function r(){e.removeEventListener("dispose",r),n.dispose()})),[n,e]}else return e}set material(e){e&&e.isTroikaTextMaterial?(this._derivedMaterial=e,this._baseMaterial=e.baseMaterial):this._baseMaterial=e}hasOutline(){return!!(this.outlineWidth||this.outlineBlur||this.outlineOffsetX||this.outlineOffsetY)}get glyphGeometryDetail(){return this.geometry.detail}set glyphGeometryDetail(e){this.geometry.detail=e}get curveRadius(){return this.geometry.curveRadius}set curveRadius(e){this.geometry.curveRadius=e}get customDepthMaterial(){return zT(this.material).getDepthMaterial()}set customDepthMaterial(e){}get customDistanceMaterial(){return zT(this.material).getDistanceMaterial()}set customDistanceMaterial(e){}_prepareForRender(e){const t=e.isTextOutlineMaterial,n=e.uniforms,r=this.textRenderInfo;if(r){const{sdfTexture:o,blockBounds:l}=r;n.uTroikaSDFTexture.value=o,n.uTroikaSDFTextureSize.value.set(o.image.width,o.image.height),n.uTroikaSDFGlyphSize.value=r.sdfGlyphSize,n.uTroikaSDFExponent.value=r.sdfExponent,n.uTroikaTotalBounds.value.fromArray(l),n.uTroikaUseGlyphColors.value=!t&&!!r.glyphColors;let c=0,h=0,d=0,p,m,v,x=0,_=0;if(t){let{outlineWidth:b,outlineOffsetX:E,outlineOffsetY:S,outlineBlur:w,outlineOpacity:T}=this;c=this._parsePercent(b)||0,h=Math.max(0,this._parsePercent(w)||0),p=T,x=this._parsePercent(E)||0,_=this._parsePercent(S)||0}else d=Math.max(0,this._parsePercent(this.strokeWidth)||0),d&&(v=this.strokeColor,n.uTroikaStrokeColor.value.set(v??NT),m=this.strokeOpacity,m==null&&(m=1)),p=this.fillOpacity;n.uTroikaEdgeOffset.value=c,n.uTroikaPositionOffset.value.set(x,_),n.uTroikaBlurRadius.value=h,n.uTroikaStrokeWidth.value=d,n.uTroikaStrokeOpacity.value=m,n.uTroikaFillOpacity.value=p??1,n.uTroikaCurveRadius.value=this.curveRadius||0;let g=this.clipRect;if(g&&Array.isArray(g)&&g.length===4)n.uTroikaClipRect.value.fromArray(g);else{const b=(this.fontSize||.1)*100;n.uTroikaClipRect.value.set(l[0]-b,l[1]-b,l[2]+b,l[3]+b)}this.geometry.applyClipRect(n.uTroikaClipRect.value)}n.uTroikaSDFDebug.value=!!this.debugSDF,e.polygonOffset=!!this.depthOffset,e.polygonOffsetFactor=e.polygonOffsetUnits=this.depthOffset||0;const s=t?this.outlineColor||0:this.color;if(s==null)delete e.color;else{const o=e.hasOwnProperty("color")?e.color:e.color=new Ye;(s!==o._input||typeof s=="object")&&o.set(o._input=s)}let a=this.orientation||M_;if(a!==e._orientation){let o=n.uTroikaOrient.value;a=a.replace(/[^-+xyz]/g,"");let l=a!==M_&&a.match(/^([-+])([xyz])([-+])([xyz])$/);if(l){let[,c,h,d,p]=l;em.set(0,0,0)[h]=c==="-"?1:-1,E_.set(0,0,0)[p]=d==="-"?-1:1,PT.lookAt(Y8,em.cross(E_),E_),o.setFromMatrix4(PT)}else o.identity();e._orientation=a}}_parsePercent(e){if(typeof e=="string"){let t=e.match(/^(-?[\d.]+)%$/),n=t?parseFloat(t[1]):NaN;e=(isNaN(n)?0:n/100)*this.fontSize}return e}localPositionToTextCoords(e,t=new ke){t.copy(e);const n=this.curveRadius;return n&&(t.x=Math.atan2(e.x,Math.abs(n)-Math.abs(e.z))*Math.abs(n)),t}worldPositionToTextCoords(e,t=new ke){return em.copy(e),this.localPositionToTextCoords(this.worldToLocal(em),t)}raycast(e,t){const{textRenderInfo:n,curveRadius:r}=this;if(n){const s=n.blockBounds,a=r?hD():uD(),o=a.geometry,{position:l,uv:c}=o.attributes;for(let h=0;h<c.count;h++){let d=s[0]+c.getX(h)*(s[2]-s[0]);const p=s[1]+c.getY(h)*(s[3]-s[1]);let m=0;r&&(m=r-Math.cos(d/r)*r,d=Math.sin(d/r)*r),l.setXYZ(h,d,p,m)}o.boundingSphere=this.geometry.boundingSphere,o.boundingBox=this.geometry.boundingBox,a.matrixWorld=this.matrixWorld,a.material.side=this.material.side,Vh.length=0,a.raycast(e,Vh);for(let h=0;h<Vh.length;h++)Vh[h].object=this,t.push(Vh[h])}}copy(e){const t=this.geometry;return super.copy(e),this.geometry=t,J8.forEach(n=>{this[n]=e[n]}),this}clone(){return new this.constructor().copy(this)}};fD.forEach(i=>{const e="_private_"+i;Object.defineProperty(dD.prototype,i,{get(){return this[e]},set(t){t!==this[e]&&(this[e]=t,this._needsSync=!0)}})});new Qn;new Ye;const Q8=K.forwardRef(({sdfGlyphSize:i=64,anchorX:e="center",anchorY:t="middle",font:n,fontSize:r=1,children:s,characters:a,onSync:o,...l},c)=>{const h=Jn(({invalidate:v})=>v),[d]=K.useState(()=>new dD),[p,m]=K.useMemo(()=>{const v=[];let x="";return K.Children.forEach(s,_=>{typeof _=="string"||typeof _=="number"?x+=_:v.push(_)}),[v,x]},[s]);return B4(()=>new Promise(v=>N8({font:n,characters:a},v)),["troika-text",n,a]),K.useLayoutEffect(()=>void d.sync(()=>{h(),o&&o(d)})),K.useEffect(()=>()=>d.dispose(),[d]),K.createElement("primitive",Zf({object:d,ref:c,font:n,text:m,anchorX:e,anchorY:t,fontSize:r,sdfGlyphSize:i},l),p)}),bs=1e-5;function $8(i,e,t){const n=new lo,r=t-bs;return n.absarc(bs,bs,bs,-Math.PI/2,-Math.PI,!0),n.absarc(bs,e-r*2,bs,Math.PI,Math.PI/2,!0),n.absarc(i-r*2,e-r*2,bs,Math.PI/2,0,!0),n.absarc(i-r*2,bs,bs,0,-Math.PI/2,!0),n}const FT=K.forwardRef(function({args:[e=1,t=1,n=1]=[],radius:r=.05,steps:s=1,smoothness:a=4,bevelSegments:o=4,creaseAngle:l=.4,children:c,...h},d){return K.createElement("mesh",Zf({ref:d},h),K.createElement(e7,{args:[e,t,n],radius:r,steps:s,smoothness:a,bevelSegments:o,creaseAngle:l}),c)}),e7=K.forwardRef(function({args:[e=1,t=1,n=1]=[],radius:r=.05,steps:s=1,smoothness:a=4,bevelSegments:o=4,creaseAngle:l=.4,...c},h){const d=K.useMemo(()=>$8(e,t,r),[e,t,r]),p=K.useMemo(()=>({depth:n-r*2,bevelEnabled:!0,bevelSegments:o*2,steps:s,bevelSize:r-bs,bevelThickness:r,curveSegments:a}),[n,r,a,o,s]),m=K.useRef(null);return K.useLayoutEffect(()=>{m.current&&(m.current.center(),iG(m.current,l))},[d,p,l]),K.useImperativeHandle(h,()=>m.current),K.createElement("extrudeGeometry",Zf({ref:m,args:[d,p]},c))});var Wh={exports:{}},BT;function t7(){if(BT)return Wh.exports;BT=1;const i={ellipse:"…",chars:[" ","-"],max:140,truncate:!0};function e(n,r,s,a){if(n.length<=r)return n;if(r<2)return n.slice(0,r-s.length)+s;const o=r-s.length,l=Math.floor(o/2);let c=l,h=n.length-l;for(let d=0;d<l;d++){const p=n.charAt(d),m=n.length-d,v=n.charAt(m);a.indexOf(p)!==-1&&(c=d),a.indexOf(v)!==-1&&(h=m)}return n.slice(0,c)+s+n.slice(h)}function t(n,r,s,a,o){if(n.length<=r)return n;const l=r-s.length;let c=l,h=!1;for(let d=0;d<=l;d++){const p=n.charAt(d);a.indexOf(p)!==-1&&(c=d,h=!0)}return!o&&!h?"":n.slice(0,c)+s}return Wh.exports=(n,r,s)=>{if(typeof n!="string"||n.length===0||r===0)return"";s=s||{};for(var a in i)(s[a]===null||typeof s[a]>"u")&&(s[a]=i[a]);return s.max=r||s.max,s.truncate==="middle"?e(n,s.max,s.ellipse,s.chars):t(n,s.max,s.ellipse,s.chars,s.truncate)},Wh.exports.ellipsizeMiddle=e,Wh.exports.ellipsize=t,Wh.exports}var n7=t7();const i7=mo(n7);var w_,kT;function r7(){if(kT)return w_;kT=1;var i=z1(),e=Aa(),t={dimensions:["x","y"],center:.5,scale:1};function n(s,a,o){if(!e(a))throw new Error("graphology-layout/random: the given graph is not a valid graphology instance.");o=i(o,t);var l=o.dimensions;if(!Array.isArray(l)||l.length!==2)throw new Error("graphology-layout/random: given dimensions are invalid.");var c=o.center,h=o.scale,d=Math.PI*2,p=(c-.5)*h,m=a.order,v=l[0],x=l[1];function _(E,S){return S[v]=h*Math.cos(E*d/m)+p,S[x]=h*Math.sin(E*d/m)+p,S}var g=0;if(!s){var b={};return a.forEachNode(function(E){b[E]=_(g++,{})}),b}a.updateEachNodeAttributes(function(E,S){return _(g++,S),S},{attributes:l})}var r=n.bind(null,!1);return r.assign=n.bind(null,!0),w_=r,w_}var s7=r7();const a7=mo(s7);var T_,GT;function o7(){if(GT)return T_;GT=1;var i=z1(),e=Aa(),t={dimensions:["x","y"],center:.5,rng:Math.random,scale:1};function n(s,a,o){if(!e(a))throw new Error("graphology-layout/random: the given graph is not a valid graphology instance.");o=i(o,t);var l=o.dimensions;if(!Array.isArray(l)||l.length<1)throw new Error("graphology-layout/random: given dimensions are invalid.");var c=l.length,h=o.center,d=o.rng,p=o.scale,m=(h-.5)*p;function v(_){for(var g=0;g<c;g++)_[l[g]]=d()*p+m;return _}if(!s){var x={};return a.forEachNode(function(_){x[_]=v({})}),x}a.updateEachNodeAttributes(function(_,g){return v(g),g},{attributes:l})}var r=n.bind(null,!1);return r.assign=n.bind(null,!0),T_=r,T_}var l7=o7();const c7=mo(l7);var A_,HT;function u7(){if(HT)return A_;HT=1;var i=0,e=1,t=2,n=3,r=4,s=5,a=6,o=7,l=8,c=9,h=0,d=1,p=2,m=0,v=1,x=2,_=3,g=4,b=5,E=6,S=7,w=8,T=3,R=10,U=3,A=9,D=10;return A_=function(P,I,V){var H,z,O,B,G,X,k,Y,Q,te,ee=I.length,ie=V.length,re=P.adjustSizes,de=P.barnesHutTheta*P.barnesHutTheta,Ae,Me,ve,fe,J,oe,se,$=[];for(O=0;O<ee;O+=R)I[O+r]=I[O+t],I[O+s]=I[O+n],I[O+t]=0,I[O+n]=0;if(P.outboundAttractionDistribution){for(Ae=0,O=0;O<ee;O+=R)Ae+=I[O+a];Ae/=ee/R}if(P.barnesHutOptimize){var pe=1/0,ye=-1/0,xe=1/0,be=-1/0,ue,He,W;for(O=0;O<ee;O+=R)pe=Math.min(pe,I[O+i]),ye=Math.max(ye,I[O+i]),xe=Math.min(xe,I[O+e]),be=Math.max(be,I[O+e]);var F=ye-pe,ne=be-xe;for(F>ne?(xe-=(F-ne)/2,be=xe+F):(pe-=(ne-F)/2,ye=pe+ne),$[0+m]=-1,$[0+v]=(pe+ye)/2,$[0+x]=(xe+be)/2,$[0+_]=Math.max(ye-pe,be-xe),$[0+g]=-1,$[0+b]=-1,$[0+E]=0,$[0+S]=0,$[0+w]=0,H=1,O=0;O<ee;O+=R)for(z=0,W=T;;)if($[z+b]>=0){I[O+i]<$[z+v]?I[O+e]<$[z+x]?ue=$[z+b]:ue=$[z+b]+A:I[O+e]<$[z+x]?ue=$[z+b]+A*2:ue=$[z+b]+A*3,$[z+S]=($[z+S]*$[z+E]+I[O+i]*I[O+a])/($[z+E]+I[O+a]),$[z+w]=($[z+w]*$[z+E]+I[O+e]*I[O+a])/($[z+E]+I[O+a]),$[z+E]+=I[O+a],z=ue;continue}else if($[z+m]<0){$[z+m]=O;break}else{if($[z+b]=H*A,Y=$[z+_]/2,Q=$[z+b],$[Q+m]=-1,$[Q+v]=$[z+v]-Y,$[Q+x]=$[z+x]-Y,$[Q+_]=Y,$[Q+g]=Q+A,$[Q+b]=-1,$[Q+E]=0,$[Q+S]=0,$[Q+w]=0,Q+=A,$[Q+m]=-1,$[Q+v]=$[z+v]-Y,$[Q+x]=$[z+x]+Y,$[Q+_]=Y,$[Q+g]=Q+A,$[Q+b]=-1,$[Q+E]=0,$[Q+S]=0,$[Q+w]=0,Q+=A,$[Q+m]=-1,$[Q+v]=$[z+v]+Y,$[Q+x]=$[z+x]-Y,$[Q+_]=Y,$[Q+g]=Q+A,$[Q+b]=-1,$[Q+E]=0,$[Q+S]=0,$[Q+w]=0,Q+=A,$[Q+m]=-1,$[Q+v]=$[z+v]+Y,$[Q+x]=$[z+x]+Y,$[Q+_]=Y,$[Q+g]=$[z+g],$[Q+b]=-1,$[Q+E]=0,$[Q+S]=0,$[Q+w]=0,H+=4,I[$[z+m]+i]<$[z+v]?I[$[z+m]+e]<$[z+x]?ue=$[z+b]:ue=$[z+b]+A:I[$[z+m]+e]<$[z+x]?ue=$[z+b]+A*2:ue=$[z+b]+A*3,$[z+E]=I[$[z+m]+a],$[z+S]=I[$[z+m]+i],$[z+w]=I[$[z+m]+e],$[ue+m]=$[z+m],$[z+m]=-1,I[O+i]<$[z+v]?I[O+e]<$[z+x]?He=$[z+b]:He=$[z+b]+A:I[O+e]<$[z+x]?He=$[z+b]+A*2:He=$[z+b]+A*3,ue===He)if(W--){z=ue;continue}else{W=T;break}$[He+m]=O;break}}if(P.barnesHutOptimize)for(Me=P.scalingRatio,O=0;O<ee;O+=R)for(z=0;;)if($[z+b]>=0)if(oe=Math.pow(I[O+i]-$[z+S],2)+Math.pow(I[O+e]-$[z+w],2),te=$[z+_],4*te*te/oe<de){if(ve=I[O+i]-$[z+S],fe=I[O+e]-$[z+w],re===!0?oe>0?(se=Me*I[O+a]*$[z+E]/oe,I[O+t]+=ve*se,I[O+n]+=fe*se):oe<0&&(se=-Me*I[O+a]*$[z+E]/Math.sqrt(oe),I[O+t]+=ve*se,I[O+n]+=fe*se):oe>0&&(se=Me*I[O+a]*$[z+E]/oe,I[O+t]+=ve*se,I[O+n]+=fe*se),z=$[z+g],z<0)break;continue}else{z=$[z+b];continue}else{if(X=$[z+m],X>=0&&X!==O&&(ve=I[O+i]-I[X+i],fe=I[O+e]-I[X+e],oe=ve*ve+fe*fe,re===!0?oe>0?(se=Me*I[O+a]*I[X+a]/oe,I[O+t]+=ve*se,I[O+n]+=fe*se):oe<0&&(se=-Me*I[O+a]*I[X+a]/Math.sqrt(oe),I[O+t]+=ve*se,I[O+n]+=fe*se):oe>0&&(se=Me*I[O+a]*I[X+a]/oe,I[O+t]+=ve*se,I[O+n]+=fe*se)),z=$[z+g],z<0)break;continue}else for(Me=P.scalingRatio,B=0;B<ee;B+=R)for(G=0;G<B;G+=R)ve=I[B+i]-I[G+i],fe=I[B+e]-I[G+e],re===!0?(oe=Math.sqrt(ve*ve+fe*fe)-I[B+l]-I[G+l],oe>0?(se=Me*I[B+a]*I[G+a]/oe/oe,I[B+t]+=ve*se,I[B+n]+=fe*se,I[G+t]-=ve*se,I[G+n]-=fe*se):oe<0&&(se=100*Me*I[B+a]*I[G+a],I[B+t]+=ve*se,I[B+n]+=fe*se,I[G+t]-=ve*se,I[G+n]-=fe*se)):(oe=Math.sqrt(ve*ve+fe*fe),oe>0&&(se=Me*I[B+a]*I[G+a]/oe/oe,I[B+t]+=ve*se,I[B+n]+=fe*se,I[G+t]-=ve*se,I[G+n]-=fe*se));for(Q=P.gravity/P.scalingRatio,Me=P.scalingRatio,O=0;O<ee;O+=R)se=0,ve=I[O+i],fe=I[O+e],oe=Math.sqrt(Math.pow(ve,2)+Math.pow(fe,2)),P.strongGravityMode?oe>0&&(se=Me*I[O+a]*Q):oe>0&&(se=Me*I[O+a]*Q/oe),I[O+t]-=ve*se,I[O+n]-=fe*se;for(Me=1*(P.outboundAttractionDistribution?Ae:1),k=0;k<ie;k+=U)B=V[k+h],G=V[k+d],Y=V[k+p],J=Math.pow(Y,P.edgeWeightInfluence),ve=I[B+i]-I[G+i],fe=I[B+e]-I[G+e],re===!0?(oe=Math.sqrt(ve*ve+fe*fe)-I[B+l]-I[G+l],P.linLogMode?P.outboundAttractionDistribution?oe>0&&(se=-Me*J*Math.log(1+oe)/oe/I[B+a]):oe>0&&(se=-Me*J*Math.log(1+oe)/oe):P.outboundAttractionDistribution?oe>0&&(se=-Me*J/I[B+a]):oe>0&&(se=-Me*J)):(oe=Math.sqrt(Math.pow(ve,2)+Math.pow(fe,2)),P.linLogMode?P.outboundAttractionDistribution?oe>0&&(se=-Me*J*Math.log(1+oe)/oe/I[B+a]):oe>0&&(se=-Me*J*Math.log(1+oe)/oe):P.outboundAttractionDistribution?(oe=1,se=-Me*J/I[B+a]):(oe=1,se=-Me*J)),oe>0&&(I[B+t]+=ve*se,I[B+n]+=fe*se,I[G+t]-=ve*se,I[G+n]-=fe*se);var Se,_e,me,ze,Ne,je;if(re===!0)for(O=0;O<ee;O+=R)I[O+c]!==1&&(Se=Math.sqrt(Math.pow(I[O+t],2)+Math.pow(I[O+n],2)),Se>D&&(I[O+t]=I[O+t]*D/Se,I[O+n]=I[O+n]*D/Se),_e=I[O+a]*Math.sqrt((I[O+r]-I[O+t])*(I[O+r]-I[O+t])+(I[O+s]-I[O+n])*(I[O+s]-I[O+n])),me=Math.sqrt((I[O+r]+I[O+t])*(I[O+r]+I[O+t])+(I[O+s]+I[O+n])*(I[O+s]+I[O+n]))/2,ze=.1*Math.log(1+me)/(1+Math.sqrt(_e)),Ne=I[O+i]+I[O+t]*(ze/P.slowDown),I[O+i]=Ne,je=I[O+e]+I[O+n]*(ze/P.slowDown),I[O+e]=je);else for(O=0;O<ee;O+=R)I[O+c]!==1&&(_e=I[O+a]*Math.sqrt((I[O+r]-I[O+t])*(I[O+r]-I[O+t])+(I[O+s]-I[O+n])*(I[O+s]-I[O+n])),me=Math.sqrt((I[O+r]+I[O+t])*(I[O+r]+I[O+t])+(I[O+s]+I[O+n])*(I[O+s]+I[O+n]))/2,ze=I[O+o]*Math.log(1+me)/(1+Math.sqrt(_e)),I[O+o]=Math.min(1,Math.sqrt(ze*(Math.pow(I[O+t],2)+Math.pow(I[O+n],2))/(1+Math.sqrt(_e)))),Ne=I[O+i]+I[O+t]*(ze/P.slowDown),I[O+i]=Ne,je=I[O+e]+I[O+n]*(ze/P.slowDown),I[O+e]=je);return{}},A_}var ca={},VT;function h7(){if(VT)return ca;VT=1;var i=10,e=3;return ca.assign=function(t){t=t||{};var n=Array.prototype.slice.call(arguments).slice(1),r,s,a;for(r=0,a=n.length;r<a;r++)if(n[r])for(s in n[r])t[s]=n[r][s];return t},ca.validateSettings=function(t){return"linLogMode"in t&&typeof t.linLogMode!="boolean"?{message:"the `linLogMode` setting should be a boolean."}:"outboundAttractionDistribution"in t&&typeof t.outboundAttractionDistribution!="boolean"?{message:"the `outboundAttractionDistribution` setting should be a boolean."}:"adjustSizes"in t&&typeof t.adjustSizes!="boolean"?{message:"the `adjustSizes` setting should be a boolean."}:"edgeWeightInfluence"in t&&typeof t.edgeWeightInfluence!="number"?{message:"the `edgeWeightInfluence` setting should be a number."}:"scalingRatio"in t&&!(typeof t.scalingRatio=="number"&&t.scalingRatio>=0)?{message:"the `scalingRatio` setting should be a number >= 0."}:"strongGravityMode"in t&&typeof t.strongGravityMode!="boolean"?{message:"the `strongGravityMode` setting should be a boolean."}:"gravity"in t&&!(typeof t.gravity=="number"&&t.gravity>=0)?{message:"the `gravity` setting should be a number >= 0."}:"slowDown"in t&&!(typeof t.slowDown=="number"||t.slowDown>=0)?{message:"the `slowDown` setting should be a number >= 0."}:"barnesHutOptimize"in t&&typeof t.barnesHutOptimize!="boolean"?{message:"the `barnesHutOptimize` setting should be a boolean."}:"barnesHutTheta"in t&&!(typeof t.barnesHutTheta=="number"&&t.barnesHutTheta>=0)?{message:"the `barnesHutTheta` setting should be a number >= 0."}:null},ca.graphToByteArrays=function(t,n){var r=t.order,s=t.size,a={},o,l=new Float32Array(r*i),c=new Float32Array(s*e);return o=0,t.forEachNode(function(h,d){a[h]=o,l[o]=d.x,l[o+1]=d.y,l[o+2]=0,l[o+3]=0,l[o+4]=0,l[o+5]=0,l[o+6]=1,l[o+7]=1,l[o+8]=d.size||1,l[o+9]=d.fixed?1:0,o+=i}),o=0,t.forEachEdge(function(h,d,p,m,v,x,_){var g=a[p],b=a[m],E=n(h,d,p,m,v,x,_);l[g+6]+=E,l[b+6]+=E,c[o]=g,c[o+1]=b,c[o+2]=E,o+=e}),{nodes:l,edges:c}},ca.assignLayoutChanges=function(t,n,r){var s=0;t.updateEachNodeAttributes(function(a,o){return o.x=n[s],o.y=n[s+1],s+=i,r?r(a,o):o})},ca.readGraphPositions=function(t,n){var r=0;t.forEachNode(function(s,a){n[r]=a.x,n[r+1]=a.y,r+=i})},ca.collectLayoutChanges=function(t,n,r){for(var s=t.nodes(),a={},o=0,l=0,c=n.length;o<c;o+=i){if(r){var h=Object.assign({},t.getNodeAttributes(s[l]));h.x=n[o],h.y=n[o+1],h=r(s[l],h),a[s[l]]={x:h.x,y:h.y}}else a[s[l]]={x:n[o],y:n[o+1]};l++}return a},ca.createWorker=function(n){var r=window.URL||window.webkitURL,s=n.toString(),a=r.createObjectURL(new Blob(["("+s+").call(this);"],{type:"text/javascript"})),o=new Worker(a);return r.revokeObjectURL(a),o},ca}var C_,WT;function f7(){return WT||(WT=1,C_={linLogMode:!1,outboundAttractionDistribution:!1,adjustSizes:!1,edgeWeightInfluence:1,scalingRatio:1,strongGravityMode:!1,gravity:1,slowDown:1,barnesHutOptimize:!1,barnesHutTheta:.5}),C_}var R_,XT;function d7(){if(XT)return R_;XT=1;var i=Aa(),e=d0().createEdgeWeightGetter,t=u7(),n=h7(),r=f7();function s(l,c,h){if(!i(c))throw new Error("graphology-layout-forceatlas2: the given graph is not a valid graphology instance.");typeof h=="number"&&(h={iterations:h});var d=h.iterations;if(typeof d!="number")throw new Error("graphology-layout-forceatlas2: invalid number of iterations.");if(d<=0)throw new Error("graphology-layout-forceatlas2: you should provide a positive number of iterations.");var p=e("getEdgeWeight"in h?h.getEdgeWeight:"weight").fromEntry,m=typeof h.outputReducer=="function"?h.outputReducer:null,v=n.assign({},r,h.settings),x=n.validateSettings(v);if(x)throw new Error("graphology-layout-forceatlas2: "+x.message);var _=n.graphToByteArrays(c,p),g;for(g=0;g<d;g++)t(v,_.nodes,_.edges);if(l){n.assignLayoutChanges(c,_.nodes,m);return}return n.collectLayoutChanges(c,_.nodes)}function a(l){var c=typeof l=="number"?l:l.order;return{barnesHutOptimize:c>2e3,strongGravityMode:!0,gravity:.05,scalingRatio:10,slowDown:1+Math.log(c)}}var o=s.bind(null,!1);return o.assign=s.bind(null,!0),o.inferSettings=a,R_=o,R_}var p7=d7();const m7=mo(p7);function g7(i,e,t){var n,r=1;i==null&&(i=0),e==null&&(e=0),t==null&&(t=0);function s(){var a,o=n.length,l,c=0,h=0,d=0;for(a=0;a<o;++a)l=n[a],c+=l.x||0,h+=l.y||0,d+=l.z||0;for(c=(c/o-i)*r,h=(h/o-e)*r,d=(d/o-t)*r,a=0;a<o;++a)l=n[a],c&&(l.x-=c),h&&(l.y-=h),d&&(l.z-=d)}return s.initialize=function(a){n=a},s.x=function(a){return arguments.length?(i=+a,s):i},s.y=function(a){return arguments.length?(e=+a,s):e},s.z=function(a){return arguments.length?(t=+a,s):t},s.strength=function(a){return arguments.length?(r=+a,s):r},s}function v7(i){const e=+this._x.call(null,i);return pD(this.cover(e),e,i)}function pD(i,e,t){if(isNaN(e))return i;var n,r=i._root,s={data:t},a=i._x0,o=i._x1,l,c,h,d,p;if(!r)return i._root=s,i;for(;r.length;)if((h=e>=(l=(a+o)/2))?a=l:o=l,n=r,!(r=r[d=+h]))return n[d]=s,i;if(c=+i._x.call(null,r.data),e===c)return s.next=r,n?n[d]=s:i._root=s,i;do n=n?n[d]=new Array(2):i._root=new Array(2),(h=e>=(l=(a+o)/2))?a=l:o=l;while((d=+h)==(p=+(c>=l)));return n[p]=r,n[d]=s,i}function y7(i){Array.isArray(i)||(i=Array.from(i));const e=i.length,t=new Float64Array(e);let n=1/0,r=-1/0;for(let s=0,a;s<e;++s)isNaN(a=+this._x.call(null,i[s]))||(t[s]=a,a<n&&(n=a),a>r&&(r=a));if(n>r)return this;this.cover(n).cover(r);for(let s=0;s<e;++s)pD(this,t[s],i[s]);return this}function _7(i){if(isNaN(i=+i))return this;var e=this._x0,t=this._x1;if(isNaN(e))t=(e=Math.floor(i))+1;else{for(var n=t-e||1,r=this._root,s,a;e>i||i>=t;)switch(a=+(i<e),s=new Array(2),s[a]=r,r=s,n*=2,a){case 0:t=e+n;break;case 1:e=t-n;break}this._root&&this._root.length&&(this._root=r)}return this._x0=e,this._x1=t,this}function x7(){var i=[];return this.visit(function(e){if(!e.length)do i.push(e.data);while(e=e.next)}),i}function b7(i){return arguments.length?this.cover(+i[0][0]).cover(+i[1][0]):isNaN(this._x0)?void 0:[[this._x0],[this._x1]]}function ya(i,e,t){this.node=i,this.x0=e,this.x1=t}function S7(i,e){var t,n=this._x0,r,s,a=this._x1,o=[],l=this._root,c,h;for(l&&o.push(new ya(l,n,a)),e==null?e=1/0:(n=i-e,a=i+e);c=o.pop();)if(!(!(l=c.node)||(r=c.x0)>a||(s=c.x1)<n))if(l.length){var d=(r+s)/2;o.push(new ya(l[1],d,s),new ya(l[0],r,d)),(h=+(i>=d))&&(c=o[o.length-1],o[o.length-1]=o[o.length-1-h],o[o.length-1-h]=c)}else{var p=Math.abs(i-+this._x.call(null,l.data));p<e&&(e=p,n=i-p,a=i+p,t=l.data)}return t}function E7(i){if(isNaN(l=+this._x.call(null,i)))return this;var e,t=this._root,n,r,s,a=this._x0,o=this._x1,l,c,h,d,p;if(!t)return this;if(t.length)for(;;){if((h=l>=(c=(a+o)/2))?a=c:o=c,e=t,!(t=t[d=+h]))return this;if(!t.length)break;e[d+1&1]&&(n=e,p=d)}for(;t.data!==i;)if(r=t,!(t=t.next))return this;return(s=t.next)&&delete t.next,r?(s?r.next=s:delete r.next,this):e?(s?e[d]=s:delete e[d],(t=e[0]||e[1])&&t===(e[1]||e[0])&&!t.length&&(n?n[p]=t:this._root=t),this):(this._root=s,this)}function M7(i){for(var e=0,t=i.length;e<t;++e)this.remove(i[e]);return this}function w7(){return this._root}function T7(){var i=0;return this.visit(function(e){if(!e.length)do++i;while(e=e.next)}),i}function A7(i){var e=[],t,n=this._root,r,s,a;for(n&&e.push(new ya(n,this._x0,this._x1));t=e.pop();)if(!i(n=t.node,s=t.x0,a=t.x1)&&n.length){var o=(s+a)/2;(r=n[1])&&e.push(new ya(r,o,a)),(r=n[0])&&e.push(new ya(r,s,o))}return this}function C7(i){var e=[],t=[],n;for(this._root&&e.push(new ya(this._root,this._x0,this._x1));n=e.pop();){var r=n.node;if(r.length){var s,a=n.x0,o=n.x1,l=(a+o)/2;(s=r[0])&&e.push(new ya(s,a,l)),(s=r[1])&&e.push(new ya(s,l,o))}t.push(n)}for(;n=t.pop();)i(n.node,n.x0,n.x1);return this}function R7(i){return i[0]}function D7(i){return arguments.length?(this._x=i,this):this._x}function rb(i,e){var t=new sb(e??R7,NaN,NaN);return i==null?t:t.addAll(i)}function sb(i,e,t){this._x=i,this._x0=e,this._x1=t,this._root=void 0}function jT(i){for(var e={data:i.data},t=e;i=i.next;)t=t.next={data:i.data};return e}var ir=rb.prototype=sb.prototype;ir.copy=function(){var i=new sb(this._x,this._x0,this._x1),e=this._root,t,n;if(!e)return i;if(!e.length)return i._root=jT(e),i;for(t=[{source:e,target:i._root=new Array(2)}];e=t.pop();)for(var r=0;r<2;++r)(n=e.source[r])&&(n.length?t.push({source:n,target:e.target[r]=new Array(2)}):e.target[r]=jT(n));return i};ir.add=v7;ir.addAll=y7;ir.cover=_7;ir.data=x7;ir.extent=b7;ir.find=S7;ir.remove=E7;ir.removeAll=M7;ir.root=w7;ir.size=T7;ir.visit=A7;ir.visitAfter=C7;ir.x=D7;function U7(i){const e=+this._x.call(null,i),t=+this._y.call(null,i);return mD(this.cover(e,t),e,t,i)}function mD(i,e,t,n){if(isNaN(e)||isNaN(t))return i;var r,s=i._root,a={data:n},o=i._x0,l=i._y0,c=i._x1,h=i._y1,d,p,m,v,x,_,g,b;if(!s)return i._root=a,i;for(;s.length;)if((x=e>=(d=(o+c)/2))?o=d:c=d,(_=t>=(p=(l+h)/2))?l=p:h=p,r=s,!(s=s[g=_<<1|x]))return r[g]=a,i;if(m=+i._x.call(null,s.data),v=+i._y.call(null,s.data),e===m&&t===v)return a.next=s,r?r[g]=a:i._root=a,i;do r=r?r[g]=new Array(4):i._root=new Array(4),(x=e>=(d=(o+c)/2))?o=d:c=d,(_=t>=(p=(l+h)/2))?l=p:h=p;while((g=_<<1|x)===(b=(v>=p)<<1|m>=d));return r[b]=s,r[g]=a,i}function O7(i){var e,t,n=i.length,r,s,a=new Array(n),o=new Array(n),l=1/0,c=1/0,h=-1/0,d=-1/0;for(t=0;t<n;++t)isNaN(r=+this._x.call(null,e=i[t]))||isNaN(s=+this._y.call(null,e))||(a[t]=r,o[t]=s,r<l&&(l=r),r>h&&(h=r),s<c&&(c=s),s>d&&(d=s));if(l>h||c>d)return this;for(this.cover(l,c).cover(h,d),t=0;t<n;++t)mD(this,a[t],o[t],i[t]);return this}function L7(i,e){if(isNaN(i=+i)||isNaN(e=+e))return this;var t=this._x0,n=this._y0,r=this._x1,s=this._y1;if(isNaN(t))r=(t=Math.floor(i))+1,s=(n=Math.floor(e))+1;else{for(var a=r-t||1,o=this._root,l,c;t>i||i>=r||n>e||e>=s;)switch(c=(e<n)<<1|i<t,l=new Array(4),l[c]=o,o=l,a*=2,c){case 0:r=t+a,s=n+a;break;case 1:t=r-a,s=n+a;break;case 2:r=t+a,n=s-a;break;case 3:t=r-a,n=s-a;break}this._root&&this._root.length&&(this._root=o)}return this._x0=t,this._y0=n,this._x1=r,this._y1=s,this}function I7(){var i=[];return this.visit(function(e){if(!e.length)do i.push(e.data);while(e=e.next)}),i}function N7(i){return arguments.length?this.cover(+i[0][0],+i[0][1]).cover(+i[1][0],+i[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function zi(i,e,t,n,r){this.node=i,this.x0=e,this.y0=t,this.x1=n,this.y1=r}function P7(i,e,t){var n,r=this._x0,s=this._y0,a,o,l,c,h=this._x1,d=this._y1,p=[],m=this._root,v,x;for(m&&p.push(new zi(m,r,s,h,d)),t==null?t=1/0:(r=i-t,s=e-t,h=i+t,d=e+t,t*=t);v=p.pop();)if(!(!(m=v.node)||(a=v.x0)>h||(o=v.y0)>d||(l=v.x1)<r||(c=v.y1)<s))if(m.length){var _=(a+l)/2,g=(o+c)/2;p.push(new zi(m[3],_,g,l,c),new zi(m[2],a,g,_,c),new zi(m[1],_,o,l,g),new zi(m[0],a,o,_,g)),(x=(e>=g)<<1|i>=_)&&(v=p[p.length-1],p[p.length-1]=p[p.length-1-x],p[p.length-1-x]=v)}else{var b=i-+this._x.call(null,m.data),E=e-+this._y.call(null,m.data),S=b*b+E*E;if(S<t){var w=Math.sqrt(t=S);r=i-w,s=e-w,h=i+w,d=e+w,n=m.data}}return n}function z7(i){if(isNaN(h=+this._x.call(null,i))||isNaN(d=+this._y.call(null,i)))return this;var e,t=this._root,n,r,s,a=this._x0,o=this._y0,l=this._x1,c=this._y1,h,d,p,m,v,x,_,g;if(!t)return this;if(t.length)for(;;){if((v=h>=(p=(a+l)/2))?a=p:l=p,(x=d>=(m=(o+c)/2))?o=m:c=m,e=t,!(t=t[_=x<<1|v]))return this;if(!t.length)break;(e[_+1&3]||e[_+2&3]||e[_+3&3])&&(n=e,g=_)}for(;t.data!==i;)if(r=t,!(t=t.next))return this;return(s=t.next)&&delete t.next,r?(s?r.next=s:delete r.next,this):e?(s?e[_]=s:delete e[_],(t=e[0]||e[1]||e[2]||e[3])&&t===(e[3]||e[2]||e[1]||e[0])&&!t.length&&(n?n[g]=t:this._root=t),this):(this._root=s,this)}function F7(i){for(var e=0,t=i.length;e<t;++e)this.remove(i[e]);return this}function B7(){return this._root}function k7(){var i=0;return this.visit(function(e){if(!e.length)do++i;while(e=e.next)}),i}function G7(i){var e=[],t,n=this._root,r,s,a,o,l;for(n&&e.push(new zi(n,this._x0,this._y0,this._x1,this._y1));t=e.pop();)if(!i(n=t.node,s=t.x0,a=t.y0,o=t.x1,l=t.y1)&&n.length){var c=(s+o)/2,h=(a+l)/2;(r=n[3])&&e.push(new zi(r,c,h,o,l)),(r=n[2])&&e.push(new zi(r,s,h,c,l)),(r=n[1])&&e.push(new zi(r,c,a,o,h)),(r=n[0])&&e.push(new zi(r,s,a,c,h))}return this}function H7(i){var e=[],t=[],n;for(this._root&&e.push(new zi(this._root,this._x0,this._y0,this._x1,this._y1));n=e.pop();){var r=n.node;if(r.length){var s,a=n.x0,o=n.y0,l=n.x1,c=n.y1,h=(a+l)/2,d=(o+c)/2;(s=r[0])&&e.push(new zi(s,a,o,h,d)),(s=r[1])&&e.push(new zi(s,h,o,l,d)),(s=r[2])&&e.push(new zi(s,a,d,h,c)),(s=r[3])&&e.push(new zi(s,h,d,l,c))}t.push(n)}for(;n=t.pop();)i(n.node,n.x0,n.y0,n.x1,n.y1);return this}function V7(i){return i[0]}function W7(i){return arguments.length?(this._x=i,this):this._x}function X7(i){return i[1]}function j7(i){return arguments.length?(this._y=i,this):this._y}function ab(i,e,t){var n=new ob(e??V7,t??X7,NaN,NaN,NaN,NaN);return i==null?n:n.addAll(i)}function ob(i,e,t,n,r,s){this._x=i,this._y=e,this._x0=t,this._y0=n,this._x1=r,this._y1=s,this._root=void 0}function qT(i){for(var e={data:i.data},t=e;i=i.next;)t=t.next={data:i.data};return e}var Gi=ab.prototype=ob.prototype;Gi.copy=function(){var i=new ob(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,t,n;if(!e)return i;if(!e.length)return i._root=qT(e),i;for(t=[{source:e,target:i._root=new Array(4)}];e=t.pop();)for(var r=0;r<4;++r)(n=e.source[r])&&(n.length?t.push({source:n,target:e.target[r]=new Array(4)}):e.target[r]=qT(n));return i};Gi.add=U7;Gi.addAll=O7;Gi.cover=L7;Gi.data=I7;Gi.extent=N7;Gi.find=P7;Gi.remove=z7;Gi.removeAll=F7;Gi.root=B7;Gi.size=k7;Gi.visit=G7;Gi.visitAfter=H7;Gi.x=W7;Gi.y=j7;function q7(i){const e=+this._x.call(null,i),t=+this._y.call(null,i),n=+this._z.call(null,i);return gD(this.cover(e,t,n),e,t,n,i)}function gD(i,e,t,n,r){if(isNaN(e)||isNaN(t)||isNaN(n))return i;var s,a=i._root,o={data:r},l=i._x0,c=i._y0,h=i._z0,d=i._x1,p=i._y1,m=i._z1,v,x,_,g,b,E,S,w,T,R,U;if(!a)return i._root=o,i;for(;a.length;)if((S=e>=(v=(l+d)/2))?l=v:d=v,(w=t>=(x=(c+p)/2))?c=x:p=x,(T=n>=(_=(h+m)/2))?h=_:m=_,s=a,!(a=a[R=T<<2|w<<1|S]))return s[R]=o,i;if(g=+i._x.call(null,a.data),b=+i._y.call(null,a.data),E=+i._z.call(null,a.data),e===g&&t===b&&n===E)return o.next=a,s?s[R]=o:i._root=o,i;do s=s?s[R]=new Array(8):i._root=new Array(8),(S=e>=(v=(l+d)/2))?l=v:d=v,(w=t>=(x=(c+p)/2))?c=x:p=x,(T=n>=(_=(h+m)/2))?h=_:m=_;while((R=T<<2|w<<1|S)===(U=(E>=_)<<2|(b>=x)<<1|g>=v));return s[U]=a,s[R]=o,i}function Y7(i){Array.isArray(i)||(i=Array.from(i));const e=i.length,t=new Float64Array(e),n=new Float64Array(e),r=new Float64Array(e);let s=1/0,a=1/0,o=1/0,l=-1/0,c=-1/0,h=-1/0;for(let d=0,p,m,v,x;d<e;++d)isNaN(m=+this._x.call(null,p=i[d]))||isNaN(v=+this._y.call(null,p))||isNaN(x=+this._z.call(null,p))||(t[d]=m,n[d]=v,r[d]=x,m<s&&(s=m),m>l&&(l=m),v<a&&(a=v),v>c&&(c=v),x<o&&(o=x),x>h&&(h=x));if(s>l||a>c||o>h)return this;this.cover(s,a,o).cover(l,c,h);for(let d=0;d<e;++d)gD(this,t[d],n[d],r[d],i[d]);return this}function Z7(i,e,t){if(isNaN(i=+i)||isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,r=this._y0,s=this._z0,a=this._x1,o=this._y1,l=this._z1;if(isNaN(n))a=(n=Math.floor(i))+1,o=(r=Math.floor(e))+1,l=(s=Math.floor(t))+1;else{for(var c=a-n||1,h=this._root,d,p;n>i||i>=a||r>e||e>=o||s>t||t>=l;)switch(p=(t<s)<<2|(e<r)<<1|i<n,d=new Array(8),d[p]=h,h=d,c*=2,p){case 0:a=n+c,o=r+c,l=s+c;break;case 1:n=a-c,o=r+c,l=s+c;break;case 2:a=n+c,r=o-c,l=s+c;break;case 3:n=a-c,r=o-c,l=s+c;break;case 4:a=n+c,o=r+c,s=l-c;break;case 5:n=a-c,o=r+c,s=l-c;break;case 6:a=n+c,r=o-c,s=l-c;break;case 7:n=a-c,r=o-c,s=l-c;break}this._root&&this._root.length&&(this._root=h)}return this._x0=n,this._y0=r,this._z0=s,this._x1=a,this._y1=o,this._z1=l,this}function K7(){var i=[];return this.visit(function(e){if(!e.length)do i.push(e.data);while(e=e.next)}),i}function J7(i){return arguments.length?this.cover(+i[0][0],+i[0][1],+i[0][2]).cover(+i[1][0],+i[1][1],+i[1][2]):isNaN(this._x0)?void 0:[[this._x0,this._y0,this._z0],[this._x1,this._y1,this._z1]]}function hn(i,e,t,n,r,s,a){this.node=i,this.x0=e,this.y0=t,this.z0=n,this.x1=r,this.y1=s,this.z1=a}function Q7(i,e,t,n){var r,s=this._x0,a=this._y0,o=this._z0,l,c,h,d,p,m,v=this._x1,x=this._y1,_=this._z1,g=[],b=this._root,E,S;for(b&&g.push(new hn(b,s,a,o,v,x,_)),n==null?n=1/0:(s=i-n,a=e-n,o=t-n,v=i+n,x=e+n,_=t+n,n*=n);E=g.pop();)if(!(!(b=E.node)||(l=E.x0)>v||(c=E.y0)>x||(h=E.z0)>_||(d=E.x1)<s||(p=E.y1)<a||(m=E.z1)<o))if(b.length){var w=(l+d)/2,T=(c+p)/2,R=(h+m)/2;g.push(new hn(b[7],w,T,R,d,p,m),new hn(b[6],l,T,R,w,p,m),new hn(b[5],w,c,R,d,T,m),new hn(b[4],l,c,R,w,T,m),new hn(b[3],w,T,h,d,p,R),new hn(b[2],l,T,h,w,p,R),new hn(b[1],w,c,h,d,T,R),new hn(b[0],l,c,h,w,T,R)),(S=(t>=R)<<2|(e>=T)<<1|i>=w)&&(E=g[g.length-1],g[g.length-1]=g[g.length-1-S],g[g.length-1-S]=E)}else{var U=i-+this._x.call(null,b.data),A=e-+this._y.call(null,b.data),D=t-+this._z.call(null,b.data),L=U*U+A*A+D*D;if(L<n){var P=Math.sqrt(n=L);s=i-P,a=e-P,o=t-P,v=i+P,x=e+P,_=t+P,r=b.data}}return r}const $7=(i,e,t,n,r,s)=>Math.sqrt((i-n)**2+(e-r)**2+(t-s)**2);function e9(i,e,t,n){const r=[],s=i-n,a=e-n,o=t-n,l=i+n,c=e+n,h=t+n;return this.visit((d,p,m,v,x,_,g)=>{if(!d.length)do{const b=d.data;$7(i,e,t,this._x(b),this._y(b),this._z(b))<=n&&r.push(b)}while(d=d.next);return p>l||m>c||v>h||x<s||_<a||g<o}),r}function t9(i){if(isNaN(p=+this._x.call(null,i))||isNaN(m=+this._y.call(null,i))||isNaN(v=+this._z.call(null,i)))return this;var e,t=this._root,n,r,s,a=this._x0,o=this._y0,l=this._z0,c=this._x1,h=this._y1,d=this._z1,p,m,v,x,_,g,b,E,S,w,T;if(!t)return this;if(t.length)for(;;){if((b=p>=(x=(a+c)/2))?a=x:c=x,(E=m>=(_=(o+h)/2))?o=_:h=_,(S=v>=(g=(l+d)/2))?l=g:d=g,e=t,!(t=t[w=S<<2|E<<1|b]))return this;if(!t.length)break;(e[w+1&7]||e[w+2&7]||e[w+3&7]||e[w+4&7]||e[w+5&7]||e[w+6&7]||e[w+7&7])&&(n=e,T=w)}for(;t.data!==i;)if(r=t,!(t=t.next))return this;return(s=t.next)&&delete t.next,r?(s?r.next=s:delete r.next,this):e?(s?e[w]=s:delete e[w],(t=e[0]||e[1]||e[2]||e[3]||e[4]||e[5]||e[6]||e[7])&&t===(e[7]||e[6]||e[5]||e[4]||e[3]||e[2]||e[1]||e[0])&&!t.length&&(n?n[T]=t:this._root=t),this):(this._root=s,this)}function n9(i){for(var e=0,t=i.length;e<t;++e)this.remove(i[e]);return this}function i9(){return this._root}function r9(){var i=0;return this.visit(function(e){if(!e.length)do++i;while(e=e.next)}),i}function s9(i){var e=[],t,n=this._root,r,s,a,o,l,c,h;for(n&&e.push(new hn(n,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));t=e.pop();)if(!i(n=t.node,s=t.x0,a=t.y0,o=t.z0,l=t.x1,c=t.y1,h=t.z1)&&n.length){var d=(s+l)/2,p=(a+c)/2,m=(o+h)/2;(r=n[7])&&e.push(new hn(r,d,p,m,l,c,h)),(r=n[6])&&e.push(new hn(r,s,p,m,d,c,h)),(r=n[5])&&e.push(new hn(r,d,a,m,l,p,h)),(r=n[4])&&e.push(new hn(r,s,a,m,d,p,h)),(r=n[3])&&e.push(new hn(r,d,p,o,l,c,m)),(r=n[2])&&e.push(new hn(r,s,p,o,d,c,m)),(r=n[1])&&e.push(new hn(r,d,a,o,l,p,m)),(r=n[0])&&e.push(new hn(r,s,a,o,d,p,m))}return this}function a9(i){var e=[],t=[],n;for(this._root&&e.push(new hn(this._root,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));n=e.pop();){var r=n.node;if(r.length){var s,a=n.x0,o=n.y0,l=n.z0,c=n.x1,h=n.y1,d=n.z1,p=(a+c)/2,m=(o+h)/2,v=(l+d)/2;(s=r[0])&&e.push(new hn(s,a,o,l,p,m,v)),(s=r[1])&&e.push(new hn(s,p,o,l,c,m,v)),(s=r[2])&&e.push(new hn(s,a,m,l,p,h,v)),(s=r[3])&&e.push(new hn(s,p,m,l,c,h,v)),(s=r[4])&&e.push(new hn(s,a,o,v,p,m,d)),(s=r[5])&&e.push(new hn(s,p,o,v,c,m,d)),(s=r[6])&&e.push(new hn(s,a,m,v,p,h,d)),(s=r[7])&&e.push(new hn(s,p,m,v,c,h,d))}t.push(n)}for(;n=t.pop();)i(n.node,n.x0,n.y0,n.z0,n.x1,n.y1,n.z1);return this}function o9(i){return i[0]}function l9(i){return arguments.length?(this._x=i,this):this._x}function c9(i){return i[1]}function u9(i){return arguments.length?(this._y=i,this):this._y}function h9(i){return i[2]}function f9(i){return arguments.length?(this._z=i,this):this._z}function lb(i,e,t,n){var r=new cb(e??o9,t??c9,n??h9,NaN,NaN,NaN,NaN,NaN,NaN);return i==null?r:r.addAll(i)}function cb(i,e,t,n,r,s,a,o,l){this._x=i,this._y=e,this._z=t,this._x0=n,this._y0=r,this._z0=s,this._x1=a,this._y1=o,this._z1=l,this._root=void 0}function YT(i){for(var e={data:i.data},t=e;i=i.next;)t=t.next={data:i.data};return e}var _i=lb.prototype=cb.prototype;_i.copy=function(){var i=new cb(this._x,this._y,this._z,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1),e=this._root,t,n;if(!e)return i;if(!e.length)return i._root=YT(e),i;for(t=[{source:e,target:i._root=new Array(8)}];e=t.pop();)for(var r=0;r<8;++r)(n=e.source[r])&&(n.length?t.push({source:n,target:e.target[r]=new Array(8)}):e.target[r]=YT(n));return i};_i.add=q7;_i.addAll=Y7;_i.cover=Z7;_i.data=K7;_i.extent=J7;_i.find=Q7;_i.findAllWithinRadius=e9;_i.remove=t9;_i.removeAll=n9;_i.root=i9;_i.size=r9;_i.visit=s9;_i.visitAfter=a9;_i.x=l9;_i.y=u9;_i.z=f9;function Rn(i){return function(){return i}}function Pr(i){return(i()-.5)*1e-6}function D_(i){return i.x+i.vx}function ZT(i){return i.y+i.vy}function d9(i){return i.z+i.vz}function vD(i){var e,t,n,r,s=1,a=1;typeof i!="function"&&(i=Rn(i==null?1:+i));function o(){for(var h,d=e.length,p,m,v,x,_,g,b,E=0;E<a;++E)for(p=(t===1?rb(e,D_):t===2?ab(e,D_,ZT):t===3?lb(e,D_,ZT,d9):null).visitAfter(l),h=0;h<d;++h)m=e[h],g=n[m.index],b=g*g,v=m.x+m.vx,t>1&&(x=m.y+m.vy),t>2&&(_=m.z+m.vz),p.visit(S);function S(w,T,R,U,A,D,L){var P=[T,R,U,A,D,L],I=P[0],V=P[1],H=P[2],z=P[t],O=P[t+1],B=P[t+2],G=w.data,X=w.r,k=g+X;if(G){if(G.index>m.index){var Y=v-G.x-G.vx,Q=t>1?x-G.y-G.vy:0,te=t>2?_-G.z-G.vz:0,ee=Y*Y+Q*Q+te*te;ee<k*k&&(Y===0&&(Y=Pr(r),ee+=Y*Y),t>1&&Q===0&&(Q=Pr(r),ee+=Q*Q),t>2&&te===0&&(te=Pr(r),ee+=te*te),ee=(k-(ee=Math.sqrt(ee)))/ee*s,m.vx+=(Y*=ee)*(k=(X*=X)/(b+X)),t>1&&(m.vy+=(Q*=ee)*k),t>2&&(m.vz+=(te*=ee)*k),G.vx-=Y*(k=1-k),t>1&&(G.vy-=Q*k),t>2&&(G.vz-=te*k))}return}return I>v+k||z<v-k||t>1&&(V>x+k||O<x-k)||t>2&&(H>_+k||B<_-k)}}function l(h){if(h.data)return h.r=n[h.data.index];for(var d=h.r=0;d<Math.pow(2,t);++d)h[d]&&h[d].r>h.r&&(h.r=h[d].r)}function c(){if(e){var h,d=e.length,p;for(n=new Array(d),h=0;h<d;++h)p=e[h],n[p.index]=+i(p,h,e)}}return o.initialize=function(h,...d){e=h,r=d.find(p=>typeof p=="function")||Math.random,t=d.find(p=>[1,2,3].includes(p))||2,c()},o.iterations=function(h){return arguments.length?(a=+h,o):a},o.strength=function(h){return arguments.length?(s=+h,o):s},o.radius=function(h){return arguments.length?(i=typeof h=="function"?h:Rn(+h),c(),o):i},o}function p9(i){return i.index}function KT(i,e){var t=i.get(e);if(!t)throw new Error("node not found: "+e);return t}function yD(i){var e=p9,t=p,n,r=Rn(30),s,a,o,l,c,h,d=1;i==null&&(i=[]);function p(g){return 1/Math.min(l[g.source.index],l[g.target.index])}function m(g){for(var b=0,E=i.length;b<d;++b)for(var S=0,w,T,R,U=0,A=0,D=0,L,P;S<E;++S)w=i[S],T=w.source,R=w.target,U=R.x+R.vx-T.x-T.vx||Pr(h),o>1&&(A=R.y+R.vy-T.y-T.vy||Pr(h)),o>2&&(D=R.z+R.vz-T.z-T.vz||Pr(h)),L=Math.sqrt(U*U+A*A+D*D),L=(L-s[S])/L*g*n[S],U*=L,A*=L,D*=L,R.vx-=U*(P=c[S]),o>1&&(R.vy-=A*P),o>2&&(R.vz-=D*P),T.vx+=U*(P=1-P),o>1&&(T.vy+=A*P),o>2&&(T.vz+=D*P)}function v(){if(a){var g,b=a.length,E=i.length,S=new Map(a.map((T,R)=>[e(T,R,a),T])),w;for(g=0,l=new Array(b);g<E;++g)w=i[g],w.index=g,typeof w.source!="object"&&(w.source=KT(S,w.source)),typeof w.target!="object"&&(w.target=KT(S,w.target)),l[w.source.index]=(l[w.source.index]||0)+1,l[w.target.index]=(l[w.target.index]||0)+1;for(g=0,c=new Array(E);g<E;++g)w=i[g],c[g]=l[w.source.index]/(l[w.source.index]+l[w.target.index]);n=new Array(E),x(),s=new Array(E),_()}}function x(){if(a)for(var g=0,b=i.length;g<b;++g)n[g]=+t(i[g],g,i)}function _(){if(a)for(var g=0,b=i.length;g<b;++g)s[g]=+r(i[g],g,i)}return m.initialize=function(g,...b){a=g,h=b.find(E=>typeof E=="function")||Math.random,o=b.find(E=>[1,2,3].includes(E))||2,v()},m.links=function(g){return arguments.length?(i=g,v(),m):i},m.id=function(g){return arguments.length?(e=g,m):e},m.iterations=function(g){return arguments.length?(d=+g,m):d},m.strength=function(g){return arguments.length?(t=typeof g=="function"?g:Rn(+g),x(),m):t},m.distance=function(g){return arguments.length?(r=typeof g=="function"?g:Rn(+g),_(),m):r},m}var m9={value:()=>{}};function _D(){for(var i=0,e=arguments.length,t={},n;i<e;++i){if(!(n=arguments[i]+"")||n in t||/[\s.]/.test(n))throw new Error("illegal type: "+n);t[n]=[]}return new pm(t)}function pm(i){this._=i}function g9(i,e){return i.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}})}pm.prototype=_D.prototype={constructor:pm,on:function(i,e){var t=this._,n=g9(i+"",t),r,s=-1,a=n.length;if(arguments.length<2){for(;++s<a;)if((r=(i=n[s]).type)&&(r=v9(t[r],i.name)))return r;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++s<a;)if(r=(i=n[s]).type)t[r]=JT(t[r],i.name,e);else if(e==null)for(r in t)t[r]=JT(t[r],i.name,null);return this},copy:function(){var i={},e=this._;for(var t in e)i[t]=e[t].slice();return new pm(i)},call:function(i,e){if((r=arguments.length-2)>0)for(var t=new Array(r),n=0,r,s;n<r;++n)t[n]=arguments[n+2];if(!this._.hasOwnProperty(i))throw new Error("unknown type: "+i);for(s=this._[i],n=0,r=s.length;n<r;++n)s[n].value.apply(e,t)},apply:function(i,e,t){if(!this._.hasOwnProperty(i))throw new Error("unknown type: "+i);for(var n=this._[i],r=0,s=n.length;r<s;++r)n[r].value.apply(e,t)}};function v9(i,e){for(var t=0,n=i.length,r;t<n;++t)if((r=i[t]).name===e)return r.value}function JT(i,e,t){for(var n=0,r=i.length;n<r;++n)if(i[n].name===e){i[n]=m9,i=i.slice(0,n).concat(i.slice(n+1));break}return t!=null&&i.push({name:e,value:t}),i}var bu=0,ef=0,Xh=0,xD=1e3,Eg,tf,Mg=0,Ol=0,E0=0,jf=typeof performance=="object"&&performance.now?performance:Date,bD=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(i){setTimeout(i,17)};function SD(){return Ol||(bD(y9),Ol=jf.now()+E0)}function y9(){Ol=0}function Ox(){this._call=this._time=this._next=null}Ox.prototype=ED.prototype={constructor:Ox,restart:function(i,e,t){if(typeof i!="function")throw new TypeError("callback is not a function");t=(t==null?SD():+t)+(e==null?0:+e),!this._next&&tf!==this&&(tf?tf._next=this:Eg=this,tf=this),this._call=i,this._time=t,Lx()},stop:function(){this._call&&(this._call=null,this._time=1/0,Lx())}};function ED(i,e,t){var n=new Ox;return n.restart(i,e,t),n}function _9(){SD(),++bu;for(var i=Eg,e;i;)(e=Ol-i._time)>=0&&i._call.call(void 0,e),i=i._next;--bu}function QT(){Ol=(Mg=jf.now())+E0,bu=ef=0;try{_9()}finally{bu=0,b9(),Ol=0}}function x9(){var i=jf.now(),e=i-Mg;e>xD&&(E0-=e,Mg=i)}function b9(){for(var i,e=Eg,t,n=1/0;e;)e._call?(n>e._time&&(n=e._time),i=e,e=e._next):(t=e._next,e._next=null,e=i?i._next=t:Eg=t);tf=i,Lx(n)}function Lx(i){if(!bu){ef&&(ef=clearTimeout(ef));var e=i-Ol;e>24?(i<1/0&&(ef=setTimeout(QT,i-jf.now()-E0)),Xh&&(Xh=clearInterval(Xh))):(Xh||(Mg=jf.now(),Xh=setInterval(x9,xD)),bu=1,bD(QT))}}const S9=1664525,E9=1013904223,$T=4294967296;function M9(){let i=1;return()=>(i=(S9*i+E9)%$T)/$T}var eA=3;function U_(i){return i.x}function tA(i){return i.y}function w9(i){return i.z}var T9=10,A9=Math.PI*(3-Math.sqrt(5)),C9=Math.PI*20/(9+Math.sqrt(221));function MD(i,e){e=e||2;var t=Math.min(eA,Math.max(1,Math.round(e))),n,r=1,s=.001,a=1-Math.pow(s,1/300),o=0,l=.6,c=new Map,h=ED(m),d=_D("tick","end"),p=M9();i==null&&(i=[]);function m(){v(),d.call("tick",n),r<s&&(h.stop(),d.call("end",n))}function v(g){var b,E=i.length,S;g===void 0&&(g=1);for(var w=0;w<g;++w)for(r+=(o-r)*a,c.forEach(function(T){T(r)}),b=0;b<E;++b)S=i[b],S.fx==null?S.x+=S.vx*=l:(S.x=S.fx,S.vx=0),t>1&&(S.fy==null?S.y+=S.vy*=l:(S.y=S.fy,S.vy=0)),t>2&&(S.fz==null?S.z+=S.vz*=l:(S.z=S.fz,S.vz=0));return n}function x(){for(var g=0,b=i.length,E;g<b;++g){if(E=i[g],E.index=g,E.fx!=null&&(E.x=E.fx),E.fy!=null&&(E.y=E.fy),E.fz!=null&&(E.z=E.fz),isNaN(E.x)||t>1&&isNaN(E.y)||t>2&&isNaN(E.z)){var S=T9*(t>2?Math.cbrt(.5+g):t>1?Math.sqrt(.5+g):g),w=g*A9,T=g*C9;t===1?E.x=S:t===2?(E.x=S*Math.cos(w),E.y=S*Math.sin(w)):(E.x=S*Math.sin(w)*Math.cos(T),E.y=S*Math.cos(w),E.z=S*Math.sin(w)*Math.sin(T))}(isNaN(E.vx)||t>1&&isNaN(E.vy)||t>2&&isNaN(E.vz))&&(E.vx=0,t>1&&(E.vy=0),t>2&&(E.vz=0))}}function _(g){return g.initialize&&g.initialize(i,p,t),g}return x(),n={tick:v,restart:function(){return h.restart(m),n},stop:function(){return h.stop(),n},numDimensions:function(g){return arguments.length?(t=Math.min(eA,Math.max(1,Math.round(g))),c.forEach(_),n):t},nodes:function(g){return arguments.length?(i=g,x(),c.forEach(_),n):i},alpha:function(g){return arguments.length?(r=+g,n):r},alphaMin:function(g){return arguments.length?(s=+g,n):s},alphaDecay:function(g){return arguments.length?(a=+g,n):+a},alphaTarget:function(g){return arguments.length?(o=+g,n):o},velocityDecay:function(g){return arguments.length?(l=1-g,n):1-l},randomSource:function(g){return arguments.length?(p=g,c.forEach(_),n):p},force:function(g,b){return arguments.length>1?(b==null?c.delete(g):c.set(g,_(b)),n):c.get(g)},find:function(){var g=Array.prototype.slice.call(arguments),b=g.shift()||0,E=(t>1?g.shift():null)||0,S=(t>2?g.shift():null)||0,w=g.shift()||1/0,T=0,R=i.length,U,A,D,L,P,I;for(w*=w,T=0;T<R;++T)P=i[T],U=b-P.x,A=E-(P.y||0),D=S-(P.z||0),L=U*U+A*A+D*D,L<w&&(I=P,w=L);return I},on:function(g,b){return arguments.length>1?(d.on(g,b),n):d.on(g)}}}function wD(){var i,e,t,n,r,s=Rn(-30),a,o=1,l=1/0,c=.81;function h(v){var x,_=i.length,g=(e===1?rb(i,U_):e===2?ab(i,U_,tA):e===3?lb(i,U_,tA,w9):null).visitAfter(p);for(r=v,x=0;x<_;++x)t=i[x],g.visit(m)}function d(){if(i){var v,x=i.length,_;for(a=new Array(x),v=0;v<x;++v)_=i[v],a[_.index]=+s(_,v,i)}}function p(v){var x=0,_,g,b=0,E,S,w,T,R=v.length;if(R){for(E=S=w=T=0;T<R;++T)(_=v[T])&&(g=Math.abs(_.value))&&(x+=_.value,b+=g,E+=g*(_.x||0),S+=g*(_.y||0),w+=g*(_.z||0));x*=Math.sqrt(4/R),v.x=E/b,e>1&&(v.y=S/b),e>2&&(v.z=w/b)}else{_=v,_.x=_.data.x,e>1&&(_.y=_.data.y),e>2&&(_.z=_.data.z);do x+=a[_.data.index];while(_=_.next)}v.value=x}function m(v,x,_,g,b){if(!v.value)return!0;var E=[_,g,b][e-1],S=v.x-t.x,w=e>1?v.y-t.y:0,T=e>2?v.z-t.z:0,R=E-x,U=S*S+w*w+T*T;if(R*R/c<U)return U<l&&(S===0&&(S=Pr(n),U+=S*S),e>1&&w===0&&(w=Pr(n),U+=w*w),e>2&&T===0&&(T=Pr(n),U+=T*T),U<o&&(U=Math.sqrt(o*U)),t.vx+=S*v.value*r/U,e>1&&(t.vy+=w*v.value*r/U),e>2&&(t.vz+=T*v.value*r/U)),!0;if(v.length||U>=l)return;(v.data!==t||v.next)&&(S===0&&(S=Pr(n),U+=S*S),e>1&&w===0&&(w=Pr(n),U+=w*w),e>2&&T===0&&(T=Pr(n),U+=T*T),U<o&&(U=Math.sqrt(o*U)));do v.data!==t&&(R=a[v.data.index]*r/U,t.vx+=S*R,e>1&&(t.vy+=w*R),e>2&&(t.vz+=T*R));while(v=v.next)}return h.initialize=function(v,...x){i=v,n=x.find(_=>typeof _=="function")||Math.random,e=x.find(_=>[1,2,3].includes(_))||2,d()},h.strength=function(v){return arguments.length?(s=typeof v=="function"?v:Rn(+v),d(),h):s},h.distanceMin=function(v){return arguments.length?(o=v*v,h):Math.sqrt(o)},h.distanceMax=function(v){return arguments.length?(l=v*v,h):Math.sqrt(l)},h.theta=function(v){return arguments.length?(c=v*v,h):Math.sqrt(c)},h}function R9(i,e,t,n){var r,s,a=Rn(.1),o,l;typeof i!="function"&&(i=Rn(+i)),e==null&&(e=0),t==null&&(t=0),n==null&&(n=0);function c(d){for(var p=0,m=r.length;p<m;++p){var v=r[p],x=v.x-e||1e-6,_=(v.y||0)-t||1e-6,g=(v.z||0)-n||1e-6,b=Math.sqrt(x*x+_*_+g*g),E=(l[p]-b)*o[p]*d/b;v.vx+=x*E,s>1&&(v.vy+=_*E),s>2&&(v.vz+=g*E)}}function h(){if(r){var d,p=r.length;for(o=new Array(p),l=new Array(p),d=0;d<p;++d)l[d]=+i(r[d],d,r),o[d]=isNaN(l[d])?0:+a(r[d],d,r)}}return c.initialize=function(d,...p){r=d,s=p.find(m=>[1,2,3].includes(m))||2,h()},c.strength=function(d){return arguments.length?(a=typeof d=="function"?d:Rn(+d),h(),c):a},c.radius=function(d){return arguments.length?(i=typeof d=="function"?d:Rn(+d),h(),c):i},c.x=function(d){return arguments.length?(e=+d,c):e},c.y=function(d){return arguments.length?(t=+d,c):t},c.z=function(d){return arguments.length?(n=+d,c):n},c}function Ix(i){var e=Rn(.1),t,n,r;typeof i!="function"&&(i=Rn(i==null?0:+i));function s(o){for(var l=0,c=t.length,h;l<c;++l)h=t[l],h.vx+=(r[l]-h.x)*n[l]*o}function a(){if(t){var o,l=t.length;for(n=new Array(l),r=new Array(l),o=0;o<l;++o)n[o]=isNaN(r[o]=+i(t[o],o,t))?0:+e(t[o],o,t)}}return s.initialize=function(o){t=o,a()},s.strength=function(o){return arguments.length?(e=typeof o=="function"?o:Rn(+o),a(),s):e},s.x=function(o){return arguments.length?(i=typeof o=="function"?o:Rn(+o),a(),s):i},s}function Nx(i){var e=Rn(.1),t,n,r;typeof i!="function"&&(i=Rn(i==null?0:+i));function s(o){for(var l=0,c=t.length,h;l<c;++l)h=t[l],h.vy+=(r[l]-h.y)*n[l]*o}function a(){if(t){var o,l=t.length;for(n=new Array(l),r=new Array(l),o=0;o<l;++o)n[o]=isNaN(r[o]=+i(t[o],o,t))?0:+e(t[o],o,t)}}return s.initialize=function(o){t=o,a()},s.strength=function(o){return arguments.length?(e=typeof o=="function"?o:Rn(+o),a(),s):e},s.y=function(o){return arguments.length?(i=typeof o=="function"?o:Rn(+o),a(),s):i},s}function D9(i){var e=Rn(.1),t,n,r;typeof i!="function"&&(i=Rn(i==null?0:+i));function s(o){for(var l=0,c=t.length,h;l<c;++l)h=t[l],h.vz+=(r[l]-h.z)*n[l]*o}function a(){if(t){var o,l=t.length;for(n=new Array(l),r=new Array(l),o=0;o<l;++o)n[o]=isNaN(r[o]=+i(t[o],o,t))?0:+e(t[o],o,t)}}return s.initialize=function(o){t=o,a()},s.strength=function(o){return arguments.length?(e=typeof o=="function"?o:Rn(+o),a(),s):e},s.z=function(o){return arguments.length?(i=typeof o=="function"?o:Rn(+o),a(),s):i},s}function U9(i){var e=0,t=i.children,n=t&&t.length;if(!n)e=1;else for(;--n>=0;)e+=t[n].value;i.value=e}function O9(){return this.eachAfter(U9)}function L9(i,e){let t=-1;for(const n of this)i.call(e,n,++t,this);return this}function I9(i,e){for(var t=this,n=[t],r,s,a=-1;t=n.pop();)if(i.call(e,t,++a,this),r=t.children)for(s=r.length-1;s>=0;--s)n.push(r[s]);return this}function N9(i,e){for(var t=this,n=[t],r=[],s,a,o,l=-1;t=n.pop();)if(r.push(t),s=t.children)for(a=0,o=s.length;a<o;++a)n.push(s[a]);for(;t=r.pop();)i.call(e,t,++l,this);return this}function P9(i,e){let t=-1;for(const n of this)if(i.call(e,n,++t,this))return n}function z9(i){return this.eachAfter(function(e){for(var t=+i(e.data)||0,n=e.children,r=n&&n.length;--r>=0;)t+=n[r].value;e.value=t})}function F9(i){return this.eachBefore(function(e){e.children&&e.children.sort(i)})}function B9(i){for(var e=this,t=k9(e,i),n=[e];e!==t;)e=e.parent,n.push(e);for(var r=n.length;i!==t;)n.splice(r,0,i),i=i.parent;return n}function k9(i,e){if(i===e)return i;var t=i.ancestors(),n=e.ancestors(),r=null;for(i=t.pop(),e=n.pop();i===e;)r=i,i=t.pop(),e=n.pop();return r}function G9(){for(var i=this,e=[i];i=i.parent;)e.push(i);return e}function H9(){return Array.from(this)}function V9(){var i=[];return this.eachBefore(function(e){e.children||i.push(e)}),i}function W9(){var i=this,e=[];return i.each(function(t){t!==i&&e.push({source:t.parent,target:t})}),e}function*X9(){var i=this,e,t=[i],n,r,s;do for(e=t.reverse(),t=[];i=e.pop();)if(yield i,n=i.children)for(r=0,s=n.length;r<s;++r)t.push(n[r]);while(t.length)}function M0(i,e){i instanceof Map?(i=[void 0,i],e===void 0&&(e=Y9)):e===void 0&&(e=q9);for(var t=new Su(i),n,r=[t],s,a,o,l;n=r.pop();)if((a=e(n.data))&&(l=(a=Array.from(a)).length))for(n.children=a,o=l-1;o>=0;--o)r.push(s=a[o]=new Su(a[o])),s.parent=n,s.depth=n.depth+1;return t.eachBefore(TD)}function j9(){return M0(this).eachBefore(Z9)}function q9(i){return i.children}function Y9(i){return Array.isArray(i)?i[1]:null}function Z9(i){i.data.value!==void 0&&(i.value=i.data.value),i.data=i.data.data}function TD(i){var e=0;do i.height=e;while((i=i.parent)&&i.height<++e)}function Su(i){this.data=i,this.depth=this.height=0,this.parent=null}Su.prototype=M0.prototype={constructor:Su,count:O9,each:L9,eachAfter:N9,eachBefore:I9,find:P9,sum:z9,sort:F9,path:B9,ancestors:G9,descendants:H9,leaves:V9,links:W9,copy:j9,[Symbol.iterator]:X9};function O_(i){return i==null?null:AD(i)}function AD(i){if(typeof i!="function")throw new Error;return i}function jh(){return 0}function qh(i){return function(){return i}}function K9(i){i.x0=Math.round(i.x0),i.y0=Math.round(i.y0),i.x1=Math.round(i.x1),i.y1=Math.round(i.y1)}function J9(i,e,t,n,r){for(var s=i.children,a,o=-1,l=s.length,c=i.value&&(n-e)/i.value;++o<l;)a=s[o],a.y0=t,a.y1=r,a.x0=e,a.x1=e+=a.value*c}var Q9={depth:-1},nA={},L_={};function $9(i){return i.id}function eW(i){return i.parentId}function tW(){var i=$9,e=eW,t;function n(r){var s=Array.from(r),a=i,o=e,l,c,h,d,p,m,v,x,_=new Map;if(t!=null){const g=s.map((S,w)=>nW(t(S,w,r))),b=g.map(iA),E=new Set(g).add("");for(const S of b)E.has(S)||(E.add(S),g.push(S),b.push(iA(S)),s.push(L_));a=(S,w)=>g[w],o=(S,w)=>b[w]}for(h=0,l=s.length;h<l;++h)c=s[h],m=s[h]=new Su(c),(v=a(c,h,r))!=null&&(v+="")&&(x=m.id=v,_.set(x,_.has(x)?nA:m)),(v=o(c,h,r))!=null&&(v+="")&&(m.parent=v);for(h=0;h<l;++h)if(m=s[h],v=m.parent){if(p=_.get(v),!p)throw new Error("missing: "+v);if(p===nA)throw new Error("ambiguous: "+v);p.children?p.children.push(m):p.children=[m],m.parent=p}else{if(d)throw new Error("multiple roots");d=m}if(!d)throw new Error("no root");if(t!=null){for(;d.data===L_&&d.children.length===1;)d=d.children[0],--l;for(let g=s.length-1;g>=0&&(m=s[g],m.data===L_);--g)m.data=null}if(d.parent=Q9,d.eachBefore(function(g){g.depth=g.parent.depth+1,--l}).eachBefore(TD),d.parent=null,l>0)throw new Error("cycle");return d}return n.id=function(r){return arguments.length?(i=O_(r),n):i},n.parentId=function(r){return arguments.length?(e=O_(r),n):e},n.path=function(r){return arguments.length?(t=O_(r),n):t},n}function nW(i){i=`${i}`;let e=i.length;return Px(i,e-1)&&!Px(i,e-2)&&(i=i.slice(0,-1)),i[0]==="/"?i:`/${i}`}function iA(i){let e=i.length;if(e<2)return"";for(;--e>1&&!Px(i,e););return i.slice(0,e)}function Px(i,e){if(i[e]==="/"){let t=0;for(;e>0&&i[--e]==="\\";)++t;if((t&1)===0)return!0}return!1}function iW(i,e){return i.parent===e.parent?1:2}function I_(i){var e=i.children;return e?e[0]:i.t}function N_(i){var e=i.children;return e?e[e.length-1]:i.t}function rW(i,e,t){var n=t/(e.i-i.i);e.c-=n,e.s+=t,i.c+=n,e.z+=t,e.m+=t}function sW(i){for(var e=0,t=0,n=i.children,r=n.length,s;--r>=0;)s=n[r],s.z+=e,s.m+=e,e+=s.s+(t+=s.c)}function aW(i,e,t){return i.a.parent===e.parent?i.a:t}function mm(i,e){this._=i,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}mm.prototype=Object.create(Su.prototype);function oW(i){for(var e=new mm(i,0),t,n=[e],r,s,a,o;t=n.pop();)if(s=t._.children)for(t.children=new Array(o=s.length),a=o-1;a>=0;--a)n.push(r=t.children[a]=new mm(s[a],a)),r.parent=t;return(e.parent=new mm(null,0)).children=[e],e}function lW(){var i=iW,e=1,t=1,n=null;function r(c){var h=oW(c);if(h.eachAfter(s),h.parent.m=-h.z,h.eachBefore(a),n)c.eachBefore(l);else{var d=c,p=c,m=c;c.eachBefore(function(b){b.x<d.x&&(d=b),b.x>p.x&&(p=b),b.depth>m.depth&&(m=b)});var v=d===p?1:i(d,p)/2,x=v-d.x,_=e/(p.x+v+x),g=t/(m.depth||1);c.eachBefore(function(b){b.x=(b.x+x)*_,b.y=b.depth*g})}return c}function s(c){var h=c.children,d=c.parent.children,p=c.i?d[c.i-1]:null;if(h){sW(c);var m=(h[0].z+h[h.length-1].z)/2;p?(c.z=p.z+i(c._,p._),c.m=c.z-m):c.z=m}else p&&(c.z=p.z+i(c._,p._));c.parent.A=o(c,p,c.parent.A||d[0])}function a(c){c._.x=c.z+c.parent.m,c.m+=c.parent.m}function o(c,h,d){if(h){for(var p=c,m=c,v=h,x=p.parent.children[0],_=p.m,g=m.m,b=v.m,E=x.m,S;v=N_(v),p=I_(p),v&&p;)x=I_(x),m=N_(m),m.a=c,S=v.z+b-p.z-_+i(v._,p._),S>0&&(rW(aW(v,c,d),c,S),_+=S,g+=S),b+=v.m,_+=p.m,E+=x.m,g+=m.m;v&&!N_(m)&&(m.t=v,m.m+=b-g),p&&!I_(x)&&(x.t=p,x.m+=_-E,d=c)}return d}function l(c){c.x*=e,c.y=c.depth*t}return r.separation=function(c){return arguments.length?(i=c,r):i},r.size=function(c){return arguments.length?(n=!1,e=+c[0],t=+c[1],r):n?null:[e,t]},r.nodeSize=function(c){return arguments.length?(n=!0,e=+c[0],t=+c[1],r):n?[e,t]:null},r}function cW(i,e,t,n,r){for(var s=i.children,a,o=-1,l=s.length,c=i.value&&(r-t)/i.value;++o<l;)a=s[o],a.x0=e,a.x1=n,a.y0=t,a.y1=t+=a.value*c}var uW=(1+Math.sqrt(5))/2;function hW(i,e,t,n,r,s){for(var a=[],o=e.children,l,c,h=0,d=0,p=o.length,m,v,x=e.value,_,g,b,E,S,w,T;h<p;){m=r-t,v=s-n;do _=o[d++].value;while(!_&&d<p);for(g=b=_,w=Math.max(v/m,m/v)/(x*i),T=_*_*w,S=Math.max(b/T,T/g);d<p;++d){if(_+=c=o[d].value,c<g&&(g=c),c>b&&(b=c),T=_*_*w,E=Math.max(b/T,T/g),E>S){_-=c;break}S=E}a.push(l={value:_,dice:m<v,children:o.slice(h,d)}),l.dice?J9(l,t,n,r,x?n+=v*_/x:s):cW(l,t,n,x?t+=m*_/x:r,s),x-=_,h=d}return a}const fW=(function i(e){function t(n,r,s,a,o){hW(e,n,r,s,a,o)}return t.ratio=function(n){return i((n=+n)>1?n:1)},t})(uW);function dW(){var i=fW,e=!1,t=1,n=1,r=[0],s=jh,a=jh,o=jh,l=jh,c=jh;function h(p){return p.x0=p.y0=0,p.x1=t,p.y1=n,p.eachBefore(d),r=[0],e&&p.eachBefore(K9),p}function d(p){var m=r[p.depth],v=p.x0+m,x=p.y0+m,_=p.x1-m,g=p.y1-m;_<v&&(v=_=(v+_)/2),g<x&&(x=g=(x+g)/2),p.x0=v,p.y0=x,p.x1=_,p.y1=g,p.children&&(m=r[p.depth+1]=s(p)/2,v+=c(p)-m,x+=a(p)-m,_-=o(p)-m,g-=l(p)-m,_<v&&(v=_=(v+_)/2),g<x&&(x=g=(x+g)/2),i(p,v,x,_,g))}return h.round=function(p){return arguments.length?(e=!!p,h):e},h.size=function(p){return arguments.length?(t=+p[0],n=+p[1],h):[t,n]},h.tile=function(p){return arguments.length?(i=AD(p),h):i},h.padding=function(p){return arguments.length?h.paddingInner(p).paddingOuter(p):h.paddingInner()},h.paddingInner=function(p){return arguments.length?(s=typeof p=="function"?p:qh(+p),h):s},h.paddingOuter=function(p){return arguments.length?h.paddingTop(p).paddingRight(p).paddingBottom(p).paddingLeft(p):h.paddingTop()},h.paddingTop=function(p){return arguments.length?(a=typeof p=="function"?p:qh(+p),h):a},h.paddingRight=function(p){return arguments.length?(o=typeof p=="function"?p:qh(+p),h):o},h.paddingBottom=function(p){return arguments.length?(l=typeof p=="function"?p:qh(+p),h):l},h.paddingLeft=function(p){return arguments.length?(c=typeof p=="function"?p:qh(+p),h):c},h}var P_,rA;function pW(){if(rA)return P_;rA=1;var i=0,e=1,t=2,n=3;function r(a,o){return a+"§"+o}function s(){return .01*(.5-Math.random())}return P_=function(o,l){var c=o.margin,h=o.ratio,d=o.expansion,p=o.gridSize,m=o.speed,v,x,_,g,b,E,S=!0,w=l.length,T=w/n|0,R=new Float32Array(T),U=new Float32Array(T),A=1/0,D=1/0,L=-1/0,P=-1/0;for(v=0;v<w;v+=n)_=l[v+i],g=l[v+e],E=l[v+t]*h+c,A=Math.min(A,_-E),L=Math.max(L,_+E),D=Math.min(D,g-E),P=Math.max(P,g+E);var I=L-A,V=P-D,H=(A+L)/2,z=(D+P)/2;A=H-d*I/2,L=H+d*I/2,D=z-d*V/2,P=z+d*V/2;var O=new Array(p*p),B=O.length,G;for(G=0;G<B;G++)O[G]=[];var X,k,Y,Q,te,ee,ie,re,de,Ae;for(v=0;v<w;v+=n)for(_=l[v+i],g=l[v+e],E=l[v+t]*h+c,X=_-E,k=_+E,Y=g-E,Q=g+E,te=Math.floor(p*(X-A)/(L-A)),ee=Math.floor(p*(k-A)/(L-A)),ie=Math.floor(p*(Y-D)/(P-D)),re=Math.floor(p*(Q-D)/(P-D)),de=te;de<=ee;de++)for(Ae=ie;Ae<=re;Ae++)O[de*p+Ae].push(v);var Me,ve=new Set,fe,J,oe,se,$,pe,ye,xe,be,ue,He,W,F;for(G=0;G<B;G++)for(Me=O[G],v=0,b=Me.length;v<b;v++)for(fe=Me[v],oe=l[fe+i],$=l[fe+e],ye=l[fe+t],x=v+1;x<b;x++)J=Me[x],be=r(fe,J),!(B>1&&ve.has(be))&&(B>1&&ve.add(be),se=l[J+i],pe=l[J+e],xe=l[J+t],ue=se-oe,He=pe-$,W=Math.sqrt(ue*ue+He*He),F=W<ye*h+c+(xe*h+c),F&&(S=!1,J=J/n|0,W>0?(R[J]+=ue/W*(1+ye),U[J]+=He/W*(1+ye)):(R[J]+=I*s(),U[J]+=V*s())));for(v=0,x=0;v<w;v+=n,x++)l[v+i]+=R[x]*.1*m,l[v+e]+=U[x]*.1*m;return{converged:S}},P_}var hl={},sA;function mW(){if(sA)return hl;sA=1;var i=3;return hl.validateSettings=function(e){return"gridSize"in e&&typeof e.gridSize!="number"||e.gridSize<=0?{message:"the `gridSize` setting should be a positive number."}:"margin"in e&&typeof e.margin!="number"||e.margin<0?{message:"the `margin` setting should be 0 or a positive number."}:"expansion"in e&&typeof e.expansion!="number"||e.expansion<=0?{message:"the `expansion` setting should be a positive number."}:"ratio"in e&&typeof e.ratio!="number"||e.ratio<=0?{message:"the `ratio` setting should be a positive number."}:"speed"in e&&typeof e.speed!="number"||e.speed<=0?{message:"the `speed` setting should be a positive number."}:null},hl.graphToByteArray=function(e,t){var n=e.order,r=new Float32Array(n*i),s=0;return e.forEachNode(function(a,o){typeof t=="function"&&(o=t(a,o)),r[s]=o.x,r[s+1]=o.y,r[s+2]=o.size||1,s+=i}),r},hl.assignLayoutChanges=function(e,t,n){var r=0;e.forEachNode(function(s){var a={x:t[r],y:t[r+1]};typeof n=="function"&&(a=n(s,a)),e.mergeNodeAttributes(s,a),r+=i})},hl.collectLayoutChanges=function(e,t,n){var r={},s=0;return e.forEachNode(function(a){var o={x:t[s],y:t[s+1]};typeof n=="function"&&(o=n(a,o)),r[a]=o,s+=i}),r},hl.createWorker=function(t){var n=window.URL||window.webkitURL,r=t.toString(),s=n.createObjectURL(new Blob(["("+r+").call(this);"],{type:"text/javascript"})),a=new Worker(s);return n.revokeObjectURL(s),a},hl}var z_,aA;function gW(){return aA||(aA=1,z_={gridSize:20,margin:5,expansion:1.1,ratio:1,speed:3}),z_}var F_,oA;function vW(){if(oA)return F_;oA=1;var i=Aa(),e=pW(),t=mW(),n=gW(),r=500;function s(o,l,c){if(!i(l))throw new Error("graphology-layout-noverlap: the given graph is not a valid graphology instance.");typeof c=="number"?c={maxIterations:c}:c=c||{};var h=c.maxIterations||r;if(typeof h!="number"||h<=0)throw new Error("graphology-layout-force: you should provide a positive number of maximum iterations.");var d=Object.assign({},n,c.settings),p=t.validateSettings(d);if(p)throw new Error("graphology-layout-noverlap: "+p.message);var m=t.graphToByteArray(l,c.inputReducer),v=!1,x;for(x=0;x<h&&!v;x++)v=e(d,m).converged;if(o){t.assignLayoutChanges(l,m,c.outputReducer);return}return t.collectLayoutChanges(l,m,c.outputReducer)}var a=s.bind(null,!1);return a.assign=s.bind(null,!0),F_=a,F_}var yW=vW();const _W=mo(yW);var B_={exports:{}};var lA;function xW(){return lA||(lA=1,(function(i){(function(){var e={}.hasOwnProperty;function t(){for(var s="",a=0;a<arguments.length;a++){var o=arguments[a];o&&(s=r(s,n(o)))}return s}function n(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return t.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var a="";for(var o in s)e.call(s,o)&&s[o]&&(a=r(a,o));return a}function r(s,a){return a?s?s+" "+a:s+a:s}i.exports?(t.default=t,i.exports=t):window.classNames=t})()})(B_)),B_.exports}xW();(function(){try{if(typeof document<"u"){var i=document.createElement("style");i.appendChild(document.createTextNode(`._canvas_670zp_1 {
|
|
4083
|
+
`))),{vertexShader:t,fragmentShader:n}}});return e.transparent=!0,e.forceSinglePass=!0,Object.defineProperties(e,{isTroikaTextMaterial:{value:!0},shadowSide:{get(){return this.side},set(){}}}),e}const ib=new Ma({color:16777215,side:zn,transparent:!0}),NT=8421504,PT=new bt,em=new j,E_=new j,Vh=[],Y8=new j,M_="+x+y";function zT(i){return Array.isArray(i)?i[0]:i}let uD=()=>{const i=new mn(new wa(1,1),ib);return uD=()=>i,i},hD=()=>{const i=new mn(new wa(1,1,32,1),ib);return hD=()=>i,i};const Z8={type:"syncstart"},K8={type:"synccomplete"},fD=["font","fontSize","fontStyle","fontWeight","lang","letterSpacing","lineHeight","maxWidth","overflowWrap","text","direction","textAlign","textIndent","whiteSpace","anchorX","anchorY","colorRanges","sdfGlyphSize"],J8=fD.concat("material","color","depthOffset","clipRect","curveRadius","orientation","glyphGeometryDetail");let dD=class extends mn{constructor(){const e=new H8;super(e,null),this.text="",this.anchorX=0,this.anchorY=0,this.curveRadius=0,this.direction="auto",this.font=null,this.unicodeFontsURL=null,this.fontSize=.1,this.fontWeight="normal",this.fontStyle="normal",this.lang=null,this.letterSpacing=0,this.lineHeight="normal",this.maxWidth=1/0,this.overflowWrap="normal",this.textAlign="left",this.textIndent=0,this.whiteSpace="normal",this.material=null,this.color=null,this.colorRanges=null,this.outlineWidth=0,this.outlineColor=0,this.outlineOpacity=1,this.outlineBlur=0,this.outlineOffsetX=0,this.outlineOffsetY=0,this.strokeWidth=0,this.strokeColor=NT,this.strokeOpacity=1,this.fillOpacity=1,this.depthOffset=0,this.clipRect=null,this.orientation=M_,this.glyphGeometryDetail=1,this.sdfGlyphSize=null,this.gpuAccelerateSDF=!0,this.debugSDF=!1}sync(e){this._needsSync&&(this._needsSync=!1,this._isSyncing?(this._queuedSyncs||(this._queuedSyncs=[])).push(e):(this._isSyncing=!0,this.dispatchEvent(Z8),aD({text:this.text,font:this.font,lang:this.lang,fontSize:this.fontSize||.1,fontWeight:this.fontWeight||"normal",fontStyle:this.fontStyle||"normal",letterSpacing:this.letterSpacing||0,lineHeight:this.lineHeight||"normal",maxWidth:this.maxWidth,direction:this.direction||"auto",textAlign:this.textAlign,textIndent:this.textIndent,whiteSpace:this.whiteSpace,overflowWrap:this.overflowWrap,anchorX:this.anchorX,anchorY:this.anchorY,colorRanges:this.colorRanges,includeCaretPositions:!0,sdfGlyphSize:this.sdfGlyphSize,gpuAccelerateSDF:this.gpuAccelerateSDF,unicodeFontsURL:this.unicodeFontsURL},t=>{this._isSyncing=!1,this._textRenderInfo=t,this.geometry.updateGlyphs(t.glyphBounds,t.glyphAtlasIndices,t.blockBounds,t.chunkedBounds,t.glyphColors);const n=this._queuedSyncs;n&&(this._queuedSyncs=null,this._needsSync=!0,this.sync(()=>{n.forEach(r=>r&&r())})),this.dispatchEvent(K8),e&&e()})))}onBeforeRender(e,t,n,r,s,a){this.sync(),s.isTroikaTextMaterial&&this._prepareForRender(s)}dispose(){this.geometry.dispose()}get textRenderInfo(){return this._textRenderInfo||null}createDerivedMaterial(e){return q8(e)}get material(){let e=this._derivedMaterial;const t=this._baseMaterial||this._defaultMaterial||(this._defaultMaterial=ib.clone());if((!e||!e.isDerivedFrom(t))&&(e=this._derivedMaterial=this.createDerivedMaterial(t),t.addEventListener("dispose",function n(){t.removeEventListener("dispose",n),e.dispose()})),this.hasOutline()){let n=e._outlineMtl;return n||(n=e._outlineMtl=Object.create(e,{id:{value:e.id+.1}}),n.isTextOutlineMaterial=!0,n.depthWrite=!1,n.map=null,e.addEventListener("dispose",function r(){e.removeEventListener("dispose",r),n.dispose()})),[n,e]}else return e}set material(e){e&&e.isTroikaTextMaterial?(this._derivedMaterial=e,this._baseMaterial=e.baseMaterial):this._baseMaterial=e}hasOutline(){return!!(this.outlineWidth||this.outlineBlur||this.outlineOffsetX||this.outlineOffsetY)}get glyphGeometryDetail(){return this.geometry.detail}set glyphGeometryDetail(e){this.geometry.detail=e}get curveRadius(){return this.geometry.curveRadius}set curveRadius(e){this.geometry.curveRadius=e}get customDepthMaterial(){return zT(this.material).getDepthMaterial()}set customDepthMaterial(e){}get customDistanceMaterial(){return zT(this.material).getDistanceMaterial()}set customDistanceMaterial(e){}_prepareForRender(e){const t=e.isTextOutlineMaterial,n=e.uniforms,r=this.textRenderInfo;if(r){const{sdfTexture:o,blockBounds:l}=r;n.uTroikaSDFTexture.value=o,n.uTroikaSDFTextureSize.value.set(o.image.width,o.image.height),n.uTroikaSDFGlyphSize.value=r.sdfGlyphSize,n.uTroikaSDFExponent.value=r.sdfExponent,n.uTroikaTotalBounds.value.fromArray(l),n.uTroikaUseGlyphColors.value=!t&&!!r.glyphColors;let c=0,h=0,d=0,p,m,v,x=0,_=0;if(t){let{outlineWidth:b,outlineOffsetX:E,outlineOffsetY:S,outlineBlur:w,outlineOpacity:T}=this;c=this._parsePercent(b)||0,h=Math.max(0,this._parsePercent(w)||0),p=T,x=this._parsePercent(E)||0,_=this._parsePercent(S)||0}else d=Math.max(0,this._parsePercent(this.strokeWidth)||0),d&&(v=this.strokeColor,n.uTroikaStrokeColor.value.set(v??NT),m=this.strokeOpacity,m==null&&(m=1)),p=this.fillOpacity;n.uTroikaEdgeOffset.value=c,n.uTroikaPositionOffset.value.set(x,_),n.uTroikaBlurRadius.value=h,n.uTroikaStrokeWidth.value=d,n.uTroikaStrokeOpacity.value=m,n.uTroikaFillOpacity.value=p??1,n.uTroikaCurveRadius.value=this.curveRadius||0;let g=this.clipRect;if(g&&Array.isArray(g)&&g.length===4)n.uTroikaClipRect.value.fromArray(g);else{const b=(this.fontSize||.1)*100;n.uTroikaClipRect.value.set(l[0]-b,l[1]-b,l[2]+b,l[3]+b)}this.geometry.applyClipRect(n.uTroikaClipRect.value)}n.uTroikaSDFDebug.value=!!this.debugSDF,e.polygonOffset=!!this.depthOffset,e.polygonOffsetFactor=e.polygonOffsetUnits=this.depthOffset||0;const s=t?this.outlineColor||0:this.color;if(s==null)delete e.color;else{const o=e.hasOwnProperty("color")?e.color:e.color=new Ye;(s!==o._input||typeof s=="object")&&o.set(o._input=s)}let a=this.orientation||M_;if(a!==e._orientation){let o=n.uTroikaOrient.value;a=a.replace(/[^-+xyz]/g,"");let l=a!==M_&&a.match(/^([-+])([xyz])([-+])([xyz])$/);if(l){let[,c,h,d,p]=l;em.set(0,0,0)[h]=c==="-"?1:-1,E_.set(0,0,0)[p]=d==="-"?-1:1,PT.lookAt(Y8,em.cross(E_),E_),o.setFromMatrix4(PT)}else o.identity();e._orientation=a}}_parsePercent(e){if(typeof e=="string"){let t=e.match(/^(-?[\d.]+)%$/),n=t?parseFloat(t[1]):NaN;e=(isNaN(n)?0:n/100)*this.fontSize}return e}localPositionToTextCoords(e,t=new ke){t.copy(e);const n=this.curveRadius;return n&&(t.x=Math.atan2(e.x,Math.abs(n)-Math.abs(e.z))*Math.abs(n)),t}worldPositionToTextCoords(e,t=new ke){return em.copy(e),this.localPositionToTextCoords(this.worldToLocal(em),t)}raycast(e,t){const{textRenderInfo:n,curveRadius:r}=this;if(n){const s=n.blockBounds,a=r?hD():uD(),o=a.geometry,{position:l,uv:c}=o.attributes;for(let h=0;h<c.count;h++){let d=s[0]+c.getX(h)*(s[2]-s[0]);const p=s[1]+c.getY(h)*(s[3]-s[1]);let m=0;r&&(m=r-Math.cos(d/r)*r,d=Math.sin(d/r)*r),l.setXYZ(h,d,p,m)}o.boundingSphere=this.geometry.boundingSphere,o.boundingBox=this.geometry.boundingBox,a.matrixWorld=this.matrixWorld,a.material.side=this.material.side,Vh.length=0,a.raycast(e,Vh);for(let h=0;h<Vh.length;h++)Vh[h].object=this,t.push(Vh[h])}}copy(e){const t=this.geometry;return super.copy(e),this.geometry=t,J8.forEach(n=>{this[n]=e[n]}),this}clone(){return new this.constructor().copy(this)}};fD.forEach(i=>{const e="_private_"+i;Object.defineProperty(dD.prototype,i,{get(){return this[e]},set(t){t!==this[e]&&(this[e]=t,this._needsSync=!0)}})});new Qn;new Ye;const Q8=K.forwardRef(({sdfGlyphSize:i=64,anchorX:e="center",anchorY:t="middle",font:n,fontSize:r=1,children:s,characters:a,onSync:o,...l},c)=>{const h=Jn(({invalidate:v})=>v),[d]=K.useState(()=>new dD),[p,m]=K.useMemo(()=>{const v=[];let x="";return K.Children.forEach(s,_=>{typeof _=="string"||typeof _=="number"?x+=_:v.push(_)}),[v,x]},[s]);return B4(()=>new Promise(v=>N8({font:n,characters:a},v)),["troika-text",n,a]),K.useLayoutEffect(()=>{d.sync(()=>{h(),o&&o(d)})}),K.useEffect(()=>()=>d.dispose(),[d]),K.createElement("primitive",Zf({object:d,ref:c,font:n,text:m,anchorX:e,anchorY:t,fontSize:r,sdfGlyphSize:i},l),p)}),bs=1e-5;function $8(i,e,t){const n=new lo,r=t-bs;return n.absarc(bs,bs,bs,-Math.PI/2,-Math.PI,!0),n.absarc(bs,e-r*2,bs,Math.PI,Math.PI/2,!0),n.absarc(i-r*2,e-r*2,bs,Math.PI/2,0,!0),n.absarc(i-r*2,bs,bs,0,-Math.PI/2,!0),n}const FT=K.forwardRef(function({args:[e=1,t=1,n=1]=[],radius:r=.05,steps:s=1,smoothness:a=4,bevelSegments:o=4,creaseAngle:l=.4,children:c,...h},d){return K.createElement("mesh",Zf({ref:d},h),K.createElement(e7,{args:[e,t,n],radius:r,steps:s,smoothness:a,bevelSegments:o,creaseAngle:l}),c)}),e7=K.forwardRef(function({args:[e=1,t=1,n=1]=[],radius:r=.05,steps:s=1,smoothness:a=4,bevelSegments:o=4,creaseAngle:l=.4,...c},h){const d=K.useMemo(()=>$8(e,t,r),[e,t,r]),p=K.useMemo(()=>({depth:n-r*2,bevelEnabled:!0,bevelSegments:o*2,steps:s,bevelSize:r-bs,bevelThickness:r,curveSegments:a}),[n,r,a,o,s]),m=K.useRef(null);return K.useLayoutEffect(()=>{m.current&&(m.current.center(),iG(m.current,l))},[d,p,l]),K.useImperativeHandle(h,()=>m.current),K.createElement("extrudeGeometry",Zf({ref:m,args:[d,p]},c))});var Wh={exports:{}},BT;function t7(){if(BT)return Wh.exports;BT=1;const i={ellipse:"…",chars:[" ","-"],max:140,truncate:!0};function e(n,r,s,a){if(n.length<=r)return n;if(r<2)return n.slice(0,r-s.length)+s;const o=r-s.length,l=Math.floor(o/2);let c=l,h=n.length-l;for(let d=0;d<l;d++){const p=n.charAt(d),m=n.length-d,v=n.charAt(m);a.indexOf(p)!==-1&&(c=d),a.indexOf(v)!==-1&&(h=m)}return n.slice(0,c)+s+n.slice(h)}function t(n,r,s,a,o){if(n.length<=r)return n;const l=r-s.length;let c=l,h=!1;for(let d=0;d<=l;d++){const p=n.charAt(d);a.indexOf(p)!==-1&&(c=d,h=!0)}return!o&&!h?"":n.slice(0,c)+s}return Wh.exports=(n,r,s)=>{if(typeof n!="string"||n.length===0||r===0)return"";s=s||{};for(var a in i)(s[a]===null||typeof s[a]>"u")&&(s[a]=i[a]);return s.max=r||s.max,s.truncate==="middle"?e(n,s.max,s.ellipse,s.chars):t(n,s.max,s.ellipse,s.chars,s.truncate)},Wh.exports.ellipsizeMiddle=e,Wh.exports.ellipsize=t,Wh.exports}var n7=t7();const i7=mo(n7);var w_,kT;function r7(){if(kT)return w_;kT=1;var i=z1(),e=Aa(),t={dimensions:["x","y"],center:.5,scale:1};function n(s,a,o){if(!e(a))throw new Error("graphology-layout/random: the given graph is not a valid graphology instance.");o=i(o,t);var l=o.dimensions;if(!Array.isArray(l)||l.length!==2)throw new Error("graphology-layout/random: given dimensions are invalid.");var c=o.center,h=o.scale,d=Math.PI*2,p=(c-.5)*h,m=a.order,v=l[0],x=l[1];function _(E,S){return S[v]=h*Math.cos(E*d/m)+p,S[x]=h*Math.sin(E*d/m)+p,S}var g=0;if(!s){var b={};return a.forEachNode(function(E){b[E]=_(g++,{})}),b}a.updateEachNodeAttributes(function(E,S){return _(g++,S),S},{attributes:l})}var r=n.bind(null,!1);return r.assign=n.bind(null,!0),w_=r,w_}var s7=r7();const a7=mo(s7);var T_,GT;function o7(){if(GT)return T_;GT=1;var i=z1(),e=Aa(),t={dimensions:["x","y"],center:.5,rng:Math.random,scale:1};function n(s,a,o){if(!e(a))throw new Error("graphology-layout/random: the given graph is not a valid graphology instance.");o=i(o,t);var l=o.dimensions;if(!Array.isArray(l)||l.length<1)throw new Error("graphology-layout/random: given dimensions are invalid.");var c=l.length,h=o.center,d=o.rng,p=o.scale,m=(h-.5)*p;function v(_){for(var g=0;g<c;g++)_[l[g]]=d()*p+m;return _}if(!s){var x={};return a.forEachNode(function(_){x[_]=v({})}),x}a.updateEachNodeAttributes(function(_,g){return v(g),g},{attributes:l})}var r=n.bind(null,!1);return r.assign=n.bind(null,!0),T_=r,T_}var l7=o7();const c7=mo(l7);var A_,HT;function u7(){if(HT)return A_;HT=1;var i=0,e=1,t=2,n=3,r=4,s=5,a=6,o=7,l=8,c=9,h=0,d=1,p=2,m=0,v=1,x=2,_=3,g=4,b=5,E=6,S=7,w=8,T=3,R=10,U=3,A=9,D=10;return A_=function(P,I,V){var H,z,O,B,G,X,k,Y,Q,te,ee=I.length,ie=V.length,re=P.adjustSizes,de=P.barnesHutTheta*P.barnesHutTheta,Ae,Me,ve,fe,J,oe,se,$=[];for(O=0;O<ee;O+=R)I[O+r]=I[O+t],I[O+s]=I[O+n],I[O+t]=0,I[O+n]=0;if(P.outboundAttractionDistribution){for(Ae=0,O=0;O<ee;O+=R)Ae+=I[O+a];Ae/=ee/R}if(P.barnesHutOptimize){var pe=1/0,ye=-1/0,xe=1/0,be=-1/0,ue,He,W;for(O=0;O<ee;O+=R)pe=Math.min(pe,I[O+i]),ye=Math.max(ye,I[O+i]),xe=Math.min(xe,I[O+e]),be=Math.max(be,I[O+e]);var F=ye-pe,ne=be-xe;for(F>ne?(xe-=(F-ne)/2,be=xe+F):(pe-=(ne-F)/2,ye=pe+ne),$[0+m]=-1,$[0+v]=(pe+ye)/2,$[0+x]=(xe+be)/2,$[0+_]=Math.max(ye-pe,be-xe),$[0+g]=-1,$[0+b]=-1,$[0+E]=0,$[0+S]=0,$[0+w]=0,H=1,O=0;O<ee;O+=R)for(z=0,W=T;;)if($[z+b]>=0){I[O+i]<$[z+v]?I[O+e]<$[z+x]?ue=$[z+b]:ue=$[z+b]+A:I[O+e]<$[z+x]?ue=$[z+b]+A*2:ue=$[z+b]+A*3,$[z+S]=($[z+S]*$[z+E]+I[O+i]*I[O+a])/($[z+E]+I[O+a]),$[z+w]=($[z+w]*$[z+E]+I[O+e]*I[O+a])/($[z+E]+I[O+a]),$[z+E]+=I[O+a],z=ue;continue}else if($[z+m]<0){$[z+m]=O;break}else{if($[z+b]=H*A,Y=$[z+_]/2,Q=$[z+b],$[Q+m]=-1,$[Q+v]=$[z+v]-Y,$[Q+x]=$[z+x]-Y,$[Q+_]=Y,$[Q+g]=Q+A,$[Q+b]=-1,$[Q+E]=0,$[Q+S]=0,$[Q+w]=0,Q+=A,$[Q+m]=-1,$[Q+v]=$[z+v]-Y,$[Q+x]=$[z+x]+Y,$[Q+_]=Y,$[Q+g]=Q+A,$[Q+b]=-1,$[Q+E]=0,$[Q+S]=0,$[Q+w]=0,Q+=A,$[Q+m]=-1,$[Q+v]=$[z+v]+Y,$[Q+x]=$[z+x]-Y,$[Q+_]=Y,$[Q+g]=Q+A,$[Q+b]=-1,$[Q+E]=0,$[Q+S]=0,$[Q+w]=0,Q+=A,$[Q+m]=-1,$[Q+v]=$[z+v]+Y,$[Q+x]=$[z+x]+Y,$[Q+_]=Y,$[Q+g]=$[z+g],$[Q+b]=-1,$[Q+E]=0,$[Q+S]=0,$[Q+w]=0,H+=4,I[$[z+m]+i]<$[z+v]?I[$[z+m]+e]<$[z+x]?ue=$[z+b]:ue=$[z+b]+A:I[$[z+m]+e]<$[z+x]?ue=$[z+b]+A*2:ue=$[z+b]+A*3,$[z+E]=I[$[z+m]+a],$[z+S]=I[$[z+m]+i],$[z+w]=I[$[z+m]+e],$[ue+m]=$[z+m],$[z+m]=-1,I[O+i]<$[z+v]?I[O+e]<$[z+x]?He=$[z+b]:He=$[z+b]+A:I[O+e]<$[z+x]?He=$[z+b]+A*2:He=$[z+b]+A*3,ue===He)if(W--){z=ue;continue}else{W=T;break}$[He+m]=O;break}}if(P.barnesHutOptimize)for(Me=P.scalingRatio,O=0;O<ee;O+=R)for(z=0;;)if($[z+b]>=0)if(oe=Math.pow(I[O+i]-$[z+S],2)+Math.pow(I[O+e]-$[z+w],2),te=$[z+_],4*te*te/oe<de){if(ve=I[O+i]-$[z+S],fe=I[O+e]-$[z+w],re===!0?oe>0?(se=Me*I[O+a]*$[z+E]/oe,I[O+t]+=ve*se,I[O+n]+=fe*se):oe<0&&(se=-Me*I[O+a]*$[z+E]/Math.sqrt(oe),I[O+t]+=ve*se,I[O+n]+=fe*se):oe>0&&(se=Me*I[O+a]*$[z+E]/oe,I[O+t]+=ve*se,I[O+n]+=fe*se),z=$[z+g],z<0)break;continue}else{z=$[z+b];continue}else{if(X=$[z+m],X>=0&&X!==O&&(ve=I[O+i]-I[X+i],fe=I[O+e]-I[X+e],oe=ve*ve+fe*fe,re===!0?oe>0?(se=Me*I[O+a]*I[X+a]/oe,I[O+t]+=ve*se,I[O+n]+=fe*se):oe<0&&(se=-Me*I[O+a]*I[X+a]/Math.sqrt(oe),I[O+t]+=ve*se,I[O+n]+=fe*se):oe>0&&(se=Me*I[O+a]*I[X+a]/oe,I[O+t]+=ve*se,I[O+n]+=fe*se)),z=$[z+g],z<0)break;continue}else for(Me=P.scalingRatio,B=0;B<ee;B+=R)for(G=0;G<B;G+=R)ve=I[B+i]-I[G+i],fe=I[B+e]-I[G+e],re===!0?(oe=Math.sqrt(ve*ve+fe*fe)-I[B+l]-I[G+l],oe>0?(se=Me*I[B+a]*I[G+a]/oe/oe,I[B+t]+=ve*se,I[B+n]+=fe*se,I[G+t]-=ve*se,I[G+n]-=fe*se):oe<0&&(se=100*Me*I[B+a]*I[G+a],I[B+t]+=ve*se,I[B+n]+=fe*se,I[G+t]-=ve*se,I[G+n]-=fe*se)):(oe=Math.sqrt(ve*ve+fe*fe),oe>0&&(se=Me*I[B+a]*I[G+a]/oe/oe,I[B+t]+=ve*se,I[B+n]+=fe*se,I[G+t]-=ve*se,I[G+n]-=fe*se));for(Q=P.gravity/P.scalingRatio,Me=P.scalingRatio,O=0;O<ee;O+=R)se=0,ve=I[O+i],fe=I[O+e],oe=Math.sqrt(Math.pow(ve,2)+Math.pow(fe,2)),P.strongGravityMode?oe>0&&(se=Me*I[O+a]*Q):oe>0&&(se=Me*I[O+a]*Q/oe),I[O+t]-=ve*se,I[O+n]-=fe*se;for(Me=1*(P.outboundAttractionDistribution?Ae:1),k=0;k<ie;k+=U)B=V[k+h],G=V[k+d],Y=V[k+p],J=Math.pow(Y,P.edgeWeightInfluence),ve=I[B+i]-I[G+i],fe=I[B+e]-I[G+e],re===!0?(oe=Math.sqrt(ve*ve+fe*fe)-I[B+l]-I[G+l],P.linLogMode?P.outboundAttractionDistribution?oe>0&&(se=-Me*J*Math.log(1+oe)/oe/I[B+a]):oe>0&&(se=-Me*J*Math.log(1+oe)/oe):P.outboundAttractionDistribution?oe>0&&(se=-Me*J/I[B+a]):oe>0&&(se=-Me*J)):(oe=Math.sqrt(Math.pow(ve,2)+Math.pow(fe,2)),P.linLogMode?P.outboundAttractionDistribution?oe>0&&(se=-Me*J*Math.log(1+oe)/oe/I[B+a]):oe>0&&(se=-Me*J*Math.log(1+oe)/oe):P.outboundAttractionDistribution?(oe=1,se=-Me*J/I[B+a]):(oe=1,se=-Me*J)),oe>0&&(I[B+t]+=ve*se,I[B+n]+=fe*se,I[G+t]-=ve*se,I[G+n]-=fe*se);var Se,_e,me,ze,Ne,je;if(re===!0)for(O=0;O<ee;O+=R)I[O+c]!==1&&(Se=Math.sqrt(Math.pow(I[O+t],2)+Math.pow(I[O+n],2)),Se>D&&(I[O+t]=I[O+t]*D/Se,I[O+n]=I[O+n]*D/Se),_e=I[O+a]*Math.sqrt((I[O+r]-I[O+t])*(I[O+r]-I[O+t])+(I[O+s]-I[O+n])*(I[O+s]-I[O+n])),me=Math.sqrt((I[O+r]+I[O+t])*(I[O+r]+I[O+t])+(I[O+s]+I[O+n])*(I[O+s]+I[O+n]))/2,ze=.1*Math.log(1+me)/(1+Math.sqrt(_e)),Ne=I[O+i]+I[O+t]*(ze/P.slowDown),I[O+i]=Ne,je=I[O+e]+I[O+n]*(ze/P.slowDown),I[O+e]=je);else for(O=0;O<ee;O+=R)I[O+c]!==1&&(_e=I[O+a]*Math.sqrt((I[O+r]-I[O+t])*(I[O+r]-I[O+t])+(I[O+s]-I[O+n])*(I[O+s]-I[O+n])),me=Math.sqrt((I[O+r]+I[O+t])*(I[O+r]+I[O+t])+(I[O+s]+I[O+n])*(I[O+s]+I[O+n]))/2,ze=I[O+o]*Math.log(1+me)/(1+Math.sqrt(_e)),I[O+o]=Math.min(1,Math.sqrt(ze*(Math.pow(I[O+t],2)+Math.pow(I[O+n],2))/(1+Math.sqrt(_e)))),Ne=I[O+i]+I[O+t]*(ze/P.slowDown),I[O+i]=Ne,je=I[O+e]+I[O+n]*(ze/P.slowDown),I[O+e]=je);return{}},A_}var ca={},VT;function h7(){if(VT)return ca;VT=1;var i=10,e=3;return ca.assign=function(t){t=t||{};var n=Array.prototype.slice.call(arguments).slice(1),r,s,a;for(r=0,a=n.length;r<a;r++)if(n[r])for(s in n[r])t[s]=n[r][s];return t},ca.validateSettings=function(t){return"linLogMode"in t&&typeof t.linLogMode!="boolean"?{message:"the `linLogMode` setting should be a boolean."}:"outboundAttractionDistribution"in t&&typeof t.outboundAttractionDistribution!="boolean"?{message:"the `outboundAttractionDistribution` setting should be a boolean."}:"adjustSizes"in t&&typeof t.adjustSizes!="boolean"?{message:"the `adjustSizes` setting should be a boolean."}:"edgeWeightInfluence"in t&&typeof t.edgeWeightInfluence!="number"?{message:"the `edgeWeightInfluence` setting should be a number."}:"scalingRatio"in t&&!(typeof t.scalingRatio=="number"&&t.scalingRatio>=0)?{message:"the `scalingRatio` setting should be a number >= 0."}:"strongGravityMode"in t&&typeof t.strongGravityMode!="boolean"?{message:"the `strongGravityMode` setting should be a boolean."}:"gravity"in t&&!(typeof t.gravity=="number"&&t.gravity>=0)?{message:"the `gravity` setting should be a number >= 0."}:"slowDown"in t&&!(typeof t.slowDown=="number"||t.slowDown>=0)?{message:"the `slowDown` setting should be a number >= 0."}:"barnesHutOptimize"in t&&typeof t.barnesHutOptimize!="boolean"?{message:"the `barnesHutOptimize` setting should be a boolean."}:"barnesHutTheta"in t&&!(typeof t.barnesHutTheta=="number"&&t.barnesHutTheta>=0)?{message:"the `barnesHutTheta` setting should be a number >= 0."}:null},ca.graphToByteArrays=function(t,n){var r=t.order,s=t.size,a={},o,l=new Float32Array(r*i),c=new Float32Array(s*e);return o=0,t.forEachNode(function(h,d){a[h]=o,l[o]=d.x,l[o+1]=d.y,l[o+2]=0,l[o+3]=0,l[o+4]=0,l[o+5]=0,l[o+6]=1,l[o+7]=1,l[o+8]=d.size||1,l[o+9]=d.fixed?1:0,o+=i}),o=0,t.forEachEdge(function(h,d,p,m,v,x,_){var g=a[p],b=a[m],E=n(h,d,p,m,v,x,_);l[g+6]+=E,l[b+6]+=E,c[o]=g,c[o+1]=b,c[o+2]=E,o+=e}),{nodes:l,edges:c}},ca.assignLayoutChanges=function(t,n,r){var s=0;t.updateEachNodeAttributes(function(a,o){return o.x=n[s],o.y=n[s+1],s+=i,r?r(a,o):o})},ca.readGraphPositions=function(t,n){var r=0;t.forEachNode(function(s,a){n[r]=a.x,n[r+1]=a.y,r+=i})},ca.collectLayoutChanges=function(t,n,r){for(var s=t.nodes(),a={},o=0,l=0,c=n.length;o<c;o+=i){if(r){var h=Object.assign({},t.getNodeAttributes(s[l]));h.x=n[o],h.y=n[o+1],h=r(s[l],h),a[s[l]]={x:h.x,y:h.y}}else a[s[l]]={x:n[o],y:n[o+1]};l++}return a},ca.createWorker=function(n){var r=window.URL||window.webkitURL,s=n.toString(),a=r.createObjectURL(new Blob(["("+s+").call(this);"],{type:"text/javascript"})),o=new Worker(a);return r.revokeObjectURL(a),o},ca}var C_,WT;function f7(){return WT||(WT=1,C_={linLogMode:!1,outboundAttractionDistribution:!1,adjustSizes:!1,edgeWeightInfluence:1,scalingRatio:1,strongGravityMode:!1,gravity:1,slowDown:1,barnesHutOptimize:!1,barnesHutTheta:.5}),C_}var R_,XT;function d7(){if(XT)return R_;XT=1;var i=Aa(),e=d0().createEdgeWeightGetter,t=u7(),n=h7(),r=f7();function s(l,c,h){if(!i(c))throw new Error("graphology-layout-forceatlas2: the given graph is not a valid graphology instance.");typeof h=="number"&&(h={iterations:h});var d=h.iterations;if(typeof d!="number")throw new Error("graphology-layout-forceatlas2: invalid number of iterations.");if(d<=0)throw new Error("graphology-layout-forceatlas2: you should provide a positive number of iterations.");var p=e("getEdgeWeight"in h?h.getEdgeWeight:"weight").fromEntry,m=typeof h.outputReducer=="function"?h.outputReducer:null,v=n.assign({},r,h.settings),x=n.validateSettings(v);if(x)throw new Error("graphology-layout-forceatlas2: "+x.message);var _=n.graphToByteArrays(c,p),g;for(g=0;g<d;g++)t(v,_.nodes,_.edges);if(l){n.assignLayoutChanges(c,_.nodes,m);return}return n.collectLayoutChanges(c,_.nodes)}function a(l){var c=typeof l=="number"?l:l.order;return{barnesHutOptimize:c>2e3,strongGravityMode:!0,gravity:.05,scalingRatio:10,slowDown:1+Math.log(c)}}var o=s.bind(null,!1);return o.assign=s.bind(null,!0),o.inferSettings=a,R_=o,R_}var p7=d7();const m7=mo(p7);function g7(i,e,t){var n,r=1;i==null&&(i=0),e==null&&(e=0),t==null&&(t=0);function s(){var a,o=n.length,l,c=0,h=0,d=0;for(a=0;a<o;++a)l=n[a],c+=l.x||0,h+=l.y||0,d+=l.z||0;for(c=(c/o-i)*r,h=(h/o-e)*r,d=(d/o-t)*r,a=0;a<o;++a)l=n[a],c&&(l.x-=c),h&&(l.y-=h),d&&(l.z-=d)}return s.initialize=function(a){n=a},s.x=function(a){return arguments.length?(i=+a,s):i},s.y=function(a){return arguments.length?(e=+a,s):e},s.z=function(a){return arguments.length?(t=+a,s):t},s.strength=function(a){return arguments.length?(r=+a,s):r},s}function v7(i){const e=+this._x.call(null,i);return pD(this.cover(e),e,i)}function pD(i,e,t){if(isNaN(e))return i;var n,r=i._root,s={data:t},a=i._x0,o=i._x1,l,c,h,d,p;if(!r)return i._root=s,i;for(;r.length;)if((h=e>=(l=(a+o)/2))?a=l:o=l,n=r,!(r=r[d=+h]))return n[d]=s,i;if(c=+i._x.call(null,r.data),e===c)return s.next=r,n?n[d]=s:i._root=s,i;do n=n?n[d]=new Array(2):i._root=new Array(2),(h=e>=(l=(a+o)/2))?a=l:o=l;while((d=+h)==(p=+(c>=l)));return n[p]=r,n[d]=s,i}function y7(i){Array.isArray(i)||(i=Array.from(i));const e=i.length,t=new Float64Array(e);let n=1/0,r=-1/0;for(let s=0,a;s<e;++s)isNaN(a=+this._x.call(null,i[s]))||(t[s]=a,a<n&&(n=a),a>r&&(r=a));if(n>r)return this;this.cover(n).cover(r);for(let s=0;s<e;++s)pD(this,t[s],i[s]);return this}function _7(i){if(isNaN(i=+i))return this;var e=this._x0,t=this._x1;if(isNaN(e))t=(e=Math.floor(i))+1;else{for(var n=t-e||1,r=this._root,s,a;e>i||i>=t;)switch(a=+(i<e),s=new Array(2),s[a]=r,r=s,n*=2,a){case 0:t=e+n;break;case 1:e=t-n;break}this._root&&this._root.length&&(this._root=r)}return this._x0=e,this._x1=t,this}function x7(){var i=[];return this.visit(function(e){if(!e.length)do i.push(e.data);while(e=e.next)}),i}function b7(i){return arguments.length?this.cover(+i[0][0]).cover(+i[1][0]):isNaN(this._x0)?void 0:[[this._x0],[this._x1]]}function ya(i,e,t){this.node=i,this.x0=e,this.x1=t}function S7(i,e){var t,n=this._x0,r,s,a=this._x1,o=[],l=this._root,c,h;for(l&&o.push(new ya(l,n,a)),e==null?e=1/0:(n=i-e,a=i+e);c=o.pop();)if(!(!(l=c.node)||(r=c.x0)>a||(s=c.x1)<n))if(l.length){var d=(r+s)/2;o.push(new ya(l[1],d,s),new ya(l[0],r,d)),(h=+(i>=d))&&(c=o[o.length-1],o[o.length-1]=o[o.length-1-h],o[o.length-1-h]=c)}else{var p=Math.abs(i-+this._x.call(null,l.data));p<e&&(e=p,n=i-p,a=i+p,t=l.data)}return t}function E7(i){if(isNaN(l=+this._x.call(null,i)))return this;var e,t=this._root,n,r,s,a=this._x0,o=this._x1,l,c,h,d,p;if(!t)return this;if(t.length)for(;;){if((h=l>=(c=(a+o)/2))?a=c:o=c,e=t,!(t=t[d=+h]))return this;if(!t.length)break;e[d+1&1]&&(n=e,p=d)}for(;t.data!==i;)if(r=t,!(t=t.next))return this;return(s=t.next)&&delete t.next,r?(s?r.next=s:delete r.next,this):e?(s?e[d]=s:delete e[d],(t=e[0]||e[1])&&t===(e[1]||e[0])&&!t.length&&(n?n[p]=t:this._root=t),this):(this._root=s,this)}function M7(i){for(var e=0,t=i.length;e<t;++e)this.remove(i[e]);return this}function w7(){return this._root}function T7(){var i=0;return this.visit(function(e){if(!e.length)do++i;while(e=e.next)}),i}function A7(i){var e=[],t,n=this._root,r,s,a;for(n&&e.push(new ya(n,this._x0,this._x1));t=e.pop();)if(!i(n=t.node,s=t.x0,a=t.x1)&&n.length){var o=(s+a)/2;(r=n[1])&&e.push(new ya(r,o,a)),(r=n[0])&&e.push(new ya(r,s,o))}return this}function C7(i){var e=[],t=[],n;for(this._root&&e.push(new ya(this._root,this._x0,this._x1));n=e.pop();){var r=n.node;if(r.length){var s,a=n.x0,o=n.x1,l=(a+o)/2;(s=r[0])&&e.push(new ya(s,a,l)),(s=r[1])&&e.push(new ya(s,l,o))}t.push(n)}for(;n=t.pop();)i(n.node,n.x0,n.x1);return this}function R7(i){return i[0]}function D7(i){return arguments.length?(this._x=i,this):this._x}function rb(i,e){var t=new sb(e??R7,NaN,NaN);return i==null?t:t.addAll(i)}function sb(i,e,t){this._x=i,this._x0=e,this._x1=t,this._root=void 0}function jT(i){for(var e={data:i.data},t=e;i=i.next;)t=t.next={data:i.data};return e}var ir=rb.prototype=sb.prototype;ir.copy=function(){var i=new sb(this._x,this._x0,this._x1),e=this._root,t,n;if(!e)return i;if(!e.length)return i._root=jT(e),i;for(t=[{source:e,target:i._root=new Array(2)}];e=t.pop();)for(var r=0;r<2;++r)(n=e.source[r])&&(n.length?t.push({source:n,target:e.target[r]=new Array(2)}):e.target[r]=jT(n));return i};ir.add=v7;ir.addAll=y7;ir.cover=_7;ir.data=x7;ir.extent=b7;ir.find=S7;ir.remove=E7;ir.removeAll=M7;ir.root=w7;ir.size=T7;ir.visit=A7;ir.visitAfter=C7;ir.x=D7;function U7(i){const e=+this._x.call(null,i),t=+this._y.call(null,i);return mD(this.cover(e,t),e,t,i)}function mD(i,e,t,n){if(isNaN(e)||isNaN(t))return i;var r,s=i._root,a={data:n},o=i._x0,l=i._y0,c=i._x1,h=i._y1,d,p,m,v,x,_,g,b;if(!s)return i._root=a,i;for(;s.length;)if((x=e>=(d=(o+c)/2))?o=d:c=d,(_=t>=(p=(l+h)/2))?l=p:h=p,r=s,!(s=s[g=_<<1|x]))return r[g]=a,i;if(m=+i._x.call(null,s.data),v=+i._y.call(null,s.data),e===m&&t===v)return a.next=s,r?r[g]=a:i._root=a,i;do r=r?r[g]=new Array(4):i._root=new Array(4),(x=e>=(d=(o+c)/2))?o=d:c=d,(_=t>=(p=(l+h)/2))?l=p:h=p;while((g=_<<1|x)===(b=(v>=p)<<1|m>=d));return r[b]=s,r[g]=a,i}function O7(i){var e,t,n=i.length,r,s,a=new Array(n),o=new Array(n),l=1/0,c=1/0,h=-1/0,d=-1/0;for(t=0;t<n;++t)isNaN(r=+this._x.call(null,e=i[t]))||isNaN(s=+this._y.call(null,e))||(a[t]=r,o[t]=s,r<l&&(l=r),r>h&&(h=r),s<c&&(c=s),s>d&&(d=s));if(l>h||c>d)return this;for(this.cover(l,c).cover(h,d),t=0;t<n;++t)mD(this,a[t],o[t],i[t]);return this}function L7(i,e){if(isNaN(i=+i)||isNaN(e=+e))return this;var t=this._x0,n=this._y0,r=this._x1,s=this._y1;if(isNaN(t))r=(t=Math.floor(i))+1,s=(n=Math.floor(e))+1;else{for(var a=r-t||1,o=this._root,l,c;t>i||i>=r||n>e||e>=s;)switch(c=(e<n)<<1|i<t,l=new Array(4),l[c]=o,o=l,a*=2,c){case 0:r=t+a,s=n+a;break;case 1:t=r-a,s=n+a;break;case 2:r=t+a,n=s-a;break;case 3:t=r-a,n=s-a;break}this._root&&this._root.length&&(this._root=o)}return this._x0=t,this._y0=n,this._x1=r,this._y1=s,this}function I7(){var i=[];return this.visit(function(e){if(!e.length)do i.push(e.data);while(e=e.next)}),i}function N7(i){return arguments.length?this.cover(+i[0][0],+i[0][1]).cover(+i[1][0],+i[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function zi(i,e,t,n,r){this.node=i,this.x0=e,this.y0=t,this.x1=n,this.y1=r}function P7(i,e,t){var n,r=this._x0,s=this._y0,a,o,l,c,h=this._x1,d=this._y1,p=[],m=this._root,v,x;for(m&&p.push(new zi(m,r,s,h,d)),t==null?t=1/0:(r=i-t,s=e-t,h=i+t,d=e+t,t*=t);v=p.pop();)if(!(!(m=v.node)||(a=v.x0)>h||(o=v.y0)>d||(l=v.x1)<r||(c=v.y1)<s))if(m.length){var _=(a+l)/2,g=(o+c)/2;p.push(new zi(m[3],_,g,l,c),new zi(m[2],a,g,_,c),new zi(m[1],_,o,l,g),new zi(m[0],a,o,_,g)),(x=(e>=g)<<1|i>=_)&&(v=p[p.length-1],p[p.length-1]=p[p.length-1-x],p[p.length-1-x]=v)}else{var b=i-+this._x.call(null,m.data),E=e-+this._y.call(null,m.data),S=b*b+E*E;if(S<t){var w=Math.sqrt(t=S);r=i-w,s=e-w,h=i+w,d=e+w,n=m.data}}return n}function z7(i){if(isNaN(h=+this._x.call(null,i))||isNaN(d=+this._y.call(null,i)))return this;var e,t=this._root,n,r,s,a=this._x0,o=this._y0,l=this._x1,c=this._y1,h,d,p,m,v,x,_,g;if(!t)return this;if(t.length)for(;;){if((v=h>=(p=(a+l)/2))?a=p:l=p,(x=d>=(m=(o+c)/2))?o=m:c=m,e=t,!(t=t[_=x<<1|v]))return this;if(!t.length)break;(e[_+1&3]||e[_+2&3]||e[_+3&3])&&(n=e,g=_)}for(;t.data!==i;)if(r=t,!(t=t.next))return this;return(s=t.next)&&delete t.next,r?(s?r.next=s:delete r.next,this):e?(s?e[_]=s:delete e[_],(t=e[0]||e[1]||e[2]||e[3])&&t===(e[3]||e[2]||e[1]||e[0])&&!t.length&&(n?n[g]=t:this._root=t),this):(this._root=s,this)}function F7(i){for(var e=0,t=i.length;e<t;++e)this.remove(i[e]);return this}function B7(){return this._root}function k7(){var i=0;return this.visit(function(e){if(!e.length)do++i;while(e=e.next)}),i}function G7(i){var e=[],t,n=this._root,r,s,a,o,l;for(n&&e.push(new zi(n,this._x0,this._y0,this._x1,this._y1));t=e.pop();)if(!i(n=t.node,s=t.x0,a=t.y0,o=t.x1,l=t.y1)&&n.length){var c=(s+o)/2,h=(a+l)/2;(r=n[3])&&e.push(new zi(r,c,h,o,l)),(r=n[2])&&e.push(new zi(r,s,h,c,l)),(r=n[1])&&e.push(new zi(r,c,a,o,h)),(r=n[0])&&e.push(new zi(r,s,a,c,h))}return this}function H7(i){var e=[],t=[],n;for(this._root&&e.push(new zi(this._root,this._x0,this._y0,this._x1,this._y1));n=e.pop();){var r=n.node;if(r.length){var s,a=n.x0,o=n.y0,l=n.x1,c=n.y1,h=(a+l)/2,d=(o+c)/2;(s=r[0])&&e.push(new zi(s,a,o,h,d)),(s=r[1])&&e.push(new zi(s,h,o,l,d)),(s=r[2])&&e.push(new zi(s,a,d,h,c)),(s=r[3])&&e.push(new zi(s,h,d,l,c))}t.push(n)}for(;n=t.pop();)i(n.node,n.x0,n.y0,n.x1,n.y1);return this}function V7(i){return i[0]}function W7(i){return arguments.length?(this._x=i,this):this._x}function X7(i){return i[1]}function j7(i){return arguments.length?(this._y=i,this):this._y}function ab(i,e,t){var n=new ob(e??V7,t??X7,NaN,NaN,NaN,NaN);return i==null?n:n.addAll(i)}function ob(i,e,t,n,r,s){this._x=i,this._y=e,this._x0=t,this._y0=n,this._x1=r,this._y1=s,this._root=void 0}function qT(i){for(var e={data:i.data},t=e;i=i.next;)t=t.next={data:i.data};return e}var Gi=ab.prototype=ob.prototype;Gi.copy=function(){var i=new ob(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,t,n;if(!e)return i;if(!e.length)return i._root=qT(e),i;for(t=[{source:e,target:i._root=new Array(4)}];e=t.pop();)for(var r=0;r<4;++r)(n=e.source[r])&&(n.length?t.push({source:n,target:e.target[r]=new Array(4)}):e.target[r]=qT(n));return i};Gi.add=U7;Gi.addAll=O7;Gi.cover=L7;Gi.data=I7;Gi.extent=N7;Gi.find=P7;Gi.remove=z7;Gi.removeAll=F7;Gi.root=B7;Gi.size=k7;Gi.visit=G7;Gi.visitAfter=H7;Gi.x=W7;Gi.y=j7;function q7(i){const e=+this._x.call(null,i),t=+this._y.call(null,i),n=+this._z.call(null,i);return gD(this.cover(e,t,n),e,t,n,i)}function gD(i,e,t,n,r){if(isNaN(e)||isNaN(t)||isNaN(n))return i;var s,a=i._root,o={data:r},l=i._x0,c=i._y0,h=i._z0,d=i._x1,p=i._y1,m=i._z1,v,x,_,g,b,E,S,w,T,R,U;if(!a)return i._root=o,i;for(;a.length;)if((S=e>=(v=(l+d)/2))?l=v:d=v,(w=t>=(x=(c+p)/2))?c=x:p=x,(T=n>=(_=(h+m)/2))?h=_:m=_,s=a,!(a=a[R=T<<2|w<<1|S]))return s[R]=o,i;if(g=+i._x.call(null,a.data),b=+i._y.call(null,a.data),E=+i._z.call(null,a.data),e===g&&t===b&&n===E)return o.next=a,s?s[R]=o:i._root=o,i;do s=s?s[R]=new Array(8):i._root=new Array(8),(S=e>=(v=(l+d)/2))?l=v:d=v,(w=t>=(x=(c+p)/2))?c=x:p=x,(T=n>=(_=(h+m)/2))?h=_:m=_;while((R=T<<2|w<<1|S)===(U=(E>=_)<<2|(b>=x)<<1|g>=v));return s[U]=a,s[R]=o,i}function Y7(i){Array.isArray(i)||(i=Array.from(i));const e=i.length,t=new Float64Array(e),n=new Float64Array(e),r=new Float64Array(e);let s=1/0,a=1/0,o=1/0,l=-1/0,c=-1/0,h=-1/0;for(let d=0,p,m,v,x;d<e;++d)isNaN(m=+this._x.call(null,p=i[d]))||isNaN(v=+this._y.call(null,p))||isNaN(x=+this._z.call(null,p))||(t[d]=m,n[d]=v,r[d]=x,m<s&&(s=m),m>l&&(l=m),v<a&&(a=v),v>c&&(c=v),x<o&&(o=x),x>h&&(h=x));if(s>l||a>c||o>h)return this;this.cover(s,a,o).cover(l,c,h);for(let d=0;d<e;++d)gD(this,t[d],n[d],r[d],i[d]);return this}function Z7(i,e,t){if(isNaN(i=+i)||isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,r=this._y0,s=this._z0,a=this._x1,o=this._y1,l=this._z1;if(isNaN(n))a=(n=Math.floor(i))+1,o=(r=Math.floor(e))+1,l=(s=Math.floor(t))+1;else{for(var c=a-n||1,h=this._root,d,p;n>i||i>=a||r>e||e>=o||s>t||t>=l;)switch(p=(t<s)<<2|(e<r)<<1|i<n,d=new Array(8),d[p]=h,h=d,c*=2,p){case 0:a=n+c,o=r+c,l=s+c;break;case 1:n=a-c,o=r+c,l=s+c;break;case 2:a=n+c,r=o-c,l=s+c;break;case 3:n=a-c,r=o-c,l=s+c;break;case 4:a=n+c,o=r+c,s=l-c;break;case 5:n=a-c,o=r+c,s=l-c;break;case 6:a=n+c,r=o-c,s=l-c;break;case 7:n=a-c,r=o-c,s=l-c;break}this._root&&this._root.length&&(this._root=h)}return this._x0=n,this._y0=r,this._z0=s,this._x1=a,this._y1=o,this._z1=l,this}function K7(){var i=[];return this.visit(function(e){if(!e.length)do i.push(e.data);while(e=e.next)}),i}function J7(i){return arguments.length?this.cover(+i[0][0],+i[0][1],+i[0][2]).cover(+i[1][0],+i[1][1],+i[1][2]):isNaN(this._x0)?void 0:[[this._x0,this._y0,this._z0],[this._x1,this._y1,this._z1]]}function hn(i,e,t,n,r,s,a){this.node=i,this.x0=e,this.y0=t,this.z0=n,this.x1=r,this.y1=s,this.z1=a}function Q7(i,e,t,n){var r,s=this._x0,a=this._y0,o=this._z0,l,c,h,d,p,m,v=this._x1,x=this._y1,_=this._z1,g=[],b=this._root,E,S;for(b&&g.push(new hn(b,s,a,o,v,x,_)),n==null?n=1/0:(s=i-n,a=e-n,o=t-n,v=i+n,x=e+n,_=t+n,n*=n);E=g.pop();)if(!(!(b=E.node)||(l=E.x0)>v||(c=E.y0)>x||(h=E.z0)>_||(d=E.x1)<s||(p=E.y1)<a||(m=E.z1)<o))if(b.length){var w=(l+d)/2,T=(c+p)/2,R=(h+m)/2;g.push(new hn(b[7],w,T,R,d,p,m),new hn(b[6],l,T,R,w,p,m),new hn(b[5],w,c,R,d,T,m),new hn(b[4],l,c,R,w,T,m),new hn(b[3],w,T,h,d,p,R),new hn(b[2],l,T,h,w,p,R),new hn(b[1],w,c,h,d,T,R),new hn(b[0],l,c,h,w,T,R)),(S=(t>=R)<<2|(e>=T)<<1|i>=w)&&(E=g[g.length-1],g[g.length-1]=g[g.length-1-S],g[g.length-1-S]=E)}else{var U=i-+this._x.call(null,b.data),A=e-+this._y.call(null,b.data),D=t-+this._z.call(null,b.data),L=U*U+A*A+D*D;if(L<n){var P=Math.sqrt(n=L);s=i-P,a=e-P,o=t-P,v=i+P,x=e+P,_=t+P,r=b.data}}return r}const $7=(i,e,t,n,r,s)=>Math.sqrt((i-n)**2+(e-r)**2+(t-s)**2);function e9(i,e,t,n){const r=[],s=i-n,a=e-n,o=t-n,l=i+n,c=e+n,h=t+n;return this.visit((d,p,m,v,x,_,g)=>{if(!d.length)do{const b=d.data;$7(i,e,t,this._x(b),this._y(b),this._z(b))<=n&&r.push(b)}while(d=d.next);return p>l||m>c||v>h||x<s||_<a||g<o}),r}function t9(i){if(isNaN(p=+this._x.call(null,i))||isNaN(m=+this._y.call(null,i))||isNaN(v=+this._z.call(null,i)))return this;var e,t=this._root,n,r,s,a=this._x0,o=this._y0,l=this._z0,c=this._x1,h=this._y1,d=this._z1,p,m,v,x,_,g,b,E,S,w,T;if(!t)return this;if(t.length)for(;;){if((b=p>=(x=(a+c)/2))?a=x:c=x,(E=m>=(_=(o+h)/2))?o=_:h=_,(S=v>=(g=(l+d)/2))?l=g:d=g,e=t,!(t=t[w=S<<2|E<<1|b]))return this;if(!t.length)break;(e[w+1&7]||e[w+2&7]||e[w+3&7]||e[w+4&7]||e[w+5&7]||e[w+6&7]||e[w+7&7])&&(n=e,T=w)}for(;t.data!==i;)if(r=t,!(t=t.next))return this;return(s=t.next)&&delete t.next,r?(s?r.next=s:delete r.next,this):e?(s?e[w]=s:delete e[w],(t=e[0]||e[1]||e[2]||e[3]||e[4]||e[5]||e[6]||e[7])&&t===(e[7]||e[6]||e[5]||e[4]||e[3]||e[2]||e[1]||e[0])&&!t.length&&(n?n[T]=t:this._root=t),this):(this._root=s,this)}function n9(i){for(var e=0,t=i.length;e<t;++e)this.remove(i[e]);return this}function i9(){return this._root}function r9(){var i=0;return this.visit(function(e){if(!e.length)do++i;while(e=e.next)}),i}function s9(i){var e=[],t,n=this._root,r,s,a,o,l,c,h;for(n&&e.push(new hn(n,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));t=e.pop();)if(!i(n=t.node,s=t.x0,a=t.y0,o=t.z0,l=t.x1,c=t.y1,h=t.z1)&&n.length){var d=(s+l)/2,p=(a+c)/2,m=(o+h)/2;(r=n[7])&&e.push(new hn(r,d,p,m,l,c,h)),(r=n[6])&&e.push(new hn(r,s,p,m,d,c,h)),(r=n[5])&&e.push(new hn(r,d,a,m,l,p,h)),(r=n[4])&&e.push(new hn(r,s,a,m,d,p,h)),(r=n[3])&&e.push(new hn(r,d,p,o,l,c,m)),(r=n[2])&&e.push(new hn(r,s,p,o,d,c,m)),(r=n[1])&&e.push(new hn(r,d,a,o,l,p,m)),(r=n[0])&&e.push(new hn(r,s,a,o,d,p,m))}return this}function a9(i){var e=[],t=[],n;for(this._root&&e.push(new hn(this._root,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));n=e.pop();){var r=n.node;if(r.length){var s,a=n.x0,o=n.y0,l=n.z0,c=n.x1,h=n.y1,d=n.z1,p=(a+c)/2,m=(o+h)/2,v=(l+d)/2;(s=r[0])&&e.push(new hn(s,a,o,l,p,m,v)),(s=r[1])&&e.push(new hn(s,p,o,l,c,m,v)),(s=r[2])&&e.push(new hn(s,a,m,l,p,h,v)),(s=r[3])&&e.push(new hn(s,p,m,l,c,h,v)),(s=r[4])&&e.push(new hn(s,a,o,v,p,m,d)),(s=r[5])&&e.push(new hn(s,p,o,v,c,m,d)),(s=r[6])&&e.push(new hn(s,a,m,v,p,h,d)),(s=r[7])&&e.push(new hn(s,p,m,v,c,h,d))}t.push(n)}for(;n=t.pop();)i(n.node,n.x0,n.y0,n.z0,n.x1,n.y1,n.z1);return this}function o9(i){return i[0]}function l9(i){return arguments.length?(this._x=i,this):this._x}function c9(i){return i[1]}function u9(i){return arguments.length?(this._y=i,this):this._y}function h9(i){return i[2]}function f9(i){return arguments.length?(this._z=i,this):this._z}function lb(i,e,t,n){var r=new cb(e??o9,t??c9,n??h9,NaN,NaN,NaN,NaN,NaN,NaN);return i==null?r:r.addAll(i)}function cb(i,e,t,n,r,s,a,o,l){this._x=i,this._y=e,this._z=t,this._x0=n,this._y0=r,this._z0=s,this._x1=a,this._y1=o,this._z1=l,this._root=void 0}function YT(i){for(var e={data:i.data},t=e;i=i.next;)t=t.next={data:i.data};return e}var _i=lb.prototype=cb.prototype;_i.copy=function(){var i=new cb(this._x,this._y,this._z,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1),e=this._root,t,n;if(!e)return i;if(!e.length)return i._root=YT(e),i;for(t=[{source:e,target:i._root=new Array(8)}];e=t.pop();)for(var r=0;r<8;++r)(n=e.source[r])&&(n.length?t.push({source:n,target:e.target[r]=new Array(8)}):e.target[r]=YT(n));return i};_i.add=q7;_i.addAll=Y7;_i.cover=Z7;_i.data=K7;_i.extent=J7;_i.find=Q7;_i.findAllWithinRadius=e9;_i.remove=t9;_i.removeAll=n9;_i.root=i9;_i.size=r9;_i.visit=s9;_i.visitAfter=a9;_i.x=l9;_i.y=u9;_i.z=f9;function Rn(i){return function(){return i}}function Pr(i){return(i()-.5)*1e-6}function D_(i){return i.x+i.vx}function ZT(i){return i.y+i.vy}function d9(i){return i.z+i.vz}function vD(i){var e,t,n,r,s=1,a=1;typeof i!="function"&&(i=Rn(i==null?1:+i));function o(){for(var h,d=e.length,p,m,v,x,_,g,b,E=0;E<a;++E)for(p=(t===1?rb(e,D_):t===2?ab(e,D_,ZT):t===3?lb(e,D_,ZT,d9):null).visitAfter(l),h=0;h<d;++h)m=e[h],g=n[m.index],b=g*g,v=m.x+m.vx,t>1&&(x=m.y+m.vy),t>2&&(_=m.z+m.vz),p.visit(S);function S(w,T,R,U,A,D,L){var P=[T,R,U,A,D,L],I=P[0],V=P[1],H=P[2],z=P[t],O=P[t+1],B=P[t+2],G=w.data,X=w.r,k=g+X;if(G){if(G.index>m.index){var Y=v-G.x-G.vx,Q=t>1?x-G.y-G.vy:0,te=t>2?_-G.z-G.vz:0,ee=Y*Y+Q*Q+te*te;ee<k*k&&(Y===0&&(Y=Pr(r),ee+=Y*Y),t>1&&Q===0&&(Q=Pr(r),ee+=Q*Q),t>2&&te===0&&(te=Pr(r),ee+=te*te),ee=(k-(ee=Math.sqrt(ee)))/ee*s,m.vx+=(Y*=ee)*(k=(X*=X)/(b+X)),t>1&&(m.vy+=(Q*=ee)*k),t>2&&(m.vz+=(te*=ee)*k),G.vx-=Y*(k=1-k),t>1&&(G.vy-=Q*k),t>2&&(G.vz-=te*k))}return}return I>v+k||z<v-k||t>1&&(V>x+k||O<x-k)||t>2&&(H>_+k||B<_-k)}}function l(h){if(h.data)return h.r=n[h.data.index];for(var d=h.r=0;d<Math.pow(2,t);++d)h[d]&&h[d].r>h.r&&(h.r=h[d].r)}function c(){if(e){var h,d=e.length,p;for(n=new Array(d),h=0;h<d;++h)p=e[h],n[p.index]=+i(p,h,e)}}return o.initialize=function(h,...d){e=h,r=d.find(p=>typeof p=="function")||Math.random,t=d.find(p=>[1,2,3].includes(p))||2,c()},o.iterations=function(h){return arguments.length?(a=+h,o):a},o.strength=function(h){return arguments.length?(s=+h,o):s},o.radius=function(h){return arguments.length?(i=typeof h=="function"?h:Rn(+h),c(),o):i},o}function p9(i){return i.index}function KT(i,e){var t=i.get(e);if(!t)throw new Error("node not found: "+e);return t}function yD(i){var e=p9,t=p,n,r=Rn(30),s,a,o,l,c,h,d=1;i==null&&(i=[]);function p(g){return 1/Math.min(l[g.source.index],l[g.target.index])}function m(g){for(var b=0,E=i.length;b<d;++b)for(var S=0,w,T,R,U=0,A=0,D=0,L,P;S<E;++S)w=i[S],T=w.source,R=w.target,U=R.x+R.vx-T.x-T.vx||Pr(h),o>1&&(A=R.y+R.vy-T.y-T.vy||Pr(h)),o>2&&(D=R.z+R.vz-T.z-T.vz||Pr(h)),L=Math.sqrt(U*U+A*A+D*D),L=(L-s[S])/L*g*n[S],U*=L,A*=L,D*=L,R.vx-=U*(P=c[S]),o>1&&(R.vy-=A*P),o>2&&(R.vz-=D*P),T.vx+=U*(P=1-P),o>1&&(T.vy+=A*P),o>2&&(T.vz+=D*P)}function v(){if(a){var g,b=a.length,E=i.length,S=new Map(a.map((T,R)=>[e(T,R,a),T])),w;for(g=0,l=new Array(b);g<E;++g)w=i[g],w.index=g,typeof w.source!="object"&&(w.source=KT(S,w.source)),typeof w.target!="object"&&(w.target=KT(S,w.target)),l[w.source.index]=(l[w.source.index]||0)+1,l[w.target.index]=(l[w.target.index]||0)+1;for(g=0,c=new Array(E);g<E;++g)w=i[g],c[g]=l[w.source.index]/(l[w.source.index]+l[w.target.index]);n=new Array(E),x(),s=new Array(E),_()}}function x(){if(a)for(var g=0,b=i.length;g<b;++g)n[g]=+t(i[g],g,i)}function _(){if(a)for(var g=0,b=i.length;g<b;++g)s[g]=+r(i[g],g,i)}return m.initialize=function(g,...b){a=g,h=b.find(E=>typeof E=="function")||Math.random,o=b.find(E=>[1,2,3].includes(E))||2,v()},m.links=function(g){return arguments.length?(i=g,v(),m):i},m.id=function(g){return arguments.length?(e=g,m):e},m.iterations=function(g){return arguments.length?(d=+g,m):d},m.strength=function(g){return arguments.length?(t=typeof g=="function"?g:Rn(+g),x(),m):t},m.distance=function(g){return arguments.length?(r=typeof g=="function"?g:Rn(+g),_(),m):r},m}var m9={value:()=>{}};function _D(){for(var i=0,e=arguments.length,t={},n;i<e;++i){if(!(n=arguments[i]+"")||n in t||/[\s.]/.test(n))throw new Error("illegal type: "+n);t[n]=[]}return new pm(t)}function pm(i){this._=i}function g9(i,e){return i.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}})}pm.prototype=_D.prototype={constructor:pm,on:function(i,e){var t=this._,n=g9(i+"",t),r,s=-1,a=n.length;if(arguments.length<2){for(;++s<a;)if((r=(i=n[s]).type)&&(r=v9(t[r],i.name)))return r;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++s<a;)if(r=(i=n[s]).type)t[r]=JT(t[r],i.name,e);else if(e==null)for(r in t)t[r]=JT(t[r],i.name,null);return this},copy:function(){var i={},e=this._;for(var t in e)i[t]=e[t].slice();return new pm(i)},call:function(i,e){if((r=arguments.length-2)>0)for(var t=new Array(r),n=0,r,s;n<r;++n)t[n]=arguments[n+2];if(!this._.hasOwnProperty(i))throw new Error("unknown type: "+i);for(s=this._[i],n=0,r=s.length;n<r;++n)s[n].value.apply(e,t)},apply:function(i,e,t){if(!this._.hasOwnProperty(i))throw new Error("unknown type: "+i);for(var n=this._[i],r=0,s=n.length;r<s;++r)n[r].value.apply(e,t)}};function v9(i,e){for(var t=0,n=i.length,r;t<n;++t)if((r=i[t]).name===e)return r.value}function JT(i,e,t){for(var n=0,r=i.length;n<r;++n)if(i[n].name===e){i[n]=m9,i=i.slice(0,n).concat(i.slice(n+1));break}return t!=null&&i.push({name:e,value:t}),i}var bu=0,ef=0,Xh=0,xD=1e3,Eg,tf,Mg=0,Ol=0,E0=0,jf=typeof performance=="object"&&performance.now?performance:Date,bD=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(i){setTimeout(i,17)};function SD(){return Ol||(bD(y9),Ol=jf.now()+E0)}function y9(){Ol=0}function Ox(){this._call=this._time=this._next=null}Ox.prototype=ED.prototype={constructor:Ox,restart:function(i,e,t){if(typeof i!="function")throw new TypeError("callback is not a function");t=(t==null?SD():+t)+(e==null?0:+e),!this._next&&tf!==this&&(tf?tf._next=this:Eg=this,tf=this),this._call=i,this._time=t,Lx()},stop:function(){this._call&&(this._call=null,this._time=1/0,Lx())}};function ED(i,e,t){var n=new Ox;return n.restart(i,e,t),n}function _9(){SD(),++bu;for(var i=Eg,e;i;)(e=Ol-i._time)>=0&&i._call.call(void 0,e),i=i._next;--bu}function QT(){Ol=(Mg=jf.now())+E0,bu=ef=0;try{_9()}finally{bu=0,b9(),Ol=0}}function x9(){var i=jf.now(),e=i-Mg;e>xD&&(E0-=e,Mg=i)}function b9(){for(var i,e=Eg,t,n=1/0;e;)e._call?(n>e._time&&(n=e._time),i=e,e=e._next):(t=e._next,e._next=null,e=i?i._next=t:Eg=t);tf=i,Lx(n)}function Lx(i){if(!bu){ef&&(ef=clearTimeout(ef));var e=i-Ol;e>24?(i<1/0&&(ef=setTimeout(QT,i-jf.now()-E0)),Xh&&(Xh=clearInterval(Xh))):(Xh||(Mg=jf.now(),Xh=setInterval(x9,xD)),bu=1,bD(QT))}}const S9=1664525,E9=1013904223,$T=4294967296;function M9(){let i=1;return()=>(i=(S9*i+E9)%$T)/$T}var eA=3;function U_(i){return i.x}function tA(i){return i.y}function w9(i){return i.z}var T9=10,A9=Math.PI*(3-Math.sqrt(5)),C9=Math.PI*20/(9+Math.sqrt(221));function MD(i,e){e=e||2;var t=Math.min(eA,Math.max(1,Math.round(e))),n,r=1,s=.001,a=1-Math.pow(s,1/300),o=0,l=.6,c=new Map,h=ED(m),d=_D("tick","end"),p=M9();i==null&&(i=[]);function m(){v(),d.call("tick",n),r<s&&(h.stop(),d.call("end",n))}function v(g){var b,E=i.length,S;g===void 0&&(g=1);for(var w=0;w<g;++w)for(r+=(o-r)*a,c.forEach(function(T){T(r)}),b=0;b<E;++b)S=i[b],S.fx==null?S.x+=S.vx*=l:(S.x=S.fx,S.vx=0),t>1&&(S.fy==null?S.y+=S.vy*=l:(S.y=S.fy,S.vy=0)),t>2&&(S.fz==null?S.z+=S.vz*=l:(S.z=S.fz,S.vz=0));return n}function x(){for(var g=0,b=i.length,E;g<b;++g){if(E=i[g],E.index=g,E.fx!=null&&(E.x=E.fx),E.fy!=null&&(E.y=E.fy),E.fz!=null&&(E.z=E.fz),isNaN(E.x)||t>1&&isNaN(E.y)||t>2&&isNaN(E.z)){var S=T9*(t>2?Math.cbrt(.5+g):t>1?Math.sqrt(.5+g):g),w=g*A9,T=g*C9;t===1?E.x=S:t===2?(E.x=S*Math.cos(w),E.y=S*Math.sin(w)):(E.x=S*Math.sin(w)*Math.cos(T),E.y=S*Math.cos(w),E.z=S*Math.sin(w)*Math.sin(T))}(isNaN(E.vx)||t>1&&isNaN(E.vy)||t>2&&isNaN(E.vz))&&(E.vx=0,t>1&&(E.vy=0),t>2&&(E.vz=0))}}function _(g){return g.initialize&&g.initialize(i,p,t),g}return x(),n={tick:v,restart:function(){return h.restart(m),n},stop:function(){return h.stop(),n},numDimensions:function(g){return arguments.length?(t=Math.min(eA,Math.max(1,Math.round(g))),c.forEach(_),n):t},nodes:function(g){return arguments.length?(i=g,x(),c.forEach(_),n):i},alpha:function(g){return arguments.length?(r=+g,n):r},alphaMin:function(g){return arguments.length?(s=+g,n):s},alphaDecay:function(g){return arguments.length?(a=+g,n):+a},alphaTarget:function(g){return arguments.length?(o=+g,n):o},velocityDecay:function(g){return arguments.length?(l=1-g,n):1-l},randomSource:function(g){return arguments.length?(p=g,c.forEach(_),n):p},force:function(g,b){return arguments.length>1?(b==null?c.delete(g):c.set(g,_(b)),n):c.get(g)},find:function(){var g=Array.prototype.slice.call(arguments),b=g.shift()||0,E=(t>1?g.shift():null)||0,S=(t>2?g.shift():null)||0,w=g.shift()||1/0,T=0,R=i.length,U,A,D,L,P,I;for(w*=w,T=0;T<R;++T)P=i[T],U=b-P.x,A=E-(P.y||0),D=S-(P.z||0),L=U*U+A*A+D*D,L<w&&(I=P,w=L);return I},on:function(g,b){return arguments.length>1?(d.on(g,b),n):d.on(g)}}}function wD(){var i,e,t,n,r,s=Rn(-30),a,o=1,l=1/0,c=.81;function h(v){var x,_=i.length,g=(e===1?rb(i,U_):e===2?ab(i,U_,tA):e===3?lb(i,U_,tA,w9):null).visitAfter(p);for(r=v,x=0;x<_;++x)t=i[x],g.visit(m)}function d(){if(i){var v,x=i.length,_;for(a=new Array(x),v=0;v<x;++v)_=i[v],a[_.index]=+s(_,v,i)}}function p(v){var x=0,_,g,b=0,E,S,w,T,R=v.length;if(R){for(E=S=w=T=0;T<R;++T)(_=v[T])&&(g=Math.abs(_.value))&&(x+=_.value,b+=g,E+=g*(_.x||0),S+=g*(_.y||0),w+=g*(_.z||0));x*=Math.sqrt(4/R),v.x=E/b,e>1&&(v.y=S/b),e>2&&(v.z=w/b)}else{_=v,_.x=_.data.x,e>1&&(_.y=_.data.y),e>2&&(_.z=_.data.z);do x+=a[_.data.index];while(_=_.next)}v.value=x}function m(v,x,_,g,b){if(!v.value)return!0;var E=[_,g,b][e-1],S=v.x-t.x,w=e>1?v.y-t.y:0,T=e>2?v.z-t.z:0,R=E-x,U=S*S+w*w+T*T;if(R*R/c<U)return U<l&&(S===0&&(S=Pr(n),U+=S*S),e>1&&w===0&&(w=Pr(n),U+=w*w),e>2&&T===0&&(T=Pr(n),U+=T*T),U<o&&(U=Math.sqrt(o*U)),t.vx+=S*v.value*r/U,e>1&&(t.vy+=w*v.value*r/U),e>2&&(t.vz+=T*v.value*r/U)),!0;if(v.length||U>=l)return;(v.data!==t||v.next)&&(S===0&&(S=Pr(n),U+=S*S),e>1&&w===0&&(w=Pr(n),U+=w*w),e>2&&T===0&&(T=Pr(n),U+=T*T),U<o&&(U=Math.sqrt(o*U)));do v.data!==t&&(R=a[v.data.index]*r/U,t.vx+=S*R,e>1&&(t.vy+=w*R),e>2&&(t.vz+=T*R));while(v=v.next)}return h.initialize=function(v,...x){i=v,n=x.find(_=>typeof _=="function")||Math.random,e=x.find(_=>[1,2,3].includes(_))||2,d()},h.strength=function(v){return arguments.length?(s=typeof v=="function"?v:Rn(+v),d(),h):s},h.distanceMin=function(v){return arguments.length?(o=v*v,h):Math.sqrt(o)},h.distanceMax=function(v){return arguments.length?(l=v*v,h):Math.sqrt(l)},h.theta=function(v){return arguments.length?(c=v*v,h):Math.sqrt(c)},h}function R9(i,e,t,n){var r,s,a=Rn(.1),o,l;typeof i!="function"&&(i=Rn(+i)),e==null&&(e=0),t==null&&(t=0),n==null&&(n=0);function c(d){for(var p=0,m=r.length;p<m;++p){var v=r[p],x=v.x-e||1e-6,_=(v.y||0)-t||1e-6,g=(v.z||0)-n||1e-6,b=Math.sqrt(x*x+_*_+g*g),E=(l[p]-b)*o[p]*d/b;v.vx+=x*E,s>1&&(v.vy+=_*E),s>2&&(v.vz+=g*E)}}function h(){if(r){var d,p=r.length;for(o=new Array(p),l=new Array(p),d=0;d<p;++d)l[d]=+i(r[d],d,r),o[d]=isNaN(l[d])?0:+a(r[d],d,r)}}return c.initialize=function(d,...p){r=d,s=p.find(m=>[1,2,3].includes(m))||2,h()},c.strength=function(d){return arguments.length?(a=typeof d=="function"?d:Rn(+d),h(),c):a},c.radius=function(d){return arguments.length?(i=typeof d=="function"?d:Rn(+d),h(),c):i},c.x=function(d){return arguments.length?(e=+d,c):e},c.y=function(d){return arguments.length?(t=+d,c):t},c.z=function(d){return arguments.length?(n=+d,c):n},c}function Ix(i){var e=Rn(.1),t,n,r;typeof i!="function"&&(i=Rn(i==null?0:+i));function s(o){for(var l=0,c=t.length,h;l<c;++l)h=t[l],h.vx+=(r[l]-h.x)*n[l]*o}function a(){if(t){var o,l=t.length;for(n=new Array(l),r=new Array(l),o=0;o<l;++o)n[o]=isNaN(r[o]=+i(t[o],o,t))?0:+e(t[o],o,t)}}return s.initialize=function(o){t=o,a()},s.strength=function(o){return arguments.length?(e=typeof o=="function"?o:Rn(+o),a(),s):e},s.x=function(o){return arguments.length?(i=typeof o=="function"?o:Rn(+o),a(),s):i},s}function Nx(i){var e=Rn(.1),t,n,r;typeof i!="function"&&(i=Rn(i==null?0:+i));function s(o){for(var l=0,c=t.length,h;l<c;++l)h=t[l],h.vy+=(r[l]-h.y)*n[l]*o}function a(){if(t){var o,l=t.length;for(n=new Array(l),r=new Array(l),o=0;o<l;++o)n[o]=isNaN(r[o]=+i(t[o],o,t))?0:+e(t[o],o,t)}}return s.initialize=function(o){t=o,a()},s.strength=function(o){return arguments.length?(e=typeof o=="function"?o:Rn(+o),a(),s):e},s.y=function(o){return arguments.length?(i=typeof o=="function"?o:Rn(+o),a(),s):i},s}function D9(i){var e=Rn(.1),t,n,r;typeof i!="function"&&(i=Rn(i==null?0:+i));function s(o){for(var l=0,c=t.length,h;l<c;++l)h=t[l],h.vz+=(r[l]-h.z)*n[l]*o}function a(){if(t){var o,l=t.length;for(n=new Array(l),r=new Array(l),o=0;o<l;++o)n[o]=isNaN(r[o]=+i(t[o],o,t))?0:+e(t[o],o,t)}}return s.initialize=function(o){t=o,a()},s.strength=function(o){return arguments.length?(e=typeof o=="function"?o:Rn(+o),a(),s):e},s.z=function(o){return arguments.length?(i=typeof o=="function"?o:Rn(+o),a(),s):i},s}function U9(i){var e=0,t=i.children,n=t&&t.length;if(!n)e=1;else for(;--n>=0;)e+=t[n].value;i.value=e}function O9(){return this.eachAfter(U9)}function L9(i,e){let t=-1;for(const n of this)i.call(e,n,++t,this);return this}function I9(i,e){for(var t=this,n=[t],r,s,a=-1;t=n.pop();)if(i.call(e,t,++a,this),r=t.children)for(s=r.length-1;s>=0;--s)n.push(r[s]);return this}function N9(i,e){for(var t=this,n=[t],r=[],s,a,o,l=-1;t=n.pop();)if(r.push(t),s=t.children)for(a=0,o=s.length;a<o;++a)n.push(s[a]);for(;t=r.pop();)i.call(e,t,++l,this);return this}function P9(i,e){let t=-1;for(const n of this)if(i.call(e,n,++t,this))return n}function z9(i){return this.eachAfter(function(e){for(var t=+i(e.data)||0,n=e.children,r=n&&n.length;--r>=0;)t+=n[r].value;e.value=t})}function F9(i){return this.eachBefore(function(e){e.children&&e.children.sort(i)})}function B9(i){for(var e=this,t=k9(e,i),n=[e];e!==t;)e=e.parent,n.push(e);for(var r=n.length;i!==t;)n.splice(r,0,i),i=i.parent;return n}function k9(i,e){if(i===e)return i;var t=i.ancestors(),n=e.ancestors(),r=null;for(i=t.pop(),e=n.pop();i===e;)r=i,i=t.pop(),e=n.pop();return r}function G9(){for(var i=this,e=[i];i=i.parent;)e.push(i);return e}function H9(){return Array.from(this)}function V9(){var i=[];return this.eachBefore(function(e){e.children||i.push(e)}),i}function W9(){var i=this,e=[];return i.each(function(t){t!==i&&e.push({source:t.parent,target:t})}),e}function*X9(){var i=this,e,t=[i],n,r,s;do for(e=t.reverse(),t=[];i=e.pop();)if(yield i,n=i.children)for(r=0,s=n.length;r<s;++r)t.push(n[r]);while(t.length)}function M0(i,e){i instanceof Map?(i=[void 0,i],e===void 0&&(e=Y9)):e===void 0&&(e=q9);for(var t=new Su(i),n,r=[t],s,a,o,l;n=r.pop();)if((a=e(n.data))&&(l=(a=Array.from(a)).length))for(n.children=a,o=l-1;o>=0;--o)r.push(s=a[o]=new Su(a[o])),s.parent=n,s.depth=n.depth+1;return t.eachBefore(TD)}function j9(){return M0(this).eachBefore(Z9)}function q9(i){return i.children}function Y9(i){return Array.isArray(i)?i[1]:null}function Z9(i){i.data.value!==void 0&&(i.value=i.data.value),i.data=i.data.data}function TD(i){var e=0;do i.height=e;while((i=i.parent)&&i.height<++e)}function Su(i){this.data=i,this.depth=this.height=0,this.parent=null}Su.prototype=M0.prototype={constructor:Su,count:O9,each:L9,eachAfter:N9,eachBefore:I9,find:P9,sum:z9,sort:F9,path:B9,ancestors:G9,descendants:H9,leaves:V9,links:W9,copy:j9,[Symbol.iterator]:X9};function O_(i){return i==null?null:AD(i)}function AD(i){if(typeof i!="function")throw new Error;return i}function jh(){return 0}function qh(i){return function(){return i}}function K9(i){i.x0=Math.round(i.x0),i.y0=Math.round(i.y0),i.x1=Math.round(i.x1),i.y1=Math.round(i.y1)}function J9(i,e,t,n,r){for(var s=i.children,a,o=-1,l=s.length,c=i.value&&(n-e)/i.value;++o<l;)a=s[o],a.y0=t,a.y1=r,a.x0=e,a.x1=e+=a.value*c}var Q9={depth:-1},nA={},L_={};function $9(i){return i.id}function eW(i){return i.parentId}function tW(){var i=$9,e=eW,t;function n(r){var s=Array.from(r),a=i,o=e,l,c,h,d,p,m,v,x,_=new Map;if(t!=null){const g=s.map((S,w)=>nW(t(S,w,r))),b=g.map(iA),E=new Set(g).add("");for(const S of b)E.has(S)||(E.add(S),g.push(S),b.push(iA(S)),s.push(L_));a=(S,w)=>g[w],o=(S,w)=>b[w]}for(h=0,l=s.length;h<l;++h)c=s[h],m=s[h]=new Su(c),(v=a(c,h,r))!=null&&(v+="")&&(x=m.id=v,_.set(x,_.has(x)?nA:m)),(v=o(c,h,r))!=null&&(v+="")&&(m.parent=v);for(h=0;h<l;++h)if(m=s[h],v=m.parent){if(p=_.get(v),!p)throw new Error("missing: "+v);if(p===nA)throw new Error("ambiguous: "+v);p.children?p.children.push(m):p.children=[m],m.parent=p}else{if(d)throw new Error("multiple roots");d=m}if(!d)throw new Error("no root");if(t!=null){for(;d.data===L_&&d.children.length===1;)d=d.children[0],--l;for(let g=s.length-1;g>=0&&(m=s[g],m.data===L_);--g)m.data=null}if(d.parent=Q9,d.eachBefore(function(g){g.depth=g.parent.depth+1,--l}).eachBefore(TD),d.parent=null,l>0)throw new Error("cycle");return d}return n.id=function(r){return arguments.length?(i=O_(r),n):i},n.parentId=function(r){return arguments.length?(e=O_(r),n):e},n.path=function(r){return arguments.length?(t=O_(r),n):t},n}function nW(i){i=`${i}`;let e=i.length;return Px(i,e-1)&&!Px(i,e-2)&&(i=i.slice(0,-1)),i[0]==="/"?i:`/${i}`}function iA(i){let e=i.length;if(e<2)return"";for(;--e>1&&!Px(i,e););return i.slice(0,e)}function Px(i,e){if(i[e]==="/"){let t=0;for(;e>0&&i[--e]==="\\";)++t;if((t&1)===0)return!0}return!1}function iW(i,e){return i.parent===e.parent?1:2}function I_(i){var e=i.children;return e?e[0]:i.t}function N_(i){var e=i.children;return e?e[e.length-1]:i.t}function rW(i,e,t){var n=t/(e.i-i.i);e.c-=n,e.s+=t,i.c+=n,e.z+=t,e.m+=t}function sW(i){for(var e=0,t=0,n=i.children,r=n.length,s;--r>=0;)s=n[r],s.z+=e,s.m+=e,e+=s.s+(t+=s.c)}function aW(i,e,t){return i.a.parent===e.parent?i.a:t}function mm(i,e){this._=i,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}mm.prototype=Object.create(Su.prototype);function oW(i){for(var e=new mm(i,0),t,n=[e],r,s,a,o;t=n.pop();)if(s=t._.children)for(t.children=new Array(o=s.length),a=o-1;a>=0;--a)n.push(r=t.children[a]=new mm(s[a],a)),r.parent=t;return(e.parent=new mm(null,0)).children=[e],e}function lW(){var i=iW,e=1,t=1,n=null;function r(c){var h=oW(c);if(h.eachAfter(s),h.parent.m=-h.z,h.eachBefore(a),n)c.eachBefore(l);else{var d=c,p=c,m=c;c.eachBefore(function(b){b.x<d.x&&(d=b),b.x>p.x&&(p=b),b.depth>m.depth&&(m=b)});var v=d===p?1:i(d,p)/2,x=v-d.x,_=e/(p.x+v+x),g=t/(m.depth||1);c.eachBefore(function(b){b.x=(b.x+x)*_,b.y=b.depth*g})}return c}function s(c){var h=c.children,d=c.parent.children,p=c.i?d[c.i-1]:null;if(h){sW(c);var m=(h[0].z+h[h.length-1].z)/2;p?(c.z=p.z+i(c._,p._),c.m=c.z-m):c.z=m}else p&&(c.z=p.z+i(c._,p._));c.parent.A=o(c,p,c.parent.A||d[0])}function a(c){c._.x=c.z+c.parent.m,c.m+=c.parent.m}function o(c,h,d){if(h){for(var p=c,m=c,v=h,x=p.parent.children[0],_=p.m,g=m.m,b=v.m,E=x.m,S;v=N_(v),p=I_(p),v&&p;)x=I_(x),m=N_(m),m.a=c,S=v.z+b-p.z-_+i(v._,p._),S>0&&(rW(aW(v,c,d),c,S),_+=S,g+=S),b+=v.m,_+=p.m,E+=x.m,g+=m.m;v&&!N_(m)&&(m.t=v,m.m+=b-g),p&&!I_(x)&&(x.t=p,x.m+=_-E,d=c)}return d}function l(c){c.x*=e,c.y=c.depth*t}return r.separation=function(c){return arguments.length?(i=c,r):i},r.size=function(c){return arguments.length?(n=!1,e=+c[0],t=+c[1],r):n?null:[e,t]},r.nodeSize=function(c){return arguments.length?(n=!0,e=+c[0],t=+c[1],r):n?[e,t]:null},r}function cW(i,e,t,n,r){for(var s=i.children,a,o=-1,l=s.length,c=i.value&&(r-t)/i.value;++o<l;)a=s[o],a.x0=e,a.x1=n,a.y0=t,a.y1=t+=a.value*c}var uW=(1+Math.sqrt(5))/2;function hW(i,e,t,n,r,s){for(var a=[],o=e.children,l,c,h=0,d=0,p=o.length,m,v,x=e.value,_,g,b,E,S,w,T;h<p;){m=r-t,v=s-n;do _=o[d++].value;while(!_&&d<p);for(g=b=_,w=Math.max(v/m,m/v)/(x*i),T=_*_*w,S=Math.max(b/T,T/g);d<p;++d){if(_+=c=o[d].value,c<g&&(g=c),c>b&&(b=c),T=_*_*w,E=Math.max(b/T,T/g),E>S){_-=c;break}S=E}a.push(l={value:_,dice:m<v,children:o.slice(h,d)}),l.dice?J9(l,t,n,r,x?n+=v*_/x:s):cW(l,t,n,x?t+=m*_/x:r,s),x-=_,h=d}return a}const fW=(function i(e){function t(n,r,s,a,o){hW(e,n,r,s,a,o)}return t.ratio=function(n){return i((n=+n)>1?n:1)},t})(uW);function dW(){var i=fW,e=!1,t=1,n=1,r=[0],s=jh,a=jh,o=jh,l=jh,c=jh;function h(p){return p.x0=p.y0=0,p.x1=t,p.y1=n,p.eachBefore(d),r=[0],e&&p.eachBefore(K9),p}function d(p){var m=r[p.depth],v=p.x0+m,x=p.y0+m,_=p.x1-m,g=p.y1-m;_<v&&(v=_=(v+_)/2),g<x&&(x=g=(x+g)/2),p.x0=v,p.y0=x,p.x1=_,p.y1=g,p.children&&(m=r[p.depth+1]=s(p)/2,v+=c(p)-m,x+=a(p)-m,_-=o(p)-m,g-=l(p)-m,_<v&&(v=_=(v+_)/2),g<x&&(x=g=(x+g)/2),i(p,v,x,_,g))}return h.round=function(p){return arguments.length?(e=!!p,h):e},h.size=function(p){return arguments.length?(t=+p[0],n=+p[1],h):[t,n]},h.tile=function(p){return arguments.length?(i=AD(p),h):i},h.padding=function(p){return arguments.length?h.paddingInner(p).paddingOuter(p):h.paddingInner()},h.paddingInner=function(p){return arguments.length?(s=typeof p=="function"?p:qh(+p),h):s},h.paddingOuter=function(p){return arguments.length?h.paddingTop(p).paddingRight(p).paddingBottom(p).paddingLeft(p):h.paddingTop()},h.paddingTop=function(p){return arguments.length?(a=typeof p=="function"?p:qh(+p),h):a},h.paddingRight=function(p){return arguments.length?(o=typeof p=="function"?p:qh(+p),h):o},h.paddingBottom=function(p){return arguments.length?(l=typeof p=="function"?p:qh(+p),h):l},h.paddingLeft=function(p){return arguments.length?(c=typeof p=="function"?p:qh(+p),h):c},h}var P_,rA;function pW(){if(rA)return P_;rA=1;var i=0,e=1,t=2,n=3;function r(a,o){return a+"§"+o}function s(){return .01*(.5-Math.random())}return P_=function(o,l){var c=o.margin,h=o.ratio,d=o.expansion,p=o.gridSize,m=o.speed,v,x,_,g,b,E,S=!0,w=l.length,T=w/n|0,R=new Float32Array(T),U=new Float32Array(T),A=1/0,D=1/0,L=-1/0,P=-1/0;for(v=0;v<w;v+=n)_=l[v+i],g=l[v+e],E=l[v+t]*h+c,A=Math.min(A,_-E),L=Math.max(L,_+E),D=Math.min(D,g-E),P=Math.max(P,g+E);var I=L-A,V=P-D,H=(A+L)/2,z=(D+P)/2;A=H-d*I/2,L=H+d*I/2,D=z-d*V/2,P=z+d*V/2;var O=new Array(p*p),B=O.length,G;for(G=0;G<B;G++)O[G]=[];var X,k,Y,Q,te,ee,ie,re,de,Ae;for(v=0;v<w;v+=n)for(_=l[v+i],g=l[v+e],E=l[v+t]*h+c,X=_-E,k=_+E,Y=g-E,Q=g+E,te=Math.floor(p*(X-A)/(L-A)),ee=Math.floor(p*(k-A)/(L-A)),ie=Math.floor(p*(Y-D)/(P-D)),re=Math.floor(p*(Q-D)/(P-D)),de=te;de<=ee;de++)for(Ae=ie;Ae<=re;Ae++)O[de*p+Ae].push(v);var Me,ve=new Set,fe,J,oe,se,$,pe,ye,xe,be,ue,He,W,F;for(G=0;G<B;G++)for(Me=O[G],v=0,b=Me.length;v<b;v++)for(fe=Me[v],oe=l[fe+i],$=l[fe+e],ye=l[fe+t],x=v+1;x<b;x++)J=Me[x],be=r(fe,J),!(B>1&&ve.has(be))&&(B>1&&ve.add(be),se=l[J+i],pe=l[J+e],xe=l[J+t],ue=se-oe,He=pe-$,W=Math.sqrt(ue*ue+He*He),F=W<ye*h+c+(xe*h+c),F&&(S=!1,J=J/n|0,W>0?(R[J]+=ue/W*(1+ye),U[J]+=He/W*(1+ye)):(R[J]+=I*s(),U[J]+=V*s())));for(v=0,x=0;v<w;v+=n,x++)l[v+i]+=R[x]*.1*m,l[v+e]+=U[x]*.1*m;return{converged:S}},P_}var hl={},sA;function mW(){if(sA)return hl;sA=1;var i=3;return hl.validateSettings=function(e){return"gridSize"in e&&typeof e.gridSize!="number"||e.gridSize<=0?{message:"the `gridSize` setting should be a positive number."}:"margin"in e&&typeof e.margin!="number"||e.margin<0?{message:"the `margin` setting should be 0 or a positive number."}:"expansion"in e&&typeof e.expansion!="number"||e.expansion<=0?{message:"the `expansion` setting should be a positive number."}:"ratio"in e&&typeof e.ratio!="number"||e.ratio<=0?{message:"the `ratio` setting should be a positive number."}:"speed"in e&&typeof e.speed!="number"||e.speed<=0?{message:"the `speed` setting should be a positive number."}:null},hl.graphToByteArray=function(e,t){var n=e.order,r=new Float32Array(n*i),s=0;return e.forEachNode(function(a,o){typeof t=="function"&&(o=t(a,o)),r[s]=o.x,r[s+1]=o.y,r[s+2]=o.size||1,s+=i}),r},hl.assignLayoutChanges=function(e,t,n){var r=0;e.forEachNode(function(s){var a={x:t[r],y:t[r+1]};typeof n=="function"&&(a=n(s,a)),e.mergeNodeAttributes(s,a),r+=i})},hl.collectLayoutChanges=function(e,t,n){var r={},s=0;return e.forEachNode(function(a){var o={x:t[s],y:t[s+1]};typeof n=="function"&&(o=n(a,o)),r[a]=o,s+=i}),r},hl.createWorker=function(t){var n=window.URL||window.webkitURL,r=t.toString(),s=n.createObjectURL(new Blob(["("+r+").call(this);"],{type:"text/javascript"})),a=new Worker(s);return n.revokeObjectURL(s),a},hl}var z_,aA;function gW(){return aA||(aA=1,z_={gridSize:20,margin:5,expansion:1.1,ratio:1,speed:3}),z_}var F_,oA;function vW(){if(oA)return F_;oA=1;var i=Aa(),e=pW(),t=mW(),n=gW(),r=500;function s(o,l,c){if(!i(l))throw new Error("graphology-layout-noverlap: the given graph is not a valid graphology instance.");typeof c=="number"?c={maxIterations:c}:c=c||{};var h=c.maxIterations||r;if(typeof h!="number"||h<=0)throw new Error("graphology-layout-force: you should provide a positive number of maximum iterations.");var d=Object.assign({},n,c.settings),p=t.validateSettings(d);if(p)throw new Error("graphology-layout-noverlap: "+p.message);var m=t.graphToByteArray(l,c.inputReducer),v=!1,x;for(x=0;x<h&&!v;x++)v=e(d,m).converged;if(o){t.assignLayoutChanges(l,m,c.outputReducer);return}return t.collectLayoutChanges(l,m,c.outputReducer)}var a=s.bind(null,!1);return a.assign=s.bind(null,!0),F_=a,F_}var yW=vW();const _W=mo(yW);var B_={exports:{}};var lA;function xW(){return lA||(lA=1,(function(i){(function(){var e={}.hasOwnProperty;function t(){for(var s="",a=0;a<arguments.length;a++){var o=arguments[a];o&&(s=r(s,n(o)))}return s}function n(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return t.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var a="";for(var o in s)e.call(s,o)&&s[o]&&(a=r(a,o));return a}function r(s,a){return a?s?s+" "+a:s+a:s}i.exports?(t.default=t,i.exports=t):window.classNames=t})()})(B_)),B_.exports}xW();(function(){try{if(typeof document<"u"){var i=document.createElement("style");i.appendChild(document.createTextNode(`._canvas_670zp_1 {
|
|
4084
4084
|
position: absolute;
|
|
4085
4085
|
top: 0;
|
|
4086
4086
|
left: 0;
|