@arcgis/core 4.34.0-next.89 → 4.34.0-next.90
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/applications/Components/featureUtils.d.ts +2 -0
- package/applications/Components/featureUtils.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{eada3483116a5ea8baed.js → 004c2a1a37b99a184b13.js} +1 -1
- package/assets/esri/core/workers/chunks/{23f54b49742098def8ae.js → 00ee2a605c30744f415a.js} +1 -1
- package/assets/esri/core/workers/chunks/024063fe2bbb27899094.js +1 -0
- package/assets/esri/core/workers/chunks/0271a2ca4e9b1e4fd284.js +1 -0
- package/assets/esri/core/workers/chunks/0328eaea66c1db98da1c.js +1 -0
- package/assets/esri/core/workers/chunks/04bac7bb3f794b33e2e4.js +1 -0
- package/assets/esri/core/workers/chunks/{8380a092ffc8e92ede7a.js → 05072093e0209ef5db20.js} +1 -1
- package/assets/esri/core/workers/chunks/{b53008c1461dd6bacc63.js → 06221ebadab32111e2c6.js} +1 -1
- package/assets/esri/core/workers/chunks/06aed0a5464965be8d52.js +1 -0
- package/assets/esri/core/workers/chunks/{67fdc8074cdcf374af9a.js → 07a7ca89ef2ca4fc090b.js} +1 -1
- package/assets/esri/core/workers/chunks/0810dbbf348a927392e7.js +1 -0
- package/assets/esri/core/workers/chunks/08374e5805fcedc1cb57.js +1 -0
- package/assets/esri/core/workers/chunks/0856cd281efd71bfe3c4.js +1 -0
- package/assets/esri/core/workers/chunks/08957e462d06c4dc8ab5.js +1 -0
- package/assets/esri/core/workers/chunks/0aaaf4d1c4a5d284216e.js +1 -0
- package/assets/esri/core/workers/chunks/{3c0990c4be06a2fd51e9.js → 0ca5060c81a1a05b8be3.js} +1 -1
- package/assets/esri/core/workers/chunks/0ceb68ff73e5d39e837a.js +1 -0
- package/assets/esri/core/workers/chunks/{998d164b3e0b99a0ff1e.js → 0e5e565df6ec71445f2e.js} +1 -1
- package/assets/esri/core/workers/chunks/0f4e9846d074864b39c2.js +1 -0
- package/assets/esri/core/workers/chunks/100a0041ee42b0b2fa32.js +1 -0
- package/assets/esri/core/workers/chunks/1194c2432c31def87db1.js +1 -0
- package/assets/esri/core/workers/chunks/{2896ada406074f754b00.js → 1214c126af0de25a4b4a.js} +1 -1
- package/assets/esri/core/workers/chunks/{978ffde9ebebf5c83aea.js → 14114be3afd6d292f89c.js} +1 -1
- package/assets/esri/core/workers/chunks/{4dd4b19c410026233999.js → 142c45ad68eecaf3fc7c.js} +1 -1
- package/assets/esri/core/workers/chunks/{2b2f1fcd50dea017d891.js → 147f6e7b147beaa4ed29.js} +1 -1
- package/assets/esri/core/workers/chunks/155dcbd957f8787a45c3.js +1 -0
- package/assets/esri/core/workers/chunks/{d5363e5637d37e89a25f.js → 18e9cb71fa020e93d139.js} +1 -1
- package/assets/esri/core/workers/chunks/19bd0b56d82446dbb7c5.js +1 -0
- package/assets/esri/core/workers/chunks/{96de78f9994207aa7201.js → 1bbc0dfad4cd72a1c42b.js} +1 -1
- package/assets/esri/core/workers/chunks/{914eaed113dda727eb47.js → 20988e116f3723228f36.js} +1 -1
- package/assets/esri/core/workers/chunks/{831a69e5a87e92830fbe.js → 21f37a4b8d1857369203.js} +1 -1
- package/assets/esri/core/workers/chunks/22c3a21bc9f32c429c48.js +1 -0
- package/assets/esri/core/workers/chunks/282c4f3484c605ce7d5e.js +1 -0
- package/assets/esri/core/workers/chunks/2870723d57aa7b885896.js +1 -0
- package/assets/esri/core/workers/chunks/28bb6896c5fd353ca5e9.js +1 -0
- package/assets/esri/core/workers/chunks/2b867cec6ada339f1c8f.js +1 -0
- package/assets/esri/core/workers/chunks/{709dc98379f4ce18a0b5.js → 31186e83fe009aa0fd36.js} +1 -1
- package/assets/esri/core/workers/chunks/{c779c8b98e07fa881c1d.js → 348c871657b0af621c33.js} +1 -1
- package/assets/esri/core/workers/chunks/35ca317490540fae437c.js +1 -0
- package/assets/esri/core/workers/chunks/{c5fe356fc5b8b7be0d31.js → 375f20f2e91d6a7507e8.js} +1 -1
- package/assets/esri/core/workers/chunks/3807d0b9b1894731174d.js +1 -0
- package/assets/esri/core/workers/chunks/38d874d7f815f5329420.js +1 -0
- package/assets/esri/core/workers/chunks/393274af1804e5b6046a.js +1 -0
- package/assets/esri/core/workers/chunks/3c3b1dc95f03082e4d5b.js +1 -0
- package/assets/esri/core/workers/chunks/3dcdbba706a8034b6ba3.js +1 -0
- package/assets/esri/core/workers/chunks/{834985ec601623df34a1.js → 3e11a893271caa11a881.js} +1 -1
- package/assets/esri/core/workers/chunks/4133ab8720e7e4afa9a6.js +1 -0
- package/assets/esri/core/workers/chunks/{b246ed6d86c2c8df56fb.js → 41f275401e1cde7eee20.js} +1 -1
- package/assets/esri/core/workers/chunks/{595593dd03bcfba795c8.js → 4660798b3b45dcb5cecb.js} +2 -2
- package/assets/esri/core/workers/chunks/{69ae235423f0b1bdfcb4.js → 48c8ef4170e803a564d6.js} +1 -1
- package/assets/esri/core/workers/chunks/{c90830ee562b5ddc4f8b.js → 49e6219dd08cb6c27023.js} +1 -1
- package/assets/esri/core/workers/chunks/{00bbd37910c70989b54d.js → 4d0e099f34639cda3a9b.js} +1 -1
- package/assets/esri/core/workers/chunks/4d807bfe75108438db83.js +1 -0
- package/assets/esri/core/workers/chunks/{d1fc2c6e95fe2572d297.js → 50d9f69d5255af4b29bb.js} +1 -1
- package/assets/esri/core/workers/chunks/{300b96f0f8e34b4a5d8b.js → 56de25a6fe659a5b5c2b.js} +1 -1
- package/assets/esri/core/workers/chunks/57c08ccb75e3135978d1.js +1 -0
- package/assets/esri/core/workers/chunks/5ad1985a9e66fb2232ae.js +1 -0
- package/assets/esri/core/workers/chunks/{d8494617cebc68e50d35.js → 5b7a2ee44883b1fb2a5f.js} +1 -1
- package/assets/esri/core/workers/chunks/5caf49e679ed0c27e0bd.js +1 -0
- package/assets/esri/core/workers/chunks/{f5c821ca2911a5103c9a.js → 5d15ca055071d7db6de8.js} +1 -1
- package/assets/esri/core/workers/chunks/{59139347495988b19061.js → 61a9ffd4cf07d8bb7a9b.js} +1 -1
- package/assets/esri/core/workers/chunks/61e8e159f1f336569b27.js +1 -0
- package/assets/esri/core/workers/chunks/{88b8f33ce1cbf8a0f855.js → 633faa9cec8988ab06af.js} +4 -4
- package/assets/esri/core/workers/chunks/648c91a9822bc9d6ee47.js +1 -0
- package/assets/esri/core/workers/chunks/6aa349e1adf844df4b5b.js +1 -0
- package/assets/esri/core/workers/chunks/{d2371f5034b2a32e2523.js → 6cfa0967045068ce8a8b.js} +1 -1
- package/assets/esri/core/workers/chunks/{28d30be414e59eabd963.js → 70c8f69eed14d55c5cf6.js} +1 -1
- package/assets/esri/core/workers/chunks/{fdc8300b6374ef2b8b3e.js → 74881340e040bfd0580f.js} +1 -1
- package/assets/esri/core/workers/chunks/{8be81e1530b952c97936.js → 768ae52b4e5c3e571ef5.js} +1 -1
- package/assets/esri/core/workers/chunks/{b43473e84b3f7fa2634d.js → 77e611724a499d36eacc.js} +1 -1
- package/assets/esri/core/workers/chunks/7f8b85de079614b9c336.js +1 -0
- package/assets/esri/core/workers/chunks/{9280edff80fd87860a5e.js → 80a155496deef2c02a3e.js} +1 -1
- package/assets/esri/core/workers/chunks/{7db105f6b688b6da8106.js → 82ba4140e30f083fbc87.js} +1 -1
- package/assets/esri/core/workers/chunks/{672c04d48aa51f16e9b7.js → 8a6052b4d163d5088e11.js} +1 -1
- package/assets/esri/core/workers/chunks/{5b35b30495145bf8dd5d.js → 8ff2daef892881ff2019.js} +1 -1
- package/assets/esri/core/workers/chunks/9a855a10798348a21bab.js +1 -0
- package/assets/esri/core/workers/chunks/9bb6984f24cd5461a754.js +1 -0
- package/assets/esri/core/workers/chunks/9d9a639f7388a29e7c96.js +1 -0
- package/assets/esri/core/workers/chunks/{813efde41e90e652b7db.js → 9f2a3f37fe9b19ef1209.js} +1 -1
- package/assets/esri/core/workers/chunks/a1a7b0e7ca488c895cb7.js +1 -0
- package/assets/esri/core/workers/chunks/a6a2d4602dfeb62e0ecc.js +1 -0
- package/assets/esri/core/workers/chunks/{d3fd11da3a823e148957.js → ab88577987cf2fe1cb32.js} +1 -1
- package/assets/esri/core/workers/chunks/{a6767d75e718f2e1e714.js → ad9606164c694af0c61f.js} +1 -1
- package/assets/esri/core/workers/chunks/b18887a6dc86f0c8324a.js +1 -0
- package/assets/esri/core/workers/chunks/b240298b8b643a323d34.js +1 -0
- package/assets/esri/core/workers/chunks/{481c2b01e2fe92249698.js → b265472ac3f949a7f40c.js} +1 -1
- package/assets/esri/core/workers/chunks/b47f26d6aa9a2848a677.js +1 -0
- package/assets/esri/core/workers/chunks/{4094cebc4b92c52f4e27.js → b48abbf877e26ed1a4f8.js} +1 -1
- package/assets/esri/core/workers/chunks/b510c07dfd0d31683b08.js +1 -0
- package/assets/esri/core/workers/chunks/b661ea374fe38c8e29ca.js +1 -0
- package/assets/esri/core/workers/chunks/b8f55ee77ab6ea4c289e.js +1 -0
- package/assets/esri/core/workers/chunks/{ccd157ede169b93eea65.js → bb0a1be03bb9d621432c.js} +1 -1
- package/assets/esri/core/workers/chunks/{fdae43a97537093e4b97.js → bdf0ab95401c6d8fbc7d.js} +1 -1
- package/assets/esri/core/workers/chunks/c20862fe15295a294bbd.js +1 -0
- package/assets/esri/core/workers/chunks/{365d63c2aed3a49918f2.js → c27783ce7ea51a5e49c5.js} +1 -1
- package/assets/esri/core/workers/chunks/{ce937ff0dd1147ea297e.js → c3020747f9001ca6a6e7.js} +1 -1
- package/assets/esri/core/workers/chunks/{516864fb68025acc7db6.js → c547692862df95d22818.js} +1 -1
- package/assets/esri/core/workers/chunks/c5c6a32a24005478c976.js +1 -0
- package/assets/esri/core/workers/chunks/{e4acc3c2b6d865ed1940.js → c7c76a8a1c47eb62bef1.js} +1 -1
- package/assets/esri/core/workers/chunks/{58422c616a824ab49218.js → c84665db250b05e2829d.js} +1 -1
- package/assets/esri/core/workers/chunks/cb6a9b43406f4fbe10b2.js +1 -0
- package/assets/esri/core/workers/chunks/{cef9ff811221a7c3812c.js → cb90cfa35d77ab561939.js} +1 -1
- package/assets/esri/core/workers/chunks/ced12ad98f8f48d0dc00.js +1 -0
- package/assets/esri/core/workers/chunks/{bd451668c4ce9f7d7128.js → d56548a994753b08403c.js} +1 -1
- package/assets/esri/core/workers/chunks/{251b7f2e295ce191eb62.js → da4163b4f9b34e83c92d.js} +1 -1
- package/assets/esri/core/workers/chunks/{43fba9d6be5971ec20a9.js → e0017c6739d2532793e6.js} +1 -1
- package/assets/esri/core/workers/chunks/e22b400636094fc7b6c0.js +1 -0
- package/assets/esri/core/workers/chunks/{0296ebe8e37e30af771c.js → e2fdc4dc1ab9decd731e.js} +1 -1
- package/assets/esri/core/workers/chunks/e34136ad9d620cb845fd.js +1 -0
- package/assets/esri/core/workers/chunks/e537e1d37f3fcb14fce2.js +1 -0
- package/assets/esri/core/workers/chunks/e5baa30944061418cb13.js +1 -0
- package/assets/esri/core/workers/chunks/edef1e2254c992459c63.js +1 -0
- package/assets/esri/core/workers/chunks/{109149c378aa4c5f8526.js → eea9d49d55c2d1355497.js} +1 -1
- package/assets/esri/core/workers/chunks/{3245663da75e168bf85c.js → ef75cad6570b14a42b62.js} +1 -1
- package/assets/esri/core/workers/chunks/{2a2a925c45d5fd58628b.js → f3284d4e0d41efb0b4a0.js} +1 -1
- package/assets/esri/core/workers/chunks/f62717338075df626eda.js +1 -0
- package/assets/esri/core/workers/chunks/{d07d3b0e06f12aee4a8b.js → f6ce485c082d0d640b01.js} +1 -1
- package/assets/esri/core/workers/chunks/fb6ebb780bb59e252887.js +1 -0
- package/assets/esri/core/workers/chunks/{69e6000044bfb03776ac.js → fd34c033ce7f16835368.js} +1 -1
- package/assets/esri/core/workers/chunks/fdadf11f31384c09db9f.js +1 -0
- package/assets/esri/core/workers/chunks/{80bd5988180f4618fd61.js → ff6d189ba78980d40bb5.js} +1 -1
- package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
- package/assets/esri/widgets/Sketch/t9n/Sketch_ar.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_bg.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_bs.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ca.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_cs.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_da.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_de.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_el.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_es.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_et.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_fi.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_fr.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_he.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_hr.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_hu.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_id.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_it.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ja.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ko.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_lt.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_lv.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_nl.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_no.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_pl.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_pt-BR.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_pt-PT.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ro.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ru.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_sk.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_sl.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_sr.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_sv.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_th.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_tr.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_uk.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_vi.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_zh-CN.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_zh-HK.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_zh-TW.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_ar.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_bg.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_bs.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_ca.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_cs.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_da.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_de.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_el.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_es.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_et.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_fi.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_fr.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_he.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_hr.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_hu.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_id.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_it.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_ja.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_ko.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_lt.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_lv.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_nl.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_no.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_pl.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_pt-BR.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_pt-PT.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_ro.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_ru.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_sk.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_sl.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_sr.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_sv.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_th.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_tr.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_uk.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_vi.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_zh-CN.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_zh-HK.json +1 -1
- package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_zh-TW.json +1 -1
- package/chunks/Bufferer-Dw9Qi4T1.js +1 -1
- package/chunks/Distance2DCalculator-CXhBP-8I.js +1 -1
- package/chunks/GaussianSplat.glsl.js +2 -2
- package/chunks/GeodeticDistanceCalculator-Ce-woMPw.js +1 -1
- package/chunks/GeodeticUtils.js +1 -1
- package/chunks/GlowBlur.glsl.js +5 -5
- package/chunks/MultiPathImpl.js +1 -1
- package/chunks/OITBlend.glsl.js +9 -7
- package/chunks/OperatorCrosses.js +1 -1
- package/chunks/OperatorCut.js +1 -1
- package/chunks/OperatorGeodesicBuffer.js +1 -1
- package/chunks/OperatorGeodeticArea.js +1 -1
- package/chunks/OperatorGeodeticDensifyByLength.js +1 -1
- package/chunks/OperatorGeodeticLength.js +1 -1
- package/chunks/OperatorIntersects.js +1 -1
- package/chunks/OperatorMultiPartToSinglePart.js +1 -1
- package/chunks/OperatorOverlaps.js +1 -1
- package/chunks/OperatorProximity.js +1 -1
- package/chunks/OperatorProximityGeodesic.js +1 -1
- package/chunks/OperatorShapePreservingLength.js +1 -1
- package/chunks/OperatorShapePreservingProject.js +1 -1
- package/chunks/OperatorSimplifyOGC.js +1 -1
- package/chunks/OperatorTouches.js +1 -1
- package/chunks/OperatorWithin.js +1 -1
- package/chunks/Point2D.js +1 -1
- package/chunks/ProjectionTransformation.js +1 -1
- package/chunks/SideCalculator2D-BNwb5gvz.js +1 -1
- package/chunks/UnitFactory.js +1 -1
- package/chunks/containsOperator.js +1 -1
- package/chunks/disjointOperator.js +1 -1
- package/chunks/equalsOperator.js +1 -1
- package/chunks/relateOperator.js +1 -1
- package/config.js +1 -1
- package/geohash/geohashUtils.js +1 -1
- package/geometry/operators/gx/operatorAutoComplete.js +1 -1
- package/geometry/operators/gx/operatorBuffer.js +1 -1
- package/geometry/operators/gx/operatorDifference.js +1 -1
- package/geometry/operators/gx/operatorGraphicBuffer.js +1 -1
- package/geometry/operators/gx/operatorIntegrate.js +1 -1
- package/geometry/operators/gx/operatorIntersection.js +1 -1
- package/geometry/operators/gx/operatorLabelPoint.js +1 -1
- package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
- package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
- package/geometry/operators/gx/operatorSimplify.js +1 -1
- package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
- package/geometry/operators/gx/operatorUnion.js +1 -1
- package/geometry/operators/json/containsOperator.js +1 -1
- package/geometry/operators/json/disjointOperator.js +1 -1
- package/geometry/operators/json/projectOperator.js +5 -0
- package/geometry/operators/projectOperator.js +1 -1
- package/geometry/operators/reshapeOperator.js +1 -1
- package/geometry/operators/shapePreservingProjectOperator.js +1 -1
- package/geometry/operators/support/geographicTransformationUtils.js +1 -1
- package/geometry/operators/support/initNoPeFactory.js +1 -1
- package/geometry/operators/support/jsonConverter.js +1 -1
- package/geometry/operators/support/projectionTransformation.js +5 -0
- package/geometry/projectionUtils.js +1 -1
- package/geometry/support/GeographicTransformation.js +1 -1
- package/geometry/support/GeographicTransformationStep.js +1 -1
- package/interfaces.d.ts +359 -0
- package/intl/date.js +1 -1
- package/kernel.js +1 -1
- package/layers/graphics/data/QueryEngine.js +1 -1
- package/layers/graphics/data/projectionSupport.js +1 -1
- package/layers/graphics/data/queryUtils.js +1 -1
- package/layers/graphics/sources/support/CSVSourceWorker.js +1 -1
- package/layers/support/DateTimeFieldFormat.d.ts +4 -0
- package/layers/support/FieldConfiguration.d.ts +4 -0
- package/layers/support/NumberFieldFormat.d.ts +4 -0
- package/layers/support/vectorTileLayerLoader.js +1 -1
- package/package.json +2 -2
- package/support/revision.js +1 -1
- package/views/2d/engine/flow/dataUtils.js +1 -1
- package/views/2d/engine/flow/utils.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementError.d.ts +4 -0
- package/views/3d/{support/flow/VisualQuery3D.js → analysis/VolumeMeasurement/VolumeMeasurementError.js} +1 -1
- package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/state/ViewState.js +1 -1
- package/views/3d/state/controllers/SurfaceCollisionCorrectionController.js +1 -1
- package/views/3d/support/DisplayQualityProfile.js +1 -1
- package/views/3d/support/QualitySettings.js +1 -1
- package/views/3d/support/flow/FlowQuery3D.js +5 -0
- package/views/3d/support/flow/FlowSubViewExtent3D.js +1 -1
- package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
- package/views/3d/support/flow/FlowWorker.js +1 -1
- package/views/3d/support/flow/StreamlineResources3D.js +1 -1
- package/views/3d/support/flow/geometryUtils.js +1 -1
- package/views/3d/support/flow/loadUtils.js +1 -1
- package/views/3d/support/pointsOfInterest/StableSurfaceCenter.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +2 -2
- package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/OITBlendTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/OITBlendTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/lib/CutFillColor.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/webgl/enums.js +1 -1
- package/views/webgl/renderState.js +1 -1
- package/webmap/utils.js +1 -1
- package/widgets/Editor/Upload.js +1 -1
- package/widgets/FeatureTable/FieldColumn.js +1 -1
- package/widgets/FeatureTable/support/tableUtils.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/assets/esri/core/workers/chunks/0103b70126bc5dffc55e.js +0 -1
- package/assets/esri/core/workers/chunks/03ef19f0753d68770444.js +0 -1
- package/assets/esri/core/workers/chunks/050429f516149ce3b517.js +0 -1
- package/assets/esri/core/workers/chunks/09f1a27442bdd52cdeb7.js +0 -1
- package/assets/esri/core/workers/chunks/0fadd1defbb6743dacdc.js +0 -1
- package/assets/esri/core/workers/chunks/124f8757ea18bfd158ec.js +0 -1
- package/assets/esri/core/workers/chunks/135142f3cbfaf24949bc.js +0 -1
- package/assets/esri/core/workers/chunks/138c11b5eca621e51396.js +0 -1
- package/assets/esri/core/workers/chunks/14743a962e661babe0a4.js +0 -1
- package/assets/esri/core/workers/chunks/1bf17c6548ac4cd5a166.js +0 -1
- package/assets/esri/core/workers/chunks/1d9212a70df68a508dca.js +0 -1
- package/assets/esri/core/workers/chunks/213e82a7e3fa5b253ec1.js +0 -1
- package/assets/esri/core/workers/chunks/3b23c37e5bc552dc81d4.js +0 -1
- package/assets/esri/core/workers/chunks/3d68a650a1f944ec5171.js +0 -1
- package/assets/esri/core/workers/chunks/451555af283b32a10fef.js +0 -1
- package/assets/esri/core/workers/chunks/48913b944c28343816ac.js +0 -1
- package/assets/esri/core/workers/chunks/4e6e8dda6c12f6fbed8e.js +0 -1
- package/assets/esri/core/workers/chunks/4e77b9cc1d9437bcbb0c.js +0 -1
- package/assets/esri/core/workers/chunks/5019f1b8186a65a0313b.js +0 -1
- package/assets/esri/core/workers/chunks/547af4ffbeeccba9d187.js +0 -1
- package/assets/esri/core/workers/chunks/589a0e244ef5f1b84ab6.js +0 -1
- package/assets/esri/core/workers/chunks/59e27818cb68f0285d54.js +0 -1
- package/assets/esri/core/workers/chunks/5e1d6704ee0aa41b1d06.js +0 -1
- package/assets/esri/core/workers/chunks/6b0baecbd35d26393dcf.js +0 -1
- package/assets/esri/core/workers/chunks/6dafb2b95bae552c1cc2.js +0 -1
- package/assets/esri/core/workers/chunks/71df48968d6cdc736458.js +0 -1
- package/assets/esri/core/workers/chunks/773d106f60f7dad1493d.js +0 -1
- package/assets/esri/core/workers/chunks/79c4f10da8360ee60cd2.js +0 -1
- package/assets/esri/core/workers/chunks/7aa7aff6d42be7c2d1d2.js +0 -1
- package/assets/esri/core/workers/chunks/82404ff7c298493ff6f4.js +0 -1
- package/assets/esri/core/workers/chunks/84a556dafd583635ad5e.js +0 -1
- package/assets/esri/core/workers/chunks/885a398de8a33d36c59e.js +0 -1
- package/assets/esri/core/workers/chunks/8bd6c27a93a697a7fa3d.js +0 -1
- package/assets/esri/core/workers/chunks/8be9fa12e854a83062c3.js +0 -1
- package/assets/esri/core/workers/chunks/9386a0ebff78b6303ed2.js +0 -1
- package/assets/esri/core/workers/chunks/9673e25114fc1897460d.js +0 -1
- package/assets/esri/core/workers/chunks/96a14689815bec741308.js +0 -1
- package/assets/esri/core/workers/chunks/977582cb3c8f17a2cb4c.js +0 -1
- package/assets/esri/core/workers/chunks/97d71459ad72b4b780a3.js +0 -1
- package/assets/esri/core/workers/chunks/a1abe9865d66789bd5af.js +0 -1
- package/assets/esri/core/workers/chunks/a7ea2e3895046e566bc6.js +0 -1
- package/assets/esri/core/workers/chunks/a96e58ed9a4a2329ee53.js +0 -1
- package/assets/esri/core/workers/chunks/aa778e5d7db40d9b9b4a.js +0 -1
- package/assets/esri/core/workers/chunks/acb49f3d2b783e81a215.js +0 -1
- package/assets/esri/core/workers/chunks/b0a03b6edbcf6e933431.js +0 -1
- package/assets/esri/core/workers/chunks/bc83bcfe123525d21884.js +0 -1
- package/assets/esri/core/workers/chunks/bd028badc07270eda3d0.js +0 -1
- package/assets/esri/core/workers/chunks/be8dd8e68c8805300ad1.js +0 -1
- package/assets/esri/core/workers/chunks/c1d75c48558ed23c5b2b.js +0 -1
- package/assets/esri/core/workers/chunks/c24214666d10cb648428.js +0 -1
- package/assets/esri/core/workers/chunks/c3010d783506f8410f99.js +0 -1
- package/assets/esri/core/workers/chunks/d0296368ae143de4d5ce.js +0 -1
- package/assets/esri/core/workers/chunks/d51aabb9b950f49df183.js +0 -1
- package/assets/esri/core/workers/chunks/d8a0eb143b2079d7b6b7.js +0 -1
- package/assets/esri/core/workers/chunks/dca2b487152cde45fb65.js +0 -1
- package/assets/esri/core/workers/chunks/e760b8ca64d67c04d98a.js +0 -1
- package/assets/esri/core/workers/chunks/ee78a38a0cacb19b2fd4.js +0 -1
- package/assets/esri/core/workers/chunks/f5710ced8d38f9a90fc5.js +0 -1
- package/assets/esri/core/workers/chunks/f592c4e5e1746d4619db.js +0 -1
- package/assets/esri/core/workers/chunks/f8d2c52cc51d5f1bbce2.js +0 -1
- package/assets/esri/core/workers/chunks/f9decc88561c03aca3c9.js +0 -1
- package/assets/esri/core/workers/chunks/fd1fdb97a294a1b7041d.js +0 -1
- package/assets/esri/core/workers/chunks/ffee8cc83d703c1dc0c0.js +0 -1
- package/chunks/CompositeGeographicTransformation.js +0 -5
- package/chunks/GeographicTransformation.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{G as t}from"./SimpleGeometryCursor.js";import{a as e,c as s,o as i,p as n,g as o,G as r,f as h,h as m,t as a}from"./Geometry.js";import{E as c,P as l}from"./Envelope.js";import{Envelope2D as u}from"./Envelope2D.js";import{P as f,S as g,L as _}from"./MultiPathImpl.js";import{p as d,P as p,d as P}from"./Point2D.js";import{T}from"./Transformation2D.js";import{O as b,J as D,I as S,H as I,a7 as x,aH as F,L as C,R as N,Q as y,V as w,U as E,af as G,aI as v,ae as z}from"./UnitFactory.js";import{c as k}from"./OperatorClip.js";function q(t){const e=t.getInputSR(),s=t.getOutputSR();let i=!1;do{if(e.equals(s)){i=!1;break}if(!O(e)||!O(s)){i=!1;break}if(2===e.getCoordinateSystemType()){i=!0;break}if(2===s.getCoordinateSystemType()){i=!0;break}const n=t.getGeographicTransformations();if(null!==n&&n.count()>0){i=!0;break}}while(0);return i}class L{constructor(t,e,s,i){this.m_horizon2Env=new u,this.m_horizon2=t,this.m_sr=e,this.m_bInclusive2=s,this.m_pannableExtent=i.clone(),this.m_segIter=null,this.m_qtIter=null,null!==t?(t.queryEnvelope(this.m_horizon2Env),this.m_gcs360=i.width(),this.m_gcs180=.5*this.m_gcs360,this.m_gcs90=.25*this.m_gcs360,this.m_pannableFactor=1,this.m_horizon2Env.width()-this.m_gcs360>0&&(this.m_pannableFactor+=Math.ceil((this.m_horizon2Env.width()-this.m_gcs360)/this.m_gcs360)),this.m_period=this.m_gcs360):(this.m_horizon2Env.setEmpty(),this.m_gcs360=Number.NaN,this.m_gcs180=Number.NaN,this.m_gcs90=Number.NaN,this.m_pannableFactor=Number.NaN,this.m_period=Number.NaN),this.m_gcsTolerance=null!=e?e.getTolerance(0):Number.NaN}isPointStartInHorizon(t,e){if(!this.m_horizon2)return!0;let s=nt(new l(t),this.m_horizon2,!0,this.m_period);do{const e=t.clone();if(e.x-=s*this.m_period,this.m_horizon2.getGeometryType()===r.enumPolygon){let t;if(t=this.m_horizon2Env.contains(e)?N(this.m_horizon2,e,0):0,this.m_bInclusive2){if(0===t)return!1}else if(1===t)return!1}else{const t=this.m_horizon2Env.contains(e);if(this.m_bInclusive2){if(!t)return!1}else if(t)return!1}}while(this.m_horizon2Env.xmin+ ++s*this.m_period<t.x);return!0}isAdjoiningLineInHorizon(t,e,s){if(!this.m_horizon2)return!0;const i=new p,n=new p;rt(t,e,this.m_gcs90,this.m_gcs180,this.m_gcs360,i,n);const h=Math.max(i.x,n.x),m=new _;m.setStart2D(i),m.setEnd2D(n);let a=nt(m,this.m_horizon2,!0,this.m_period);const c=!1;do{const t=i.clone(),e=n.clone();if(t.x-=a*this.m_period,e.x-=a*this.m_period,this.m_horizon2.getGeometryType()===r.enumPolygon){const s=new _;s.setStartXY(t),s.setEndXY(e);const i=new u,n=new u;if(s.queryEnvelope(i),n.setCoords({env2D:i}),n.inflateCoords(this.m_gcsTolerance,this.m_gcsTolerance),this.m_horizon2Env.isIntersecting(n)){const t=this.m_horizon2.getImpl(),e=t.getAccelerators();if(null!==e){null!==e.getRasterizedGeometry()&&o(0)}{let i=null;if(null!==e&&(i=e.getQuadTree()),null!==i){this.m_qtIter||(this.m_qtIter=i.getIteratorForQT()),this.m_qtIter.resetIterator(s,this.m_gcsTolerance),this.m_segIter||(this.m_segIter=t.querySegmentIterator());for(let t=this.m_qtIter.next();-1!==t;t=this.m_qtIter.next()){const e=i.getElement(t);this.m_segIter.resetToVertex(e,-1);if(this.m_segIter.nextSegment().isIntersecting(s,this.m_gcsTolerance))return!1}}else for(this.m_segIter||(this.m_segIter=t.querySegmentIterator()),this.m_segIter.resetToFirstPath();this.m_segIter.nextPath();)for(;this.m_segIter.hasNextSegment();){const t=this.m_segIter.nextSegment(),e=new u;if(t.queryEnvelope(e),e.isIntersecting(n)&&t.isIntersecting(s,this.m_gcsTolerance))return!1}}}}else if(this.m_bInclusive2){const s=this.m_horizon2Env.contains(t),i=this.m_horizon2Env.contains(e);if(s&&i)return!0}else{const s=this.m_horizon2Env.clone();s.inflateCoords(this.m_gcsTolerance,this.m_gcsTolerance);if(!(0===s.clipLine(t,e)))return!1}}while(this.m_horizon2Env.xmin+ ++a*this.m_period<h);return!this.m_bInclusive2||c}isEnvelopeInHorizon(t,e){if(!this.m_horizon2)return!0;const s=new c({env2D:t});let i=nt(s,this.m_horizon2,!0,this.m_period);do{const n=t.clone();n.move(-i*this.m_period,0),s.setCoords(n.xmin,n.ymin,n.xmax,n.ymax);if(!st(s,this.m_horizon2,this.m_sr,this.m_bInclusive2,e))return!1}while(this.m_horizon2Env.xmin+ ++i*this.m_period<t.xmax);return!0}}class R{constructor(t,e,s){this.m_splitLines2=null,this.m_scalars=[],this.m_splitIter=null,this.m_splitLines2=t,this.m_transform1=e,this.m_pannableExtent=s.clone(),this.m_gcs360=s.width(),this.m_gcs180=.5*this.m_gcs360,this.m_gcs90=.25*this.m_gcs360,null!==e?(this.m_gcsTolerance=this.m_transform1.getOutputSR().getTolerance(0),this.m_halfGcsTolerance=.5*this.m_gcsTolerance,this.m_gcsToleranceSq=this.m_gcsTolerance*this.m_gcsTolerance):(this.m_gcsTolerance=Number.NaN,this.m_halfGcsTolerance=Number.NaN,this.m_gcsToleranceSq=Number.NaN)}hasSplitLines(){return null!=this.m_splitLines2}getSplitLineFactorEx(t,e,s,i,n,o){const r=new p,h=new p;rt(i,n,this.m_gcs90,this.m_gcs180,this.m_gcs360,r,h);const m=new _;for(m.setStartXY(r),m.setEndXY(h),this.m_splitIter?this.m_splitIter.resetToFirstPath():this.m_splitIter=this.m_splitLines2.getImpl().querySegmentIterator();this.m_splitIter.nextPath();)for(;this.m_splitIter.hasNextSegment();){const i=this.m_splitIter.nextSegment(),n=.5*(i.getStartX()+i.getEndX());Z(this.m_gcs180,this.m_gcs360,n,m);const r=new u;m.queryEnvelope(r),r.inflateCoords(this.m_gcsTolerance,this.m_gcsTolerance);const h=new u;if(i.queryEnvelope(h),!r.isIntersecting(h))continue;this.m_scalars.length<2&&(this.m_scalars.length=2);if(1===m.intersect(i,null,this.m_scalars,null,this.m_gcsTolerance)&&(this.m_scalars[0]>0&&this.m_scalars[0]<1)){const n=ct(e,s,this.m_scalars[0]),r=Q(t.getCoord2D(n),this.m_transform1);if(i.isIntersectingPoint(r,this.m_halfGcsTolerance))return n;return this.getSplitLineFactor(t,e,s,i,o)}}return-1}getSplitLineFactor(t,e,s,i,n){let o=e,r=s;const h=.5*(i.getStartX()+i.getEndX()),m=new _,a=t.getCoord2D(o),c=t.getCoord2D(r),l=Q(a,this.m_transform1),u=Q(c,this.m_transform1);for(;o<r;){const e=new p,s=new p;rt(l,u,this.m_gcs90,this.m_gcs180,this.m_gcs360,e,s),m.setStartXY(e),m.setEndXY(s),Z(this.m_gcs180,this.m_gcs360,h,m);const n=p.sqrDistance(m.getStartXY(),m.getEndXY());if(n<=this.m_gcsToleranceSq)break;if(Number.isNaN(n))return Number.NaN;let f=ct(o,r,this.m_scalars[0]);if(o<f&&f<r||(f=.5*(r+o)),o===f||f===r)return f;const g=t.getCoord2D(f),_=Q(g,this.m_transform1),d=new p;rt(l,_,this.m_gcs90,this.m_gcs180,this.m_gcs360,e,d),m.setStartXY(e),m.setEndXY(d),Z(this.m_gcs180,this.m_gcs360,h,m);let P=m.intersect(i,null,this.m_scalars,null,this.m_halfGcsTolerance);if(0!==P){if(1===this.m_scalars[0])return f;r=f,c.setCoordsPoint2D(g),u.setCoordsPoint2D(_)}else{if(rt(_,u,this.m_gcs90,this.m_gcs180,this.m_gcs360,d,s),m.setStartXY(d),m.setEndXY(s),Z(this.m_gcs180,this.m_gcs360,h,m),P=m.intersect(i,null,this.m_scalars,null,this.m_halfGcsTolerance),0===P)return f;if(0===this.m_scalars[0])return f;o=f,a.setCoordsPoint2D(g),l.setCoordsPoint2D(_)}}return.5*(r+o)}}class M{constructor(){this.m_bPrepared=!1,this.m_bNeedsShapePreservingProject=!1,this.m_inputTransform=null,this.m_transform1=null,this.m_transform2=null,this.m_extentFrom=null,this.m_horizon1=null,this.m_horizon2=null,this.m_pannableExtentFrom=new u,this.m_pannableExtentTo=new u,this.m_pannableExtentGcsTo=new u,this.m_bClipTopBottomFrom=!1,this.m_bNeedsGeoTransform=!1,this.m_bIsPannableFrom=!1,this.m_bIsPannableTo=!1,this.m_bInclusive1=!1,this.m_bInclusive2=!1,this.m_bSrFromIsPcs=!1,this.m_bSrToIsPcs=!1,this.m_fromTolerance=Number.NaN,this.m_toTolerance=Number.NaN,this.m_gcsToTolerance=Number.NaN,this.m_aFrom=Number.NaN,this.m_mpuFrom=Number.NaN,this.m_rpuFrom=Number.NaN,this.m_rpuGcsTo=Number.NaN,this.m_aTo=Number.NaN,this.m_mpuTo=Number.NaN,this.m_stages=0}prepare(t,s,i){this.m_bPrepared&&n(""),t||e("");const r=t.getInputSR(),h=t.getOutputSR();O(r)&&O(h)||e("shape preserving project requires PCS or GCS");const m=r.getCoordinateSystemType(),a=h.getCoordinateSystemType();this.m_bSrFromIsPcs=2===m,this.m_bSrToIsPcs=2===a;let c=null,l=null,u=null,f=null;this.m_bSrFromIsPcs?(c=r,u=r.getGCS(),this.m_aFrom=at(u),this.m_mpuFrom=mt(c),this.m_rpuFrom=Number.NaN):(u=r,this.m_rpuFrom=ht(u),this.m_aFrom=Number.NaN),this.m_bSrToIsPcs?(l=h,f=h.getGCS(),this.m_aTo=at(f),this.m_mpuTo=mt(l)):(f=h,this.m_aTo=Number.NaN,this.m_mpuTo=Number.NaN),this.m_rpuGcsTo=ht(f);const g=t.getGeographicTransformations();this.m_bNeedsGeoTransform=null!==g&&g.count()>0;const _=r.equals(h);if(this.m_bNeedsShapePreservingProject=!_&&(this.m_bSrFromIsPcs||this.m_bSrToIsPcs||this.m_bNeedsGeoTransform),!this.m_bNeedsShapePreservingProject)return this.m_inputTransform=t,this.m_extentFrom=s?s.clone():null,void(this.m_bPrepared=!0);if(this.m_bIsPannableFrom=r.isPannable(),this.m_bIsPannableTo=h.isPannable(),this.m_bIsPannableFrom&&(this.m_pannableExtentFrom=r.getPannableExtent()),this.m_bIsPannableTo&&(this.m_pannableExtentTo=h.getPannableExtent()),this.m_bSrToIsPcs){this.m_pannableExtentGcsTo=f.getPannableExtent();const t=l.getCentralMeridian(),e=this.m_pannableExtentGcsTo.getCenter();e.x=t,this.m_pannableExtentGcsTo.centerAt(e)}else this.m_pannableExtentGcsTo=this.m_pannableExtentTo.clone();this.m_fromTolerance=r.getTolerance(0),this.m_toTolerance=h.getTolerance(0),this.m_gcsToTolerance=f.getTolerance(0);{const e=t.getExtendedParams(),n=e.clipWithInputHorizon,o=e.clipWithOutputHorizon;n&&this.setHorizon1(t,s,i),o&&this.setHorizon2(t,i),this.checkAndSetStages(t,i)}const d=D();d.setFlag(1073741824,!0),d.setFlag(536870912,!0);const p=S();if(p.clipWithInputHorizon=!1,p.clipWithOutputHorizon=!1,1===this.m_stages)this.m_transform1=I(!1,r,h,g,p,d);else if(2===this.m_stages){d.setFlag(2147483648,!0),this.m_transform1=I(!1,r,f,g,p,d);const t=D();this.m_transform2=I(!1,f,h,null,p,t)}else{o(null!=l),p.centralMeridianOfOutputGCS=l.getCentralMeridian(),this.m_transform1=I(!1,r,f,g,p,d);const t=D();t.setFlag(2147483648,!0),this.m_transform2=I(!1,f,h,null,p,t)}this.m_inputTransform=t,this.m_extentFrom=s?s.clone():null,this.m_bPrepared=!0}execute(t,e,s,i){this.m_bPrepared||n(""),o(!t.hasAttribute(10));return this.execute_(t,e,s,i)}checkIfNeedsReset(t,e){return o(0),!1}setHorizon1(t,e,s){const i=t.getInputSR();let n,o=null;const r=new u;if(this.m_bSrFromIsPcs){n=!0,o=i.getPCSHorizon(),o.queryEnvelope(r),this.m_bIsPannableFrom&&(o=new c({xmin:this.m_pannableExtentFrom.xmin,ymin:r.ymin,xmax:this.m_pannableExtentFrom.xmax,ymax:r.ymax}));let t=!1;null!=e&&(t=et(e,o,i,n,this.m_bIsPannableFrom,this.m_pannableExtentFrom,s)),t||(this.m_horizon1=o,this.m_bInclusive1=n)}else this.m_bClipTopBottomFrom=!0,this.m_bInclusive1=!0}setHorizon2(t,e){const s=t.getOutputSR();if(1===s.getCoordinateSystemType())return this.m_horizon2=null,void(this.m_bInclusive2=!1);let i=null;const n=new u,o=s.getGCSHorisonIsInclusive();i=s.getGCSHorizon(),i.queryEnvelope(n);const r=s.getCentralMeridian();if(this.m_bIsPannableTo){const t=new c({xmin:this.m_pannableExtentGcsTo.xmin,ymin:n.ymin,xmax:this.m_pannableExtentGcsTo.xmax,ymax:n.ymax});t.centerAt(r,0),i=t}this.m_horizon2=i,this.m_bInclusive2=o}checkAndSetStages(t,e){const s=t.getOutputSR().getGCSSplitLines();if(!this.m_horizon2&&!s)return void(this.m_stages=1);if(this.m_horizon2.getGeometryType()===r.enumEnvelope){const t=new u;this.m_horizon2.queryEnvelope(t);const e=t.width(),s=t.height();e>=d/this.m_rpuGcsTo&&s>=Math.PI/this.m_rpuGcsTo&&(this.m_horizon2=null)}if(this.m_horizon2||s){if(null!==this.m_horizon2&&!this.m_bNeedsGeoTransform&&!this.m_bSrFromIsPcs){const e=t.getOutputSR().getGCS();return t.getInputSR().equals(e)?(this.m_horizon1=this.m_horizon2,this.m_bInclusive1=this.m_bInclusive2,this.m_bClipTopBottomFrom=!1,this.m_horizon2=null,this.m_bInclusive2=!1,void(this.m_stages=1)):void(this.m_stages=2)}this.m_stages=3}else this.m_stages=1}execute_(t,e,n,o){if(!this.m_bNeedsShapePreservingProject)return(new b).execute(t,this.m_inputTransform,o);if(!t)return null;s(t),i(t);let a,c=t.getGeometryType();return h(c)?(a=W(t),c=r.enumPolyline):a=t,a.isEmpty()?a:m(c)?this.executeEx(t,e,n,o):(new b).execute(t,this.m_inputTransform,o)}executeEx(t,e,s,i){let n;t.hasNonLinearSegments()&&a(""),n=this.m_bIsPannableFrom?(new b).foldInto360Range(t,this.m_transform1.getInputSR()):t;let o,r=s;return r>0||(r=100*this.m_toTolerance),o=1===this.m_stages?this.executeGood(n,e,r,i):2===this.m_stages?this.executeBad(n,e,r,i):this.executeUgly(n,e,r,i),this.filterOverDensification(o,this.m_inputTransform.getOutputSR(),r,i)}executeGood(t,e,s,i){const n=s*s;let o,r;return o=e>0?this.getMinLengthInSrFrom(e):this.getMinLengthInSrFrom(1e-5),r=this.m_bClipTopBottomFrom?x(t,this.m_transform1.getInputSR()):$(t,this.m_transform1.getInputSR(),this.m_horizon1,this.m_bInclusive1,this.m_bIsPannableFrom,this.m_pannableExtentFrom,!0,Number.NaN,i),r=F(r,this.m_transform1.getOutputSR(),i),r=j(r,this.m_transform1,this.m_bIsPannableFrom,this.m_pannableExtentFrom,this.m_bIsPannableTo,this.m_pannableExtentTo,null,null,null,null,o,n,i),r=(new b).execute(r,this.m_transform1,i),r}executeBad(t,e,s,i){let n;n=e>0?e*(Math.PI/180/this.m_rpuGcsTo):Math.PI/180/this.m_rpuGcsTo*1e-5;const o=s*s;let r;return r=this.m_bClipTopBottomFrom?x(t,this.m_transform1.getInputSR()):t,r=(new b).execute(r,this.m_transform1,i),r=$(r,this.m_transform2.getInputSR(),this.m_horizon2,this.m_bInclusive2,!0,this.m_pannableExtentGcsTo,!0,Number.NaN,i),r=F(r,this.m_transform2.getOutputSR(),i),r=j(r,this.m_transform2,!0,this.m_pannableExtentGcsTo,this.m_bIsPannableTo,this.m_pannableExtentTo,null,null,null,null,n,o,i),r=(new b).execute(r,this.m_transform2,i),r}executeUgly(t,e,s,i){const n=s*s;let o;o=e>0?this.getMinLengthInSrFrom(e):this.getMinLengthInSrFrom(1e-5);let r=null;r=this.m_bClipTopBottomFrom?x(t,this.m_transform1.getInputSR()):$(t,this.m_transform1.getInputSR(),this.m_horizon1,this.m_bInclusive1,this.m_bIsPannableFrom,this.m_pannableExtentFrom,!0,Number.NaN,i);let h=r;const m=new L(this.m_horizon2,this.m_transform2.getInputSR(),this.m_bInclusive2,this.m_pannableExtentGcsTo),a=this.m_transform2.getOutputSR().getGCSSplitLines(),c=new R(a,this.m_transform1,this.m_pannableExtentGcsTo);if(r=j(r,this.m_transform1,this.m_bIsPannableFrom,this.m_pannableExtentFrom,this.m_bIsPannableTo,this.m_pannableExtentTo,this.m_transform2,m,this.m_pannableExtentGcsTo,c,o,n,i),null!==r){h=null,r=(new b).execute(r,this.m_transform1,i);const t=Math.PI/180/this.m_rpuGcsTo*2;return r=$(r,this.m_transform2.getInputSR(),this.m_horizon2,this.m_bInclusive2,!0,this.m_pannableExtentGcsTo,!1,t,i),r=(new b).execute(r,this.m_transform2,i),r}let l=Number.NaN;l=s>0?s:100*this.m_toTolerance,l/=this.m_rpuGcsTo*this.m_aTo/this.m_mpuTo;const u=l*l;let f;return r=j(h,this.m_transform1,this.m_bIsPannableFrom,this.m_pannableExtentFrom,!0,this.m_pannableExtentGcsTo,null,null,null,null,o,u,i),h=null,r=(new b).execute(r,this.m_transform1,i),f=e>0?e*(Math.PI/180/this.m_rpuGcsTo):Math.PI/180/this.m_rpuGcsTo*1e-5,r=$(r,this.m_transform2.getInputSR(),this.m_horizon2,this.m_bInclusive2,!0,this.m_pannableExtentGcsTo,!1,Number.NaN,i),r=F(r,this.m_transform2.getOutputSR(),i),r=j(r,this.m_transform2,!0,this.m_pannableExtentGcsTo,this.m_bIsPannableTo,this.m_pannableExtentTo,null,null,null,null,f,n,i),r=(new b).execute(r,this.m_transform2,i),r}getMinLengthInSrFrom(t){let e;return e=this.m_bSrFromIsPcs?this.m_aFrom*(t*Math.PI/180)/this.m_mpuFrom:t*Math.PI/180*(1/this.m_rpuFrom),e}filterOverDensification(t,e,s,i){let n=X(t,s);return n.dropAttribute(10),n!==t&&n.getGeometryType()===r.enumPolygon&&(n=(new C).execute(n,e,!1,i)),n}}function X(t,e){if(t.isEmpty()||!t.hasAttribute(10))return t;const s=e*e;let i=t.getAttributeStreamRef(10),n=!1;const o=new _,r=[];let h=!1;for(let a=0,c=t.getPathCount();a<c;a++){const e=t.getPathStart(a),m=t.getPathEnd(a),c=t.isClosedPath(a);if(!(m>e))continue;{const t=c?e:m-1;0===i.read(e)&&0===i.read(t)||(n||(i=i.clone(),n=!0),i.write(e,0),i.write(t,0))}const l=c?m+1:m;let u=e;for(let a=e;a<l;a++){const c=a===m?e:a;if(0===i.read(c)){if(a-u>1){r.push({from:u,to:a});const c=new p;for(;r.length>0;){const a=r.at(-1);r.pop(),o.setStartXY(t.getXY(a.from));const l=a.to===m?e:a.to;o.setEndXY(t.getXY(l));let u=s,f=-1;for(let e=a.from+1,s=a.to;e<s;e++){const s=t.getXY(e),i=o.getClosestCoordinate(s,!1);o.queryCoord2D(i,c);const n=p.sqrDistance(c,s);u<n&&(u=n,f=e)}f>=0?(n||(i=i.clone(),n=!0),i.write(f,0),f-a.from>1&&r.push({from:a.from,to:f}),a.to-f>1&&r.push({from:f,to:a.to})):h=!0}}u=c}}}if(!h)return t;const m=Y(t,i,1);return m.dropAttribute(10),m}function Y(t,e,s){const i=t.createInstance(),n=new l;for(let o=0,r=t.getPathCount();o<r;o++){let r=!0,h=0,m=0;const a=t.getPathStart(o),c=t.getPathEnd(o);let l=!0;for(let u=a;u<c;u++){e.read(u)===s?(!l&&m>0&&(i.addSegmentsFromPath(t,o,h-a,m,r),m=0),l=!0):l?(l=!1,t.getPointByVal(u,n),r?(i.startPathPoint(n),r=!1):i.lineToPoint(n),h=u):m++}m>0&&i.addSegmentsFromPath(t,o,h-a,m,r)}return i}const A=8;function H(t,e){const s=.5;for(let i=0;i<t;i++){let n=Math.ceil(i/2)/(t+1);i%2!=0&&(n=-n);const o=s+n;e[i]=o}}function O(t){if(!t)return!1;const e=t.getCoordinateSystemType();return 2===e||1===e}function j(t,e,s,i,n,o,r,h,m,a,c,l,u){const f=t.createInstance();f.addAttribute(10);const _=t.querySegmentIterator(),d=[],p=[],P=new g,T=t.getDescription().getAttributeCount()>1,b=new lt(e,s,i,n,o,r,h,a,c,l,T?p:null,d,u);for(;_.nextPath();)for(;_.hasNextSegment();){const t=_.nextSegment(),e=t.getStartXY(),s=t.getEndXY(),i=e.compare(s)>0,n=J(i,t,P);d.length=0,p.length=0;if(!b.densifySegment(_.isFirstSegmentInPath(),n))return null;i&&K(T?p:null,d),d.at(-1).setCoordsPoint2D(t.getEndXY());const o=f.getPointCount();if(T){const e=J(i,t,P);U(_.isFirstSegmentInPath(),_.isLastSegmentInPath()&&!_.isPathClosed(),t,e,p,d,f)}else B(_.isFirstSegmentInPath(),_.isLastSegmentInPath()&&!_.isPathClosed(),d,f);if(b.needsPostFiltering()){f.addAttribute(10);const t=f.getAttributeStreamRef(10);for(let e=1,s=d.length-1;e<s;e++)t.write(e+o,1)}}return f}function B(t,e,s,i){t&&i.insertPath2D(-1,null,0,0,!0);const n=i.getPathCount()-1;e?i.insertPointsFromPoints(n,-1,s,0,s.length,!0):i.insertPointsFromPoints(n,-1,s,0,s.length-1,!0)}function U(t,e,s,i,n,o,r){r.reserve(r.getPointCount()+o.length-1);const h=new l;if(s.queryStart(h),t?r.startPathPoint(h):r.lineToPoint(h),o.length>2){const t=i.calculateLength2D();for(let e=1;e<o.length-1;e++){const s=i.lengthToT(n[e]*t);i.queryCoord(s,h),h.setXY(o[e]),r.lineToPoint(h)}}e&&(s.queryEnd(h),r.lineToPoint(h))}function W(t){const e=new f({vd:t.getDescription()});return e.addSegment(t,!0),e}function Q(t,e){const s=e.getInputSR(),i=e.getOutputSR(),n=new p;2===s.getCoordinateSystemType()?(n.setCoordsPoint2D(t),G(s,0,[n],1)):n.setCoordsPoint2D(t);const o=new p;o.setCoordsPoint2D(n),v(e,[o],null,1,!1);const r=new p;return 2===i.getCoordinateSystemType()?(r.setCoordsPoint2D(o),z(i,[r],1,!1)):r.setCoordsPoint2D(o),r}function V(t,e,s,i,n,o,r,h){if(n){const n=o.width(),m=.5*n;if(i){const i=.25*n;let o=!1;const a=new p,c=new p;if(Math.abs(t.y)===i?(a.setCoords(s.x,t.y),c.setCoordsPoint2D(s),o=!0):Math.abs(s.y)===i&&(c.setCoords(t.x,s.y),a.setCoordsPoint2D(t),o=!0),Math.abs(e.y)===i&&(o||(a.setCoordsPoint2D(t),c.setCoordsPoint2D(s),o=!0),a.x=e.x),o)return ot(e,a,m,n,r),ot(e,c,m,n,h),!0}let a=0;t.x-e.x>m&&s.x-e.x>m?a-=n:e.x-t.x>m&&e.x-s.x>m&&(a+=n),Math.abs(e.x-(t.x+a))<m?(r.setCoordsPoint2D(t),ot(r,s,m,n,h),r.x+=a,h.x+=a):(r.setCoordsPoint2D(s),ot(r,t,m,n,h),r.x+=a,h.x+=a)}else r.setCoordsPoint2D(t),h.setCoordsPoint2D(s);return!1}function J(t,e,s){return t?(s.create(e.getGeometryType()),e.copyTo(s.get()),s.get().reverse(),s.get()):e}function K(t,e){e.reverse(),null!==t&&t.reverse()}function Z(t,e,s,i){const n=.5*(i.getStartX()+i.getEndX());if(n-s>t){const t=new T;t.setShiftCoords(-e,0),i.applyTransformation(t)}else if(s-n>t){const t=new T;t.setShiftCoords(e,0),i.applyTransformation(t)}}function $(t,e,s,i,n,o,r,h,m){const a=[!1];r&&tt(t,e,s,i,n,o,!0,h,a,m);let c=t;return a[0]||(c=tt(c,e,s,i,n,o,!1,h,null,m)),c=it(c,n,o,c!==t),c}function tt(t,e,s,i,n,o,h,m,a,c){if(h&&(a[0]=!1),null==s)return t;const l=new u,f=new u;s.queryEnvelope(l),t.queryEnvelope(f);const g=t.getGeometryType(),_=s.getGeometryType(),d=e.getTolerance(0);if(!n){if(h)return a[0]=st(t,s,e,i,c),null;let n;return n=i?_===r.enumEnvelope?k(t,l,d,m,c):(new y).execute(t,s,e,c):(new w).execute(t,s,e,c),n===s&&(n=s.clone()),n}const p=o.width(),P=p*Math.ceil(l.width()/p);let b=null;if(i){let o=nt(t,s,n,P),D=0;const S=new T;do{let n=null;if(_===r.enumEnvelope){const r=s.clone();if(S.setShiftCoords(o*P,0),r.applyTransformation(S),h){if(a[0]=st(t,r,e,i,c),!a[0])return null}else{const e=new u;r.queryEnvelope(e),n=k(t,e,d,m,c)}}else{const r=t.clone();if(S.setShiftCoords(-o*P,0),r.applyTransformation(S),h){if(a[0]=st(r,s,e,i,c),!a[0])return null}else n=(new y).execute(r,s,e,c),n===s&&(n=s.clone())}if(!h){if(n.isEmpty())continue;if(g===r.enumPolygon){const t=new u;if(n.queryEnvelope(t),t.width()<=d)continue}_===r.enumEnvelope&&(S.setShiftCoords(-o*P,0),n===t&&(n=n.clone()),n.applyTransformation(S)),null===b?b=n===t?n.clone():n:b.add(n,!1)}D++}while(l.xmin+ ++o*P<f.xmax);if(h)return null;null===b&&(b=t.createInstance()),g===r.enumPolygon&&D>1&&p-f.width()<=10*d&&(b=(new C).execute(b,e,!0,c))}else{let o=nt(t,s,n,P);if(b=t.clone(),0!==o){const t=new T;t.setShiftCoords(-o*P,0),b.applyTransformation(t)}do{if(h){if(a[0]=st(b,s,e,i,c),!a[0])return null}else if(b=(new w).execute(b,s,e,c),b===s&&(b=s.clone()),b.isEmpty())break;const t=new T;t.setShiftCoords(-P,0),b.applyTransformation(t)}while(l.xmin+ ++o*P<f.xmax);if(h)return null;if(!b.isEmpty()&&0!==o){const t=new T;t.setShiftCoords(o*P,0),b.applyTransformation(t)}}return b}function et(t,e,s,i,n,o,r){const h=[!1];return tt(t,s,e,i,n,o,!0,Number.NaN,h,r),h[0]}function st(t,e,s,i,n){let o;if(e.getGeometryType()===r.enumPolygon)if(i){o=E(e,t,s,64,n)}else{o=E(e,t,s,4,n)}else if(i){const s=new u,i=new u;e.queryEnvelope(s),t.queryEnvelope(i);o=s.containsEnvelope(i)}else{o=E(e,t,s,4,n)}return o}function it(t,e,s,i){let n;if(!e)return t;const o=s.getCenter().x,r=s.width(),h=.5*r,m=new u;t.queryEnvelope(m);const a=m.getCenter().x;let c=0;if(a-o>h){c=-Math.ceil((a-o-h)/r)*r}else if(o-a>h){c=Math.ceil((o-a-h)/r)*r}if(0!==c){n=i?t:t.clone();const e=new T;e.setShiftCoords(c,0),n.applyTransformation(e)}else n=t;return n}function nt(t,e,s,i){if(!s)return 0;let n=0;const o=new u;e.queryEnvelope(o);const r=new u;t.queryEnvelope(r);const h=o.xmin+i;for(;h+i+n*i>r.xmin;)n--;for(;h+n*i<r.xmin;)n++;return n}function ot(t,e,s,i,n){e.x-t.x>s?n.setCoords(e.x-i,e.y):t.x-e.x>s?n.setCoords(e.x+i,e.y):n.setCoordsPoint2D(e)}function rt(t,e,s,i,n,o,r){Math.abs(t.y)===s?(o.setCoords(e.x,t.y),r.setCoordsPoint2D(e)):Math.abs(e.y)===s?(o.setCoordsPoint2D(t),r.setCoords(t.x,e.y)):(o.setCoordsPoint2D(t),ot(o,e,i,n,r))}function ht(t){return t.getUnit().getUnitToBaseFactor()}function mt(t){return t.getUnit().getUnitToBaseFactor()}function at(t){return t.getPECoordSys().getDatum().getSpheroid().getAxis()}function ct(t,e,s){return s<=.5?t+(e-t)*s:e-(e-t)*(1-s)}class lt{checkSegment(){for(let t=0;t<this.n;t++){if(null!==this.pSplitLines2Info&&this.pSplitLines2Info.hasSplitLines()&&!this.bCheckIfNoDensificationNeededForCurve){const t=this.pSplitLines2Info.getSplitLineFactorEx(this.rectifiedSegment,this.leftFactor,this.rightFactor,this.leftGcsToDensifiedPoint,this.rightGcsToDensifiedPoint,this.progressTracker);if(Number.isNaN(t))return-1;if(-1!==t&&this.leftFactor<t&&t<this.rightFactor)return this.cutFactor=t,this.cutFromDensifiedPoint.assign(this.rectifiedSegment.getCoord2D(this.cutFactor)),this.cutToDensifiedPoint.assign(Q(this.cutFromDensifiedPoint,this.transform)),this.cutGcsToDensifiedPoint.setCoordsPoint2D(this.cutToDensifiedPoint),this.cutToDensifiedPoint.assign(Q(this.cutGcsToDensifiedPoint,this.transform2)),this.midFactor=this.cutFactor,this.midFromDensifiedPoint.setCoordsPoint2D(this.cutFromDensifiedPoint),this.midToDensifiedPoint.setCoordsPoint2D(this.cutToDensifiedPoint),this.midGcsToDensifiedPoint.setCoordsPoint2D(this.cutGcsToDensifiedPoint),1}if(this.cutFactor=ct(this.leftFactor,this.rightFactor,this.scalars[t]),this.cutFromDensifiedPoint.assign(this.rectifiedSegment.getCoord2D(this.cutFactor)),this.cutToDensifiedPoint.assign(Q(this.cutFromDensifiedPoint,this.transform)),null!==this.transform2&&(this.cutGcsToDensifiedPoint.setCoordsPoint2D(this.cutToDensifiedPoint),this.cutToDensifiedPoint.assign(Q(this.cutGcsToDensifiedPoint,this.transform2))),0===t&&(this.midFactor=this.cutFactor,this.midFromDensifiedPoint.setCoordsPoint2D(this.cutFromDensifiedPoint),this.midToDensifiedPoint.setCoordsPoint2D(this.cutToDensifiedPoint),this.midGcsToDensifiedPoint.setCoordsPoint2D(this.cutGcsToDensifiedPoint)),this.bIsPannableFrom&&!this.bCheckIfNoDensificationNeededForCurve&&Math.abs(this.leftFromDensifiedPoint.x-this.rightFromDensifiedPoint.x)>=.25*this.pannableExtentFrom.width())return 1;let e;if(this.bCheckIfNoDensificationNeededForCurve){const t=this.projCurveSegment.get().getClosestCoordinate(this.cutToDensifiedPoint,!1),s=this.projCurveSegment.get().getCoord2D(t);e=p.sqrDistance(this.cutToDensifiedPoint,s)}else{const s=new p,i=new p,n=V(this.leftToDensifiedPoint,this.cutToDensifiedPoint,this.rightToDensifiedPoint,this.bSrToIsGcs,this.bIsPannableTo,this.pannableExtentTo,s,i);this.line.setStartXY(s),this.line.setEndXY(i);const o=this.line.getClosestCoordinate(this.cutToDensifiedPoint,!0);if(n||t>0||Math.abs(o-this.scalars[t])<.3){const t=this.line.getCoord2D(o);e=p.sqrDistance(this.cutToDensifiedPoint,t)}else e=2*this.maxDeviationInSrToSq,this.bNeedPostFiltering=!0}if(e>this.maxDeviationInSrToSq)return this.bCheckIfNoDensificationNeededForCurve=!1,1}return 0}constructor(t,e,s,i,n,o,r,h,m,a,c,l,f){this.leftFromDensifiedPoint=new p,this.rightFromDensifiedPoint=new p,this.cutFromDensifiedPoint=new p,this.midFromDensifiedPoint=new p,this.leftToDensifiedPoint=new p,this.rightToDensifiedPoint=new p,this.cutToDensifiedPoint=new p,this.midToDensifiedPoint=new p,this.line=new _,this.leftGcsToDensifiedPoint=new p,this.rightGcsToDensifiedPoint=new p,this.cutGcsToDensifiedPoint=new p,this.midGcsToDensifiedPoint=new p,this.bSrToIsGcs=!1,this.bIsCurve=!1,this.leftFactor=0,this.rightFactor=0,this.bIsFirstInPath=!1,this.rectifiedSegment=null,this.transform=null,this.bIsPannableFrom=!1,this.pannableExtentFrom=new u,this.bIsPannableTo=!1,this.bNeedPostFiltering=!1,this.pannableExtentTo=new u,this.transform2=null,this.pHorizon2Info=null,this.pSplitLines2Info=null,this.minLengthInSrFrom=0,this.maxDeviationInSrToSq=0,this.cutFactor=0,this.midFactor=0,this.pDensifiedFactors=null,this.pDensifiedPoints=[],this.rightFromDensifiedPointsStack=[],this.rightToDensifiedPointsStack=[],this.rightGcsToDensifiedPointsStack=[],this.rightFactorsStack=[],this.projCurveSegment=new g,this.n=0,this.bCheckIfNoDensificationNeededForCurve=!1,this.scalars=P(A-1,Number.NaN),this.progressTracker=f,this.transform=t,this.bIsPannableFrom=e,this.pannableExtentFrom.assign(s),this.bIsPannableTo=i,this.pannableExtentTo.assign(n),this.transform2=o,this.pHorizon2Info=r,this.pSplitLines2Info=h,this.minLengthInSrFrom=m,this.maxDeviationInSrToSq=a,this.pDensifiedFactors=c,this.pDensifiedPoints=l,this.progressTracker=f,this.bNeedPostFiltering=!1}needsPostFiltering(){return this.bNeedPostFiltering}densifySegment(t,e){if(this.bIsFirstInPath=t,this.rectifiedSegment=e,this.leftGcsToDensifiedPoint.setNAN(),this.rightGcsToDensifiedPoint.setNAN(),this.cutGcsToDensifiedPoint.setNAN(),this.midGcsToDensifiedPoint.setNAN(),this.bSrToIsGcs=null!=this.transform2?1===this.transform2.getOutputSR().getCoordinateSystemType():1===this.transform.getOutputSR().getCoordinateSystemType(),this.bIsCurve=this.rectifiedSegment.isCurve(),this.leftFactor=0,this.rightFactor=1,this.leftFromDensifiedPoint.assign(this.rectifiedSegment.getStartXY()),this.rightFromDensifiedPoint.assign(this.rectifiedSegment.getEndXY()),this.leftToDensifiedPoint.assign(Q(this.leftFromDensifiedPoint,this.transform)),this.rightToDensifiedPoint.assign(Q(this.rightFromDensifiedPoint,this.transform)),null!==this.transform2&&(this.leftGcsToDensifiedPoint.setCoordsPoint2D(this.leftToDensifiedPoint),this.rightGcsToDensifiedPoint.setCoordsPoint2D(this.rightToDensifiedPoint),this.leftToDensifiedPoint.assign(Q(this.leftGcsToDensifiedPoint,this.transform2)),this.rightToDensifiedPoint.assign(Q(this.rightGcsToDensifiedPoint,this.transform2)),this.bIsFirstInPath&&!this.pHorizon2Info.isPointStartInHorizon(this.leftGcsToDensifiedPoint,this.progressTracker)))return!1;this.rightFromDensifiedPointsStack.length=0,this.rightToDensifiedPointsStack.length=0,this.rightGcsToDensifiedPointsStack.length=0,this.rightFactorsStack.length=0,this.rightFromDensifiedPointsStack.push(this.rightFromDensifiedPoint.clone()),this.rightToDensifiedPointsStack.push(this.rightToDensifiedPoint.clone()),this.rightFactorsStack.push(this.rightFactor),null!=this.transform2&&this.rightGcsToDensifiedPointsStack.push(this.rightGcsToDensifiedPoint.clone()),null!==this.pDensifiedPoints&&this.pDensifiedPoints.push(this.leftFromDensifiedPoint.clone()),null!==this.pDensifiedFactors&&this.pDensifiedFactors.push(this.leftFactor),this.bIsCurve?this.rectifiedSegment.getGeometryType()===r.enumBezier?this.n=A-1:this.n=5:this.n=3,H(this.n,this.scalars);const s=this.rectifiedSegment.calculateLength2D();if(this.bCheckIfNoDensificationNeededForCurve=!1,this.bIsCurve){const t=new f({vd:this.rectifiedSegment.getDescription()});let e=(new b).execute(t,this.transform,this.progressTracker);if(null!==this.transform2){const t=new u;if(e.queryEnvelope(t),!this.pHorizon2Info.isEnvelopeInHorizon(t,this.progressTracker))return!1;e=(new b).execute(e,this.transform2,this.progressTracker)}e.getSegmentBuffer(0,this.projCurveSegment,!1),this.bCheckIfNoDensificationNeededForCurve=!0}for(;this.rightFromDensifiedPointsStack.length>0;){let t=!1;if(this.cutFactor=Number.NaN,this.midFactor=Number.NaN,this.midFromDensifiedPoint.setNAN(),this.midToDensifiedPoint.setNAN(),(this.rightFactor-this.leftFactor)*s>this.minLengthInSrFrom){const e=this.checkSegment();if(-1===e)return!1;t=0!==e}if(t)this.rightFromDensifiedPoint.setCoordsPoint2D(this.midFromDensifiedPoint),this.rightToDensifiedPoint.setCoordsPoint2D(this.midToDensifiedPoint),this.rightFactor=this.midFactor,this.rightFromDensifiedPointsStack.push(this.rightFromDensifiedPoint.clone()),this.rightToDensifiedPointsStack.push(this.rightToDensifiedPoint.clone()),this.rightFactorsStack.push(this.rightFactor),null!==this.transform2&&(this.rightGcsToDensifiedPoint.setCoordsPoint2D(this.midGcsToDensifiedPoint),this.rightGcsToDensifiedPointsStack.push(this.rightGcsToDensifiedPoint.clone()));else{if(null!==this.transform2&&!this.pHorizon2Info.isAdjoiningLineInHorizon(this.leftGcsToDensifiedPoint,this.rightGcsToDensifiedPoint,this.progressTracker))return!1;if(this.rightFromDensifiedPointsStack.pop(),this.rightToDensifiedPointsStack.pop(),this.rightFactorsStack.pop(),null!==this.transform2&&this.rightGcsToDensifiedPointsStack.pop(),null!==this.pDensifiedPoints&&this.pDensifiedPoints.push(this.rightFromDensifiedPoint.clone()),null!==this.pDensifiedFactors&&this.pDensifiedFactors.push(this.rightFactor),this.rightFromDensifiedPointsStack.length>0){this.leftFromDensifiedPoint.setCoordsPoint2D(this.rightFromDensifiedPoint),this.leftToDensifiedPoint.setCoordsPoint2D(this.rightToDensifiedPoint),this.leftFactor=this.rightFactor;const t=this.rightFromDensifiedPointsStack.at(-1),e=this.rightToDensifiedPointsStack.at(-1);if(this.rightFromDensifiedPoint.setCoordsPoint2D(t),this.rightToDensifiedPoint.setCoordsPoint2D(e),this.rightFactor=this.rightFactorsStack.at(-1),null!==this.transform2){this.leftGcsToDensifiedPoint.setCoordsPoint2D(this.rightGcsToDensifiedPoint);const t=this.rightGcsToDensifiedPointsStack.at(-1);this.rightGcsToDensifiedPoint.setCoordsPoint2D(t)}}}}return!0}}class ut{getOperatorType(){return 10315}supportsCurves(){return!1}accelerateGeometry(t,e,s){return!1}canAccelerateGeometry(t){return!1}executeMany(t,e,s,i,n,o){return q(s)?new ft(t,e,s,i,n,o):(new b).executeMany(t,s,o)}execute(t,e,s,i,n){if(!q(e))return(new b).execute(t,e,n);const o=new M;return o.prepare(e,null,n),o.execute(t,s,i,n)}}class ft extends t{constructor(t,s,i,n,o,r){super(),this.m_spp=null,this.m_index=-1,t||e(""),this.m_progressTracker=r,this.m_geometries=t,this.m_geometriesExtent=s?s.clone():null,this.m_transform=i,this.m_minSegmentLengthInDegrees=n,this.m_maxDeviationInSrTo=o}tock(){return!0}getRank(){return 1}next(){this.m_spp||(this.m_spp=new M,this.m_spp.prepare(this.m_transform,this.m_geometriesExtent,this.m_progressTracker));const t=this.m_geometries.next();return s(t),i(t),null!=t?(this.m_index=this.m_geometries.getGeometryID(),this.m_spp.execute(t,this.m_minSegmentLengthInDegrees,this.m_maxDeviationInSrTo,this.m_progressTracker)):null}getGeometryID(){return this.m_index}}export{ut as OperatorShapePreservingProject};
|
|
5
|
+
import{G as t}from"./SimpleGeometryCursor.js";import{a as e,c as s,o as i,p as n,g as o,G as r,f as h,h as m,t as a}from"./Geometry.js";import{E as c,P as l}from"./Envelope.js";import{Envelope2D as u}from"./Envelope2D.js";import{P as f,S as g,L as _}from"./MultiPathImpl.js";import{p as d,P as p,d as P}from"./Point2D.js";import{T}from"./Transformation2D.js";import{O as b,B as D,A as S,z as I,a3 as x,aD as F,D as C,H as N,G as y,K as w,J as E,ab as G,aE as v,aa as z}from"./UnitFactory.js";import{c as k}from"./OperatorClip.js";function q(t){const e=t.getInputSR(),s=t.getOutputSR();let i=!1;do{if(e.equals(s)){i=!1;break}if(!O(e)||!O(s)){i=!1;break}if(2===e.getCoordinateSystemType()){i=!0;break}if(2===s.getCoordinateSystemType()){i=!0;break}const n=t.getGeographicTransformations();if(null!==n&&n.count()>0){i=!0;break}}while(0);return i}class L{constructor(t,e,s,i){this.m_horizon2Env=new u,this.m_horizon2=t,this.m_sr=e,this.m_bInclusive2=s,this.m_pannableExtent=i.clone(),this.m_segIter=null,this.m_qtIter=null,null!==t?(t.queryEnvelope(this.m_horizon2Env),this.m_gcs360=i.width(),this.m_gcs180=.5*this.m_gcs360,this.m_gcs90=.25*this.m_gcs360,this.m_pannableFactor=1,this.m_horizon2Env.width()-this.m_gcs360>0&&(this.m_pannableFactor+=Math.ceil((this.m_horizon2Env.width()-this.m_gcs360)/this.m_gcs360)),this.m_period=this.m_gcs360):(this.m_horizon2Env.setEmpty(),this.m_gcs360=Number.NaN,this.m_gcs180=Number.NaN,this.m_gcs90=Number.NaN,this.m_pannableFactor=Number.NaN,this.m_period=Number.NaN),this.m_gcsTolerance=null!=e?e.getTolerance(0):Number.NaN}isPointStartInHorizon(t,e){if(!this.m_horizon2)return!0;let s=nt(new l(t),this.m_horizon2,!0,this.m_period);do{const e=t.clone();if(e.x-=s*this.m_period,this.m_horizon2.getGeometryType()===r.enumPolygon){let t;if(t=this.m_horizon2Env.contains(e)?N(this.m_horizon2,e,0):0,this.m_bInclusive2){if(0===t)return!1}else if(1===t)return!1}else{const t=this.m_horizon2Env.contains(e);if(this.m_bInclusive2){if(!t)return!1}else if(t)return!1}}while(this.m_horizon2Env.xmin+ ++s*this.m_period<t.x);return!0}isAdjoiningLineInHorizon(t,e,s){if(!this.m_horizon2)return!0;const i=new p,n=new p;rt(t,e,this.m_gcs90,this.m_gcs180,this.m_gcs360,i,n);const h=Math.max(i.x,n.x),m=new _;m.setStart2D(i),m.setEnd2D(n);let a=nt(m,this.m_horizon2,!0,this.m_period);const c=!1;do{const t=i.clone(),e=n.clone();if(t.x-=a*this.m_period,e.x-=a*this.m_period,this.m_horizon2.getGeometryType()===r.enumPolygon){const s=new _;s.setStartXY(t),s.setEndXY(e);const i=new u,n=new u;if(s.queryEnvelope(i),n.setCoords({env2D:i}),n.inflateCoords(this.m_gcsTolerance,this.m_gcsTolerance),this.m_horizon2Env.isIntersecting(n)){const t=this.m_horizon2.getImpl(),e=t.getAccelerators();if(null!==e){null!==e.getRasterizedGeometry()&&o(0)}{let i=null;if(null!==e&&(i=e.getQuadTree()),null!==i){this.m_qtIter||(this.m_qtIter=i.getIteratorForQT()),this.m_qtIter.resetIterator(s,this.m_gcsTolerance),this.m_segIter||(this.m_segIter=t.querySegmentIterator());for(let t=this.m_qtIter.next();-1!==t;t=this.m_qtIter.next()){const e=i.getElement(t);this.m_segIter.resetToVertex(e,-1);if(this.m_segIter.nextSegment().isIntersecting(s,this.m_gcsTolerance))return!1}}else for(this.m_segIter||(this.m_segIter=t.querySegmentIterator()),this.m_segIter.resetToFirstPath();this.m_segIter.nextPath();)for(;this.m_segIter.hasNextSegment();){const t=this.m_segIter.nextSegment(),e=new u;if(t.queryEnvelope(e),e.isIntersecting(n)&&t.isIntersecting(s,this.m_gcsTolerance))return!1}}}}else if(this.m_bInclusive2){const s=this.m_horizon2Env.contains(t),i=this.m_horizon2Env.contains(e);if(s&&i)return!0}else{const s=this.m_horizon2Env.clone();s.inflateCoords(this.m_gcsTolerance,this.m_gcsTolerance);if(!(0===s.clipLine(t,e)))return!1}}while(this.m_horizon2Env.xmin+ ++a*this.m_period<h);return!this.m_bInclusive2||c}isEnvelopeInHorizon(t,e){if(!this.m_horizon2)return!0;const s=new c({env2D:t});let i=nt(s,this.m_horizon2,!0,this.m_period);do{const n=t.clone();n.move(-i*this.m_period,0),s.setCoords(n.xmin,n.ymin,n.xmax,n.ymax);if(!st(s,this.m_horizon2,this.m_sr,this.m_bInclusive2,e))return!1}while(this.m_horizon2Env.xmin+ ++i*this.m_period<t.xmax);return!0}}class R{constructor(t,e,s){this.m_splitLines2=null,this.m_scalars=[],this.m_splitIter=null,this.m_splitLines2=t,this.m_transform1=e,this.m_pannableExtent=s.clone(),this.m_gcs360=s.width(),this.m_gcs180=.5*this.m_gcs360,this.m_gcs90=.25*this.m_gcs360,null!==e?(this.m_gcsTolerance=this.m_transform1.getOutputSR().getTolerance(0),this.m_halfGcsTolerance=.5*this.m_gcsTolerance,this.m_gcsToleranceSq=this.m_gcsTolerance*this.m_gcsTolerance):(this.m_gcsTolerance=Number.NaN,this.m_halfGcsTolerance=Number.NaN,this.m_gcsToleranceSq=Number.NaN)}hasSplitLines(){return null!=this.m_splitLines2}getSplitLineFactorEx(t,e,s,i,n,o){const r=new p,h=new p;rt(i,n,this.m_gcs90,this.m_gcs180,this.m_gcs360,r,h);const m=new _;for(m.setStartXY(r),m.setEndXY(h),this.m_splitIter?this.m_splitIter.resetToFirstPath():this.m_splitIter=this.m_splitLines2.getImpl().querySegmentIterator();this.m_splitIter.nextPath();)for(;this.m_splitIter.hasNextSegment();){const i=this.m_splitIter.nextSegment(),n=.5*(i.getStartX()+i.getEndX());Z(this.m_gcs180,this.m_gcs360,n,m);const r=new u;m.queryEnvelope(r),r.inflateCoords(this.m_gcsTolerance,this.m_gcsTolerance);const h=new u;if(i.queryEnvelope(h),!r.isIntersecting(h))continue;this.m_scalars.length<2&&(this.m_scalars.length=2);if(1===m.intersect(i,null,this.m_scalars,null,this.m_gcsTolerance)&&(this.m_scalars[0]>0&&this.m_scalars[0]<1)){const n=ct(e,s,this.m_scalars[0]),r=Q(t.getCoord2D(n),this.m_transform1);if(i.isIntersectingPoint(r,this.m_halfGcsTolerance))return n;return this.getSplitLineFactor(t,e,s,i,o)}}return-1}getSplitLineFactor(t,e,s,i,n){let o=e,r=s;const h=.5*(i.getStartX()+i.getEndX()),m=new _,a=t.getCoord2D(o),c=t.getCoord2D(r),l=Q(a,this.m_transform1),u=Q(c,this.m_transform1);for(;o<r;){const e=new p,s=new p;rt(l,u,this.m_gcs90,this.m_gcs180,this.m_gcs360,e,s),m.setStartXY(e),m.setEndXY(s),Z(this.m_gcs180,this.m_gcs360,h,m);const n=p.sqrDistance(m.getStartXY(),m.getEndXY());if(n<=this.m_gcsToleranceSq)break;if(Number.isNaN(n))return Number.NaN;let f=ct(o,r,this.m_scalars[0]);if(o<f&&f<r||(f=.5*(r+o)),o===f||f===r)return f;const g=t.getCoord2D(f),_=Q(g,this.m_transform1),d=new p;rt(l,_,this.m_gcs90,this.m_gcs180,this.m_gcs360,e,d),m.setStartXY(e),m.setEndXY(d),Z(this.m_gcs180,this.m_gcs360,h,m);let P=m.intersect(i,null,this.m_scalars,null,this.m_halfGcsTolerance);if(0!==P){if(1===this.m_scalars[0])return f;r=f,c.setCoordsPoint2D(g),u.setCoordsPoint2D(_)}else{if(rt(_,u,this.m_gcs90,this.m_gcs180,this.m_gcs360,d,s),m.setStartXY(d),m.setEndXY(s),Z(this.m_gcs180,this.m_gcs360,h,m),P=m.intersect(i,null,this.m_scalars,null,this.m_halfGcsTolerance),0===P)return f;if(0===this.m_scalars[0])return f;o=f,a.setCoordsPoint2D(g),l.setCoordsPoint2D(_)}}return.5*(r+o)}}class M{constructor(){this.m_bPrepared=!1,this.m_bNeedsShapePreservingProject=!1,this.m_inputTransform=null,this.m_transform1=null,this.m_transform2=null,this.m_extentFrom=null,this.m_horizon1=null,this.m_horizon2=null,this.m_pannableExtentFrom=new u,this.m_pannableExtentTo=new u,this.m_pannableExtentGcsTo=new u,this.m_bClipTopBottomFrom=!1,this.m_bNeedsGeoTransform=!1,this.m_bIsPannableFrom=!1,this.m_bIsPannableTo=!1,this.m_bInclusive1=!1,this.m_bInclusive2=!1,this.m_bSrFromIsPcs=!1,this.m_bSrToIsPcs=!1,this.m_fromTolerance=Number.NaN,this.m_toTolerance=Number.NaN,this.m_gcsToTolerance=Number.NaN,this.m_aFrom=Number.NaN,this.m_mpuFrom=Number.NaN,this.m_rpuFrom=Number.NaN,this.m_rpuGcsTo=Number.NaN,this.m_aTo=Number.NaN,this.m_mpuTo=Number.NaN,this.m_stages=0}prepare(t,s,i){this.m_bPrepared&&n(""),t||e("");const r=t.getInputSR(),h=t.getOutputSR();O(r)&&O(h)||e("shape preserving project requires PCS or GCS");const m=r.getCoordinateSystemType(),a=h.getCoordinateSystemType();this.m_bSrFromIsPcs=2===m,this.m_bSrToIsPcs=2===a;let c=null,l=null,u=null,f=null;this.m_bSrFromIsPcs?(c=r,u=r.getGCS(),this.m_aFrom=at(u),this.m_mpuFrom=mt(c),this.m_rpuFrom=Number.NaN):(u=r,this.m_rpuFrom=ht(u),this.m_aFrom=Number.NaN),this.m_bSrToIsPcs?(l=h,f=h.getGCS(),this.m_aTo=at(f),this.m_mpuTo=mt(l)):(f=h,this.m_aTo=Number.NaN,this.m_mpuTo=Number.NaN),this.m_rpuGcsTo=ht(f);const g=t.getGeographicTransformations();this.m_bNeedsGeoTransform=null!==g&&g.count()>0;const _=r.equals(h);if(this.m_bNeedsShapePreservingProject=!_&&(this.m_bSrFromIsPcs||this.m_bSrToIsPcs||this.m_bNeedsGeoTransform),!this.m_bNeedsShapePreservingProject)return this.m_inputTransform=t,this.m_extentFrom=s?s.clone():null,void(this.m_bPrepared=!0);if(this.m_bIsPannableFrom=r.isPannable(),this.m_bIsPannableTo=h.isPannable(),this.m_bIsPannableFrom&&(this.m_pannableExtentFrom=r.getPannableExtent()),this.m_bIsPannableTo&&(this.m_pannableExtentTo=h.getPannableExtent()),this.m_bSrToIsPcs){this.m_pannableExtentGcsTo=f.getPannableExtent();const t=l.getCentralMeridian(),e=this.m_pannableExtentGcsTo.getCenter();e.x=t,this.m_pannableExtentGcsTo.centerAt(e)}else this.m_pannableExtentGcsTo=this.m_pannableExtentTo.clone();this.m_fromTolerance=r.getTolerance(0),this.m_toTolerance=h.getTolerance(0),this.m_gcsToTolerance=f.getTolerance(0);{const e=t.getExtendedParams(),n=e.clipWithInputHorizon,o=e.clipWithOutputHorizon;n&&this.setHorizon1(t,s,i),o&&this.setHorizon2(t,i),this.checkAndSetStages(t,i)}const d=D();d.setFlag(1073741824,!0),d.setFlag(536870912,!0);const p=S();if(p.clipWithInputHorizon=!1,p.clipWithOutputHorizon=!1,1===this.m_stages)this.m_transform1=I(!1,r,h,g,p,d);else if(2===this.m_stages){d.setFlag(2147483648,!0),this.m_transform1=I(!1,r,f,g,p,d);const t=D();this.m_transform2=I(!1,f,h,null,p,t)}else{o(null!=l),p.centralMeridianOfOutputGCS=l.getCentralMeridian(),this.m_transform1=I(!1,r,f,g,p,d);const t=D();t.setFlag(2147483648,!0),this.m_transform2=I(!1,f,h,null,p,t)}this.m_inputTransform=t,this.m_extentFrom=s?s.clone():null,this.m_bPrepared=!0}execute(t,e,s,i){this.m_bPrepared||n(""),o(!t.hasAttribute(10));return this.execute_(t,e,s,i)}checkIfNeedsReset(t,e){return o(0),!1}setHorizon1(t,e,s){const i=t.getInputSR();let n,o=null;const r=new u;if(this.m_bSrFromIsPcs){n=!0,o=i.getPCSHorizon(),o.queryEnvelope(r),this.m_bIsPannableFrom&&(o=new c({xmin:this.m_pannableExtentFrom.xmin,ymin:r.ymin,xmax:this.m_pannableExtentFrom.xmax,ymax:r.ymax}));let t=!1;null!=e&&(t=et(e,o,i,n,this.m_bIsPannableFrom,this.m_pannableExtentFrom,s)),t||(this.m_horizon1=o,this.m_bInclusive1=n)}else this.m_bClipTopBottomFrom=!0,this.m_bInclusive1=!0}setHorizon2(t,e){const s=t.getOutputSR();if(1===s.getCoordinateSystemType())return this.m_horizon2=null,void(this.m_bInclusive2=!1);let i=null;const n=new u,o=s.getGCSHorisonIsInclusive();i=s.getGCSHorizon(),i.queryEnvelope(n);const r=s.getCentralMeridian();if(this.m_bIsPannableTo){const t=new c({xmin:this.m_pannableExtentGcsTo.xmin,ymin:n.ymin,xmax:this.m_pannableExtentGcsTo.xmax,ymax:n.ymax});t.centerAt(r,0),i=t}this.m_horizon2=i,this.m_bInclusive2=o}checkAndSetStages(t,e){const s=t.getOutputSR().getGCSSplitLines();if(!this.m_horizon2&&!s)return void(this.m_stages=1);if(this.m_horizon2.getGeometryType()===r.enumEnvelope){const t=new u;this.m_horizon2.queryEnvelope(t);const e=t.width(),s=t.height();e>=d/this.m_rpuGcsTo&&s>=Math.PI/this.m_rpuGcsTo&&(this.m_horizon2=null)}if(this.m_horizon2||s){if(null!==this.m_horizon2&&!this.m_bNeedsGeoTransform&&!this.m_bSrFromIsPcs){const e=t.getOutputSR().getGCS();return t.getInputSR().equals(e)?(this.m_horizon1=this.m_horizon2,this.m_bInclusive1=this.m_bInclusive2,this.m_bClipTopBottomFrom=!1,this.m_horizon2=null,this.m_bInclusive2=!1,void(this.m_stages=1)):void(this.m_stages=2)}this.m_stages=3}else this.m_stages=1}execute_(t,e,n,o){if(!this.m_bNeedsShapePreservingProject)return(new b).execute(t,this.m_inputTransform,o);if(!t)return null;s(t),i(t);let a,c=t.getGeometryType();return h(c)?(a=W(t),c=r.enumPolyline):a=t,a.isEmpty()?a:m(c)?this.executeEx(t,e,n,o):(new b).execute(t,this.m_inputTransform,o)}executeEx(t,e,s,i){let n;t.hasNonLinearSegments()&&a(""),n=this.m_bIsPannableFrom?(new b).foldInto360Range(t,this.m_transform1.getInputSR()):t;let o,r=s;return r>0||(r=100*this.m_toTolerance),o=1===this.m_stages?this.executeGood(n,e,r,i):2===this.m_stages?this.executeBad(n,e,r,i):this.executeUgly(n,e,r,i),this.filterOverDensification(o,this.m_inputTransform.getOutputSR(),r,i)}executeGood(t,e,s,i){const n=s*s;let o,r;return o=e>0?this.getMinLengthInSrFrom(e):this.getMinLengthInSrFrom(1e-5),r=this.m_bClipTopBottomFrom?x(t,this.m_transform1.getInputSR()):$(t,this.m_transform1.getInputSR(),this.m_horizon1,this.m_bInclusive1,this.m_bIsPannableFrom,this.m_pannableExtentFrom,!0,Number.NaN,i),r=F(r,this.m_transform1.getOutputSR(),i),r=j(r,this.m_transform1,this.m_bIsPannableFrom,this.m_pannableExtentFrom,this.m_bIsPannableTo,this.m_pannableExtentTo,null,null,null,null,o,n,i),r=(new b).execute(r,this.m_transform1,i),r}executeBad(t,e,s,i){let n;n=e>0?e*(Math.PI/180/this.m_rpuGcsTo):Math.PI/180/this.m_rpuGcsTo*1e-5;const o=s*s;let r;return r=this.m_bClipTopBottomFrom?x(t,this.m_transform1.getInputSR()):t,r=(new b).execute(r,this.m_transform1,i),r=$(r,this.m_transform2.getInputSR(),this.m_horizon2,this.m_bInclusive2,!0,this.m_pannableExtentGcsTo,!0,Number.NaN,i),r=F(r,this.m_transform2.getOutputSR(),i),r=j(r,this.m_transform2,!0,this.m_pannableExtentGcsTo,this.m_bIsPannableTo,this.m_pannableExtentTo,null,null,null,null,n,o,i),r=(new b).execute(r,this.m_transform2,i),r}executeUgly(t,e,s,i){const n=s*s;let o;o=e>0?this.getMinLengthInSrFrom(e):this.getMinLengthInSrFrom(1e-5);let r=null;r=this.m_bClipTopBottomFrom?x(t,this.m_transform1.getInputSR()):$(t,this.m_transform1.getInputSR(),this.m_horizon1,this.m_bInclusive1,this.m_bIsPannableFrom,this.m_pannableExtentFrom,!0,Number.NaN,i);let h=r;const m=new L(this.m_horizon2,this.m_transform2.getInputSR(),this.m_bInclusive2,this.m_pannableExtentGcsTo),a=this.m_transform2.getOutputSR().getGCSSplitLines(),c=new R(a,this.m_transform1,this.m_pannableExtentGcsTo);if(r=j(r,this.m_transform1,this.m_bIsPannableFrom,this.m_pannableExtentFrom,this.m_bIsPannableTo,this.m_pannableExtentTo,this.m_transform2,m,this.m_pannableExtentGcsTo,c,o,n,i),null!==r){h=null,r=(new b).execute(r,this.m_transform1,i);const t=Math.PI/180/this.m_rpuGcsTo*2;return r=$(r,this.m_transform2.getInputSR(),this.m_horizon2,this.m_bInclusive2,!0,this.m_pannableExtentGcsTo,!1,t,i),r=(new b).execute(r,this.m_transform2,i),r}let l=Number.NaN;l=s>0?s:100*this.m_toTolerance,l/=this.m_rpuGcsTo*this.m_aTo/this.m_mpuTo;const u=l*l;let f;return r=j(h,this.m_transform1,this.m_bIsPannableFrom,this.m_pannableExtentFrom,!0,this.m_pannableExtentGcsTo,null,null,null,null,o,u,i),h=null,r=(new b).execute(r,this.m_transform1,i),f=e>0?e*(Math.PI/180/this.m_rpuGcsTo):Math.PI/180/this.m_rpuGcsTo*1e-5,r=$(r,this.m_transform2.getInputSR(),this.m_horizon2,this.m_bInclusive2,!0,this.m_pannableExtentGcsTo,!1,Number.NaN,i),r=F(r,this.m_transform2.getOutputSR(),i),r=j(r,this.m_transform2,!0,this.m_pannableExtentGcsTo,this.m_bIsPannableTo,this.m_pannableExtentTo,null,null,null,null,f,n,i),r=(new b).execute(r,this.m_transform2,i),r}getMinLengthInSrFrom(t){let e;return e=this.m_bSrFromIsPcs?this.m_aFrom*(t*Math.PI/180)/this.m_mpuFrom:t*Math.PI/180*(1/this.m_rpuFrom),e}filterOverDensification(t,e,s,i){let n=X(t,s);return n.dropAttribute(10),n!==t&&n.getGeometryType()===r.enumPolygon&&(n=(new C).execute(n,e,!1,i)),n}}function X(t,e){if(t.isEmpty()||!t.hasAttribute(10))return t;const s=e*e;let i=t.getAttributeStreamRef(10),n=!1;const o=new _,r=[];let h=!1;for(let a=0,c=t.getPathCount();a<c;a++){const e=t.getPathStart(a),m=t.getPathEnd(a),c=t.isClosedPath(a);if(!(m>e))continue;{const t=c?e:m-1;0===i.read(e)&&0===i.read(t)||(n||(i=i.clone(),n=!0),i.write(e,0),i.write(t,0))}const l=c?m+1:m;let u=e;for(let a=e;a<l;a++){const c=a===m?e:a;if(0===i.read(c)){if(a-u>1){r.push({from:u,to:a});const c=new p;for(;r.length>0;){const a=r.at(-1);r.pop(),o.setStartXY(t.getXY(a.from));const l=a.to===m?e:a.to;o.setEndXY(t.getXY(l));let u=s,f=-1;for(let e=a.from+1,s=a.to;e<s;e++){const s=t.getXY(e),i=o.getClosestCoordinate(s,!1);o.queryCoord2D(i,c);const n=p.sqrDistance(c,s);u<n&&(u=n,f=e)}f>=0?(n||(i=i.clone(),n=!0),i.write(f,0),f-a.from>1&&r.push({from:a.from,to:f}),a.to-f>1&&r.push({from:f,to:a.to})):h=!0}}u=c}}}if(!h)return t;const m=A(t,i,1);return m.dropAttribute(10),m}function A(t,e,s){const i=t.createInstance(),n=new l;for(let o=0,r=t.getPathCount();o<r;o++){let r=!0,h=0,m=0;const a=t.getPathStart(o),c=t.getPathEnd(o);let l=!0;for(let u=a;u<c;u++){e.read(u)===s?(!l&&m>0&&(i.addSegmentsFromPath(t,o,h-a,m,r),m=0),l=!0):l?(l=!1,t.getPointByVal(u,n),r?(i.startPathPoint(n),r=!1):i.lineToPoint(n),h=u):m++}m>0&&i.addSegmentsFromPath(t,o,h-a,m,r)}return i}const Y=8;function H(t,e){const s=.5;for(let i=0;i<t;i++){let n=Math.ceil(i/2)/(t+1);i%2!=0&&(n=-n);const o=s+n;e[i]=o}}function O(t){if(!t)return!1;const e=t.getCoordinateSystemType();return 2===e||1===e}function j(t,e,s,i,n,o,r,h,m,a,c,l,u){const f=t.createInstance();f.addAttribute(10);const _=t.querySegmentIterator(),d=[],p=[],P=new g,T=t.getDescription().getAttributeCount()>1,b=new lt(e,s,i,n,o,r,h,a,c,l,T?p:null,d,u);for(;_.nextPath();)for(;_.hasNextSegment();){const t=_.nextSegment(),e=t.getStartXY(),s=t.getEndXY(),i=e.compare(s)>0,n=J(i,t,P);d.length=0,p.length=0;if(!b.densifySegment(_.isFirstSegmentInPath(),n))return null;i&&K(T?p:null,d),d.at(-1).setCoordsPoint2D(t.getEndXY());const o=f.getPointCount();if(T){const e=J(i,t,P);U(_.isFirstSegmentInPath(),_.isLastSegmentInPath()&&!_.isPathClosed(),t,e,p,d,f)}else B(_.isFirstSegmentInPath(),_.isLastSegmentInPath()&&!_.isPathClosed(),d,f);if(b.needsPostFiltering()){f.addAttribute(10);const t=f.getAttributeStreamRef(10);for(let e=1,s=d.length-1;e<s;e++)t.write(e+o,1)}}return f}function B(t,e,s,i){t&&i.insertPath2D(-1,null,0,0,!0);const n=i.getPathCount()-1;e?i.insertPointsFromPoints(n,-1,s,0,s.length,!0):i.insertPointsFromPoints(n,-1,s,0,s.length-1,!0)}function U(t,e,s,i,n,o,r){r.reserve(r.getPointCount()+o.length-1);const h=new l;if(s.queryStart(h),t?r.startPathPoint(h):r.lineToPoint(h),o.length>2){const t=i.calculateLength2D();for(let e=1;e<o.length-1;e++){const s=i.lengthToT(n[e]*t);i.queryCoord(s,h),h.setXY(o[e]),r.lineToPoint(h)}}e&&(s.queryEnd(h),r.lineToPoint(h))}function W(t){const e=new f({vd:t.getDescription()});return e.addSegment(t,!0),e}function Q(t,e){const s=e.getInputSR(),i=e.getOutputSR(),n=new p;2===s.getCoordinateSystemType()?(n.setCoordsPoint2D(t),G(s,0,[n],1)):n.setCoordsPoint2D(t);const o=new p;o.setCoordsPoint2D(n),v(e,[o],null,1,!1);const r=new p;return 2===i.getCoordinateSystemType()?(r.setCoordsPoint2D(o),z(i,[r],1,!1)):r.setCoordsPoint2D(o),r}function V(t,e,s,i,n,o,r,h){if(n){const n=o.width(),m=.5*n;if(i){const i=.25*n;let o=!1;const a=new p,c=new p;if(Math.abs(t.y)===i?(a.setCoords(s.x,t.y),c.setCoordsPoint2D(s),o=!0):Math.abs(s.y)===i&&(c.setCoords(t.x,s.y),a.setCoordsPoint2D(t),o=!0),Math.abs(e.y)===i&&(o||(a.setCoordsPoint2D(t),c.setCoordsPoint2D(s),o=!0),a.x=e.x),o)return ot(e,a,m,n,r),ot(e,c,m,n,h),!0}let a=0;t.x-e.x>m&&s.x-e.x>m?a-=n:e.x-t.x>m&&e.x-s.x>m&&(a+=n),Math.abs(e.x-(t.x+a))<m?(r.setCoordsPoint2D(t),ot(r,s,m,n,h),r.x+=a,h.x+=a):(r.setCoordsPoint2D(s),ot(r,t,m,n,h),r.x+=a,h.x+=a)}else r.setCoordsPoint2D(t),h.setCoordsPoint2D(s);return!1}function J(t,e,s){return t?(s.create(e.getGeometryType()),e.copyTo(s.get()),s.get().reverse(),s.get()):e}function K(t,e){e.reverse(),null!==t&&t.reverse()}function Z(t,e,s,i){const n=.5*(i.getStartX()+i.getEndX());if(n-s>t){const t=new T;t.setShiftCoords(-e,0),i.applyTransformation(t)}else if(s-n>t){const t=new T;t.setShiftCoords(e,0),i.applyTransformation(t)}}function $(t,e,s,i,n,o,r,h,m){const a=[!1];r&&tt(t,e,s,i,n,o,!0,h,a,m);let c=t;return a[0]||(c=tt(c,e,s,i,n,o,!1,h,null,m)),c=it(c,n,o,c!==t),c}function tt(t,e,s,i,n,o,h,m,a,c){if(h&&(a[0]=!1),null==s)return t;const l=new u,f=new u;s.queryEnvelope(l),t.queryEnvelope(f);const g=t.getGeometryType(),_=s.getGeometryType(),d=e.getTolerance(0);if(!n){if(h)return a[0]=st(t,s,e,i,c),null;let n;return n=i?_===r.enumEnvelope?k(t,l,d,m,c):(new y).execute(t,s,e,c):(new w).execute(t,s,e,c),n===s&&(n=s.clone()),n}const p=o.width(),P=p*Math.ceil(l.width()/p);let b=null;if(i){let o=nt(t,s,n,P),D=0;const S=new T;do{let n=null;if(_===r.enumEnvelope){const r=s.clone();if(S.setShiftCoords(o*P,0),r.applyTransformation(S),h){if(a[0]=st(t,r,e,i,c),!a[0])return null}else{const e=new u;r.queryEnvelope(e),n=k(t,e,d,m,c)}}else{const r=t.clone();if(S.setShiftCoords(-o*P,0),r.applyTransformation(S),h){if(a[0]=st(r,s,e,i,c),!a[0])return null}else n=(new y).execute(r,s,e,c),n===s&&(n=s.clone())}if(!h){if(n.isEmpty())continue;if(g===r.enumPolygon){const t=new u;if(n.queryEnvelope(t),t.width()<=d)continue}_===r.enumEnvelope&&(S.setShiftCoords(-o*P,0),n===t&&(n=n.clone()),n.applyTransformation(S)),null===b?b=n===t?n.clone():n:b.add(n,!1)}D++}while(l.xmin+ ++o*P<f.xmax);if(h)return null;null===b&&(b=t.createInstance()),g===r.enumPolygon&&D>1&&p-f.width()<=10*d&&(b=(new C).execute(b,e,!0,c))}else{let o=nt(t,s,n,P);if(b=t.clone(),0!==o){const t=new T;t.setShiftCoords(-o*P,0),b.applyTransformation(t)}do{if(h){if(a[0]=st(b,s,e,i,c),!a[0])return null}else if(b=(new w).execute(b,s,e,c),b===s&&(b=s.clone()),b.isEmpty())break;const t=new T;t.setShiftCoords(-P,0),b.applyTransformation(t)}while(l.xmin+ ++o*P<f.xmax);if(h)return null;if(!b.isEmpty()&&0!==o){const t=new T;t.setShiftCoords(o*P,0),b.applyTransformation(t)}}return b}function et(t,e,s,i,n,o,r){const h=[!1];return tt(t,s,e,i,n,o,!0,Number.NaN,h,r),h[0]}function st(t,e,s,i,n){let o;if(e.getGeometryType()===r.enumPolygon)if(i){o=E(e,t,s,64,n)}else{o=E(e,t,s,4,n)}else if(i){const s=new u,i=new u;e.queryEnvelope(s),t.queryEnvelope(i);o=s.containsEnvelope(i)}else{o=E(e,t,s,4,n)}return o}function it(t,e,s,i){let n;if(!e)return t;const o=s.getCenter().x,r=s.width(),h=.5*r,m=new u;t.queryEnvelope(m);const a=m.getCenter().x;let c=0;if(a-o>h){c=-Math.ceil((a-o-h)/r)*r}else if(o-a>h){c=Math.ceil((o-a-h)/r)*r}if(0!==c){n=i?t:t.clone();const e=new T;e.setShiftCoords(c,0),n.applyTransformation(e)}else n=t;return n}function nt(t,e,s,i){if(!s)return 0;let n=0;const o=new u;e.queryEnvelope(o);const r=new u;t.queryEnvelope(r);const h=o.xmin+i;for(;h+i+n*i>r.xmin;)n--;for(;h+n*i<r.xmin;)n++;return n}function ot(t,e,s,i,n){e.x-t.x>s?n.setCoords(e.x-i,e.y):t.x-e.x>s?n.setCoords(e.x+i,e.y):n.setCoordsPoint2D(e)}function rt(t,e,s,i,n,o,r){Math.abs(t.y)===s?(o.setCoords(e.x,t.y),r.setCoordsPoint2D(e)):Math.abs(e.y)===s?(o.setCoordsPoint2D(t),r.setCoords(t.x,e.y)):(o.setCoordsPoint2D(t),ot(o,e,i,n,r))}function ht(t){return t.getUnit().getUnitToBaseFactor()}function mt(t){return t.getUnit().getUnitToBaseFactor()}function at(t){return t.getPECoordSys().getDatum().getSpheroid().getAxis()}function ct(t,e,s){return s<=.5?t+(e-t)*s:e-(e-t)*(1-s)}class lt{checkSegment(){for(let t=0;t<this.n;t++){if(null!==this.pSplitLines2Info&&this.pSplitLines2Info.hasSplitLines()&&!this.bCheckIfNoDensificationNeededForCurve){const t=this.pSplitLines2Info.getSplitLineFactorEx(this.rectifiedSegment,this.leftFactor,this.rightFactor,this.leftGcsToDensifiedPoint,this.rightGcsToDensifiedPoint,this.progressTracker);if(Number.isNaN(t))return-1;if(-1!==t&&this.leftFactor<t&&t<this.rightFactor)return this.cutFactor=t,this.cutFromDensifiedPoint.assign(this.rectifiedSegment.getCoord2D(this.cutFactor)),this.cutToDensifiedPoint.assign(Q(this.cutFromDensifiedPoint,this.transform)),this.cutGcsToDensifiedPoint.setCoordsPoint2D(this.cutToDensifiedPoint),this.cutToDensifiedPoint.assign(Q(this.cutGcsToDensifiedPoint,this.transform2)),this.midFactor=this.cutFactor,this.midFromDensifiedPoint.setCoordsPoint2D(this.cutFromDensifiedPoint),this.midToDensifiedPoint.setCoordsPoint2D(this.cutToDensifiedPoint),this.midGcsToDensifiedPoint.setCoordsPoint2D(this.cutGcsToDensifiedPoint),1}if(this.cutFactor=ct(this.leftFactor,this.rightFactor,this.scalars[t]),this.cutFromDensifiedPoint.assign(this.rectifiedSegment.getCoord2D(this.cutFactor)),this.cutToDensifiedPoint.assign(Q(this.cutFromDensifiedPoint,this.transform)),null!==this.transform2&&(this.cutGcsToDensifiedPoint.setCoordsPoint2D(this.cutToDensifiedPoint),this.cutToDensifiedPoint.assign(Q(this.cutGcsToDensifiedPoint,this.transform2))),0===t&&(this.midFactor=this.cutFactor,this.midFromDensifiedPoint.setCoordsPoint2D(this.cutFromDensifiedPoint),this.midToDensifiedPoint.setCoordsPoint2D(this.cutToDensifiedPoint),this.midGcsToDensifiedPoint.setCoordsPoint2D(this.cutGcsToDensifiedPoint)),this.bIsPannableFrom&&!this.bCheckIfNoDensificationNeededForCurve&&Math.abs(this.leftFromDensifiedPoint.x-this.rightFromDensifiedPoint.x)>=.25*this.pannableExtentFrom.width())return 1;let e;if(this.bCheckIfNoDensificationNeededForCurve){const t=this.projCurveSegment.get().getClosestCoordinate(this.cutToDensifiedPoint,!1),s=this.projCurveSegment.get().getCoord2D(t);e=p.sqrDistance(this.cutToDensifiedPoint,s)}else{const s=new p,i=new p,n=V(this.leftToDensifiedPoint,this.cutToDensifiedPoint,this.rightToDensifiedPoint,this.bSrToIsGcs,this.bIsPannableTo,this.pannableExtentTo,s,i);this.line.setStartXY(s),this.line.setEndXY(i);const o=this.line.getClosestCoordinate(this.cutToDensifiedPoint,!0);if(n||t>0||Math.abs(o-this.scalars[t])<.3){const t=this.line.getCoord2D(o);e=p.sqrDistance(this.cutToDensifiedPoint,t)}else e=2*this.maxDeviationInSrToSq,this.bNeedPostFiltering=!0}if(e>this.maxDeviationInSrToSq)return this.bCheckIfNoDensificationNeededForCurve=!1,1}return 0}constructor(t,e,s,i,n,o,r,h,m,a,c,l,f){this.leftFromDensifiedPoint=new p,this.rightFromDensifiedPoint=new p,this.cutFromDensifiedPoint=new p,this.midFromDensifiedPoint=new p,this.leftToDensifiedPoint=new p,this.rightToDensifiedPoint=new p,this.cutToDensifiedPoint=new p,this.midToDensifiedPoint=new p,this.line=new _,this.leftGcsToDensifiedPoint=new p,this.rightGcsToDensifiedPoint=new p,this.cutGcsToDensifiedPoint=new p,this.midGcsToDensifiedPoint=new p,this.bSrToIsGcs=!1,this.bIsCurve=!1,this.leftFactor=0,this.rightFactor=0,this.bIsFirstInPath=!1,this.rectifiedSegment=null,this.transform=null,this.bIsPannableFrom=!1,this.pannableExtentFrom=new u,this.bIsPannableTo=!1,this.bNeedPostFiltering=!1,this.pannableExtentTo=new u,this.transform2=null,this.pHorizon2Info=null,this.pSplitLines2Info=null,this.minLengthInSrFrom=0,this.maxDeviationInSrToSq=0,this.cutFactor=0,this.midFactor=0,this.pDensifiedFactors=null,this.pDensifiedPoints=[],this.rightFromDensifiedPointsStack=[],this.rightToDensifiedPointsStack=[],this.rightGcsToDensifiedPointsStack=[],this.rightFactorsStack=[],this.projCurveSegment=new g,this.n=0,this.bCheckIfNoDensificationNeededForCurve=!1,this.scalars=P(Y-1,Number.NaN),this.progressTracker=f,this.transform=t,this.bIsPannableFrom=e,this.pannableExtentFrom.assign(s),this.bIsPannableTo=i,this.pannableExtentTo.assign(n),this.transform2=o,this.pHorizon2Info=r,this.pSplitLines2Info=h,this.minLengthInSrFrom=m,this.maxDeviationInSrToSq=a,this.pDensifiedFactors=c,this.pDensifiedPoints=l,this.progressTracker=f,this.bNeedPostFiltering=!1}needsPostFiltering(){return this.bNeedPostFiltering}densifySegment(t,e){if(this.bIsFirstInPath=t,this.rectifiedSegment=e,this.leftGcsToDensifiedPoint.setNAN(),this.rightGcsToDensifiedPoint.setNAN(),this.cutGcsToDensifiedPoint.setNAN(),this.midGcsToDensifiedPoint.setNAN(),this.bSrToIsGcs=null!=this.transform2?1===this.transform2.getOutputSR().getCoordinateSystemType():1===this.transform.getOutputSR().getCoordinateSystemType(),this.bIsCurve=this.rectifiedSegment.isCurve(),this.leftFactor=0,this.rightFactor=1,this.leftFromDensifiedPoint.assign(this.rectifiedSegment.getStartXY()),this.rightFromDensifiedPoint.assign(this.rectifiedSegment.getEndXY()),this.leftToDensifiedPoint.assign(Q(this.leftFromDensifiedPoint,this.transform)),this.rightToDensifiedPoint.assign(Q(this.rightFromDensifiedPoint,this.transform)),null!==this.transform2&&(this.leftGcsToDensifiedPoint.setCoordsPoint2D(this.leftToDensifiedPoint),this.rightGcsToDensifiedPoint.setCoordsPoint2D(this.rightToDensifiedPoint),this.leftToDensifiedPoint.assign(Q(this.leftGcsToDensifiedPoint,this.transform2)),this.rightToDensifiedPoint.assign(Q(this.rightGcsToDensifiedPoint,this.transform2)),this.bIsFirstInPath&&!this.pHorizon2Info.isPointStartInHorizon(this.leftGcsToDensifiedPoint,this.progressTracker)))return!1;this.rightFromDensifiedPointsStack.length=0,this.rightToDensifiedPointsStack.length=0,this.rightGcsToDensifiedPointsStack.length=0,this.rightFactorsStack.length=0,this.rightFromDensifiedPointsStack.push(this.rightFromDensifiedPoint.clone()),this.rightToDensifiedPointsStack.push(this.rightToDensifiedPoint.clone()),this.rightFactorsStack.push(this.rightFactor),null!=this.transform2&&this.rightGcsToDensifiedPointsStack.push(this.rightGcsToDensifiedPoint.clone()),null!==this.pDensifiedPoints&&this.pDensifiedPoints.push(this.leftFromDensifiedPoint.clone()),null!==this.pDensifiedFactors&&this.pDensifiedFactors.push(this.leftFactor),this.bIsCurve?this.rectifiedSegment.getGeometryType()===r.enumBezier?this.n=Y-1:this.n=5:this.n=3,H(this.n,this.scalars);const s=this.rectifiedSegment.calculateLength2D();if(this.bCheckIfNoDensificationNeededForCurve=!1,this.bIsCurve){const t=new f({vd:this.rectifiedSegment.getDescription()});let e=(new b).execute(t,this.transform,this.progressTracker);if(null!==this.transform2){const t=new u;if(e.queryEnvelope(t),!this.pHorizon2Info.isEnvelopeInHorizon(t,this.progressTracker))return!1;e=(new b).execute(e,this.transform2,this.progressTracker)}e.getSegmentBuffer(0,this.projCurveSegment,!1),this.bCheckIfNoDensificationNeededForCurve=!0}for(;this.rightFromDensifiedPointsStack.length>0;){let t=!1;if(this.cutFactor=Number.NaN,this.midFactor=Number.NaN,this.midFromDensifiedPoint.setNAN(),this.midToDensifiedPoint.setNAN(),(this.rightFactor-this.leftFactor)*s>this.minLengthInSrFrom){const e=this.checkSegment();if(-1===e)return!1;t=0!==e}if(t)this.rightFromDensifiedPoint.setCoordsPoint2D(this.midFromDensifiedPoint),this.rightToDensifiedPoint.setCoordsPoint2D(this.midToDensifiedPoint),this.rightFactor=this.midFactor,this.rightFromDensifiedPointsStack.push(this.rightFromDensifiedPoint.clone()),this.rightToDensifiedPointsStack.push(this.rightToDensifiedPoint.clone()),this.rightFactorsStack.push(this.rightFactor),null!==this.transform2&&(this.rightGcsToDensifiedPoint.setCoordsPoint2D(this.midGcsToDensifiedPoint),this.rightGcsToDensifiedPointsStack.push(this.rightGcsToDensifiedPoint.clone()));else{if(null!==this.transform2&&!this.pHorizon2Info.isAdjoiningLineInHorizon(this.leftGcsToDensifiedPoint,this.rightGcsToDensifiedPoint,this.progressTracker))return!1;if(this.rightFromDensifiedPointsStack.pop(),this.rightToDensifiedPointsStack.pop(),this.rightFactorsStack.pop(),null!==this.transform2&&this.rightGcsToDensifiedPointsStack.pop(),null!==this.pDensifiedPoints&&this.pDensifiedPoints.push(this.rightFromDensifiedPoint.clone()),null!==this.pDensifiedFactors&&this.pDensifiedFactors.push(this.rightFactor),this.rightFromDensifiedPointsStack.length>0){this.leftFromDensifiedPoint.setCoordsPoint2D(this.rightFromDensifiedPoint),this.leftToDensifiedPoint.setCoordsPoint2D(this.rightToDensifiedPoint),this.leftFactor=this.rightFactor;const t=this.rightFromDensifiedPointsStack.at(-1),e=this.rightToDensifiedPointsStack.at(-1);if(this.rightFromDensifiedPoint.setCoordsPoint2D(t),this.rightToDensifiedPoint.setCoordsPoint2D(e),this.rightFactor=this.rightFactorsStack.at(-1),null!==this.transform2){this.leftGcsToDensifiedPoint.setCoordsPoint2D(this.rightGcsToDensifiedPoint);const t=this.rightGcsToDensifiedPointsStack.at(-1);this.rightGcsToDensifiedPoint.setCoordsPoint2D(t)}}}}return!0}}class ut{getOperatorType(){return 10315}supportsCurves(){return!1}accelerateGeometry(t,e,s){return!1}canAccelerateGeometry(t){return!1}executeMany(t,e,s,i,n,o){return q(s)?new ft(t,e,s,i,n,o):(new b).executeMany(t,s,o)}execute(t,e,s,i,n){if(!q(e))return(new b).execute(t,e,n);const o=new M;return o.prepare(e,null,n),o.execute(t,s,i,n)}}class ft extends t{constructor(t,s,i,n,o,r){super(),this.m_spp=null,this.m_index=-1,t||e(""),this.m_progressTracker=r,this.m_geometries=t,this.m_geometriesExtent=s?s.clone():null,this.m_transform=i,this.m_minSegmentLengthInDegrees=n,this.m_maxDeviationInSrTo=o}tock(){return!0}getRank(){return 1}next(){this.m_spp||(this.m_spp=new M,this.m_spp.prepare(this.m_transform,this.m_geometriesExtent,this.m_progressTracker));const t=this.m_geometries.next();return s(t),i(t),null!=t?(this.m_index=this.m_geometries.getGeometryID(),this.m_spp.execute(t,this.m_minSegmentLengthInDegrees,this.m_maxDeviationInSrTo,this.m_progressTracker)):null}getGeometryID(){return this.m_index}}export{ut as OperatorShapePreservingProject};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{S as e,G as r}from"./SimpleGeometryCursor.js";import{d as t,a as s,c as i}from"./Geometry.js";import{
|
|
5
|
+
import{S as e,G as r}from"./SimpleGeometryCursor.js";import{d as t,a as s,c as i}from"./Geometry.js";import{M as n,N as m}from"./UnitFactory.js";class o{getOperatorType(){return 10104}accelerateGeometry(e,r,t){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}isSimple(e,r,t,s,i){return 5===n(e,r,t,s,i)}executeMany(e,r,t,s){return new u(e,r,t,s)}execute(r,s,i,n){const m=new e([r]),o=this.executeMany(m,s,i,n).next();return o||t("null output"),o}}class u extends r{constructor(e,r,t,i){super(),e||s(""),this.m_progressTracker=i,this.m_bForceSimplify=t,this.m_index=-1,this.m_inputGeometryCursor=e,this.m_spatialReference=r}next(){const e=this.m_inputGeometryCursor.next();return e?(i(e),this.m_index=this.m_inputGeometryCursor.getGeometryID(),this.simplify(e)):null}getGeometryID(){return this.m_index}tock(){return!1}getRank(){return 1}simplify(e){e||s("");return m(e,this.m_spatialReference,this.m_bForceSimplify,this.m_progressTracker)}}export{o as O};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
5
|
+
import{I as e,J as r}from"./UnitFactory.js";class t extends e{getOperatorType(){return 5}execute(e,t,s,a){return r(e,t,s,8,a)}}export{t as O};
|
package/chunks/OperatorWithin.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
5
|
+
import{I as e,J as r}from"./UnitFactory.js";class t extends e{getOperatorType(){return 7}execute(e,t,s,a){return r(e,t,s,2,a)}}export{t as O};
|
package/chunks/Point2D.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{t,g as s,q as i,a as e}from"./Geometry.js";class n{constructor(t){this.sum=t,this.compensation=0}assign(t){return this.compensation=t.compensation,this.sum=t.sum,this}reset(){this.sum=this.compensation=0}resetToStart(t){this.sum=t,this.compensation=0}normalize(){const t=[Number.NaN];this.sum=lt(this.sum,this.compensation,t),this.compensation=t[0]}add(t){const s=this.sum+t;let i;if(Math.abs(this.sum)>=Math.abs(t)){const e=this.sum-s+t;i=this.compensation+e}else{const e=t-s+this.sum;i=this.compensation+e}this.sum=s,this.compensation=i}sub(t){this.add(-t)}addProduct(t,s){const i=[0],e=ut(t,s,i);this.add(e),this.add(i[0])}mul(t){const s=new n(0);s.addProduct(this.sum,t),s.addProduct(this.compensation,t),this.assign(s)}getResult(){return this.sum+this.compensation}pe(t){return this.add(t),this}me(t){return this.add(-t),this}}const r=0x00000000ffffffffn,u=0x0000ffffn,h=0x000000ffn,a=0x0fn,o=0xffff0000n,m=0xff00n,l=0xf0n,c=[5,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1],f=[-1,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3];function _(t){let s=0;return t&u||(s+=16,t>>=16n),t&h||(s+=8,t>>=8n),t&a||(s+=4,t>>=4n),s+c[Number(BigInt.asUintN(4,t))]}function v(t){let s=0;return t&o&&(s+=16,t>>=16n),t&m&&(s+=8,t>>=8n),t&l&&(s+=4,t>>=4n),s+f[Number(BigInt.asUintN(4,t))]+1}function b(t){let s=0;return t&r||(s=32,t>>=32n),s+_(BigInt.asUintN(32,t))}function d(t){let s=0;return 0xffffffff00000000n&t&&(s=32,t>>=32n),s+v(t)}class x{constructor(t,s){if(this.m_EnvelopeType=1,void 0!==t){if(t instanceof x)return this.vmin=t.vmin,void(this.vmax=t.vmax);this.vmin=t,this.vmax=s,this.normalize()}else this.setEmpty()}static construct(t,s){return new x(t,s)}static constructEmpty(){return new x}setCoords(t,s){this.vmin=t,this.vmax=s,this.normalize()}setCoordsFromEnvelope(t){this.vmin=t.vmin,this.vmax=t.vmax}setEmpty(){this.vmin=Number.NaN,this.vmax=Number.NaN}getCenter(){return.5*(this.vmin+this.vmax)}equalsRange(t,s){return ls(this.vmin,t)&&ls(this.vmax,s)}equals(t,s){return!(!this.isEmpty()||!t.isEmpty())||(void 0!==s?Math.abs(this.vmin-t.vmin)<=s&&Math.abs(this.vmax-t.vmax)<=s:this.vmin===t.vmin&&this.vmax===t.vmax)}width(){return this.vmax-this.vmin}isEmpty(){return Number.isNaN(this.vmin)||Number.isNaN(this.vmax)}isZero(){return this.vmin===this.vmax}setInfinite(){this.vmin=Number.NEGATIVE_INFINITY,this.vmax=Number.POSITIVE_INFINITY}move(t){this.isEmpty()||(this.vmin+=t,this.vmax+=t)}contains(t){return t.vmin>=this.vmin&&t.vmax<=this.vmax}containsCoordinate(t){return t>=this.vmin&&t<=this.vmax}containsRightExclusive(t){return t>=this.vmin&&t<this.vmax}containsExclusiveCoordinate(t){return t>this.vmin&&t<this.vmax}containsExclusive(t){return t.vmin>this.vmin&&t.vmax<this.vmax}isIntersecting(t){return this.vmin<=t.vmin?this.vmax>=t.vmin:t.vmax>=this.vmin}mergeCoordinate(t){if(this.isEmpty())return this.vmin=t,void(this.vmax=t);this.mergeNeCoordinate(t)}merge(t){if(t.isEmpty())return;const s=t.vmin,i=t.vmax;this.mergeCoordinate(s),this.mergeCoordinate(i)}mergeNe(t){const s=t.vmin,i=t.vmax;this.mergeNeCoordinate(s),this.mergeNeCoordinate(i)}mergeNeCoordinate(t){t<this.vmin?this.vmin=t:t>this.vmax&&(this.vmax=t)}intersect(t){this.isEmpty()||t.isEmpty()?this.setEmpty():(this.vmin<t.vmin&&(this.vmin=t.vmin),this.vmax>t.vmax&&(this.vmax=t.vmax),this.vmin>this.vmax&&this.setEmpty())}inflate(t){this.isEmpty()||(this.vmin-=t,this.vmax+=t,this.vmax<this.vmin&&this.setEmpty())}normalize(){this.vmin<=this.vmax||(this.vmin>this.vmax?this.vmax=Pt(this.vmin,this.vmin=this.vmax):this.setEmpty())}isValid(){return this.isEmpty()||this.vmin<=this.vmax}snapClip(t){return Us(t,this.vmin,this.vmax)}calculateToleranceFromEnvelope(){if(this.isEmpty())return Ls();return(Math.abs(this.vmin)+Math.abs(this.vmax)+1)*Ls()}static unit(){return N}normalizeNoNAN(){this.vmin>this.vmax&&(this.vmax=Pt(this.vmin,this.vmin=this.vmax))}setCoordsNoNAN(t,s){this.vmin=t,this.vmax=s,this.normalizeNoNAN()}clone(){return new x(this.vmin,this.vmax)}}const N=new x(0,1);class p{static getNAN(){return new p(Number.NaN)}constructor(t,s){this.m_value=t??0,this.m_eps=s??0}[Symbol.toPrimitive](t){return this}clone(){return new p(this.m_value,this.m_eps)}assign(t){return this.m_value=t.m_value,this.m_eps=t.m_eps,this}scaleError(t){this.m_eps*=t}setError(t){this.m_eps=t}set(t,s){return this.m_value=t,this.m_eps=s??0,this}setWithEps(t,s){return void 0===s&&(s=1),this.m_value=t,this.m_eps=p.ulp(t)*s,this}setE(t){return this.m_value=t.m_value,this.m_eps=t.m_eps,this}precise(){return new p(this.m_value)}value(){return this.m_value}toDouble(){return this.m_value}eps(){return this.m_eps}resetError(){return this.m_eps=0,this}absThis(){return this.m_value=Math.abs(this.m_value),this}add(t){return this.clone().addThis(t)}addE(t){return this.clone().addThisE(t)}addThisE(t){const s=this.m_value+t.m_value,i=this.m_eps+t.m_eps+p.ulp(s);return this.m_value=s,this.m_eps=i,this}addThis(t){const s=this.m_value+t,i=this.m_eps+p.ulp(s);return this.m_value=s,this.m_eps=i,this}subE(t){return this.clone().subThisE(t)}sub(t){return this.clone().subThis(t)}subThisE(t){const s=this.m_value-t.m_value,i=this.m_eps+t.m_eps+p.ulp(s);return this.m_value=s,this.m_eps=i,this}subThis(t){const s=this.m_value-t,i=this.m_eps+p.ulp(s);return this.m_value=s,this.m_eps=i,this}setAddE(t,s){return this.m_value=t.m_value+s.m_value,this.m_eps=t.m_eps+s.m_eps+p.ulp(this.m_value),this}setAdd(t,s){return this.m_value=t+s,this.m_eps=p.ulp(this.m_value),this}setAddEN(t,s){return this.m_value=t.m_value+s,this.m_eps=t.m_eps+p.ulp(this.m_value),this}setAddNE(t,s){return this.m_value=t+s.m_value,this.m_eps=s.m_eps+p.ulp(this.m_value),this}setSubE(t,s){return this.m_value=t.m_value-s.m_value,this.m_eps=t.m_eps+s.m_eps+p.ulp(this.m_value),this}setSub(t,s){return this.m_value=t-s,this.m_eps=p.ulp(this.m_value),this}setSubEN(t,s){return this.m_value=t.m_value-s,this.m_eps=t.m_eps+p.ulp(this.m_value),this}setSubNE(t,s){return this.m_value=t-s.m_value,this.m_eps=s.m_eps+p.ulp(this.m_value),this}mulThisE(t){const s=this.m_value*t.m_value;return this.m_eps=this.m_eps*Math.abs(t.m_value)+t.m_eps*Math.abs(this.m_value)+this.m_eps*t.m_eps+p.ulp(s),this.m_value=s,this}mulThis(t){const s=this.m_value*t;return this.m_eps=this.m_eps*Math.abs(t)+p.ulp(s),this.m_value=s,this}mul(t){return this.clone().mulThis(t)}mulE(t){return this.clone().mulThisE(t)}setMulE(t,s){const i=t.m_value*s.m_value;return this.m_eps=t.m_eps*Math.abs(s.m_value)+s.m_eps*Math.abs(t.m_value)+t.m_eps*s.m_eps+p.ulp(i),this.m_value=i,this}setMul(t,s){return this.m_value=t*s,this.m_eps=p.ulp(this.m_value),this}setMulEN(t,s){return this.setE(t),this.mulThis(s)}setMulNE(t,s){return this.setE(s),this.mulThis(t)}mulThisByPower2(t){return this.m_value*=t,this.m_eps*=Math.abs(t),this}static st_mulByPower2(t,s){return new p(t.m_value,t.m_eps).mulThisByPower2(s)}divE(t){return this.clone().divThisE(t)}divThisE(t){const s=Math.abs(t.m_value),i=this.m_value/t.m_value;let e=(this.m_eps+Math.abs(i)*t.m_eps)/s;if(t.m_eps>.01*s){const i=t.m_eps/s;e*=1+(1+i)*i}return this.m_value=i,this.m_eps=e+p.ulp(i),this}divThis(t){const s=Math.abs(t);return this.m_value/=t,this.m_eps=this.m_eps/s+p.ulp(this.m_value),this}setDivE(t,s){return this.setE(t),this.divThisE(s)}setDiv(t,s){return this.m_value=t/s,this.m_eps=p.ulp(this.m_value),this}setDivEN(t,s){return this.setE(t),this.divThis(s)}setDivNE(t,s){return this.set(t),this.divThisE(s)}divThisByPower2(t){return this.m_value/=t,this.m_eps/=Math.abs(t),this}invThis(){return this.setE(w.clone().divThisE(this)),this}sqrt(){return this.clone().sqrtThis()}sqrtThis(){let t,s;return this.m_value>=0?(t=Math.sqrt(this.m_value),s=this.m_value>10*this.m_eps?.5*this.m_eps/t:this.m_value>this.m_eps?t-Math.sqrt(this.m_value-this.m_eps):Math.max(t,Math.sqrt(this.m_value+this.m_eps)-t),s+=p.ulp(t)):this.m_value<-this.m_eps?(t=Number.NaN,s=Number.NaN):(t=0,s=Math.sqrt(this.m_eps)),this.m_value=t,this.m_eps=s,this}sqr(){return this.clone().sqrThis()}sqrThis(){const t=this.m_value*this.m_value;return this.m_eps=2*this.m_eps*Math.abs(this.m_value)+this.m_eps*this.m_eps+p.ulp(t),this.m_value=t,this}setSin(t){const s=Math.sin(t.m_value),i=Math.cos(t.m_value);this.m_value=s;const e=Math.abs(s),n=Math.abs(t.value());return this.m_eps=(Math.abs(i)+.5*e*t.m_eps)*t.m_eps+p.ulp(e+n),this}static ulp(t){let s=us(t);const i=((0x7ff0000000000000n&s)>>52n)-1075n;return i>-1023n?(s=i+0x3ffn<<52n,hs(s)):0===t?0:Number.MIN_VALUE}setCos(t){const s=Math.sin(t.m_value),i=Math.cos(t.m_value);this.m_value=i;const e=Math.abs(i),n=Math.abs(t.value());return this.m_eps=(Math.abs(s)+.5*e*t.m_eps)*t.m_eps+p.ulp(e+n),this}static st_cosAndSin(t,s,i){const e=Math.sin(t.m_value),n=Math.cos(t.m_value);i.m_value=e,s.m_value=n;const r=Math.abs(e),u=Math.abs(n),h=Math.abs(t.value());i.m_eps=(Math.abs(n)+.5*r*t.m_eps)*t.m_eps+p.ulp(r+h),s.m_eps=(Math.abs(e)+.5*u*t.m_eps)*t.m_eps+p.ulp(u+h)}negate(){return this.clone().negateThis()}negateThis(){return this.m_value=-this.m_value,this}setAbs(){return this.m_value=Math.abs(this.m_value),this}isInInterval(t){return x.construct(this.m_value-this.m_eps,this.m_value+this.m_eps).isIntersecting(t)}eq(t){return Math.abs(this.m_value-t.m_value)<=this.m_eps+t.m_eps}ne(t){return!this.eq(t)}gt(t){return this.m_value-t.m_value>this.m_eps+t.m_eps}lt(t){return t.m_value-this.m_value>this.m_eps+t.m_eps}ge(t){return!this.lt(t)}le(t){return!this.gt(t)}tolEQ(t,s){return Math.abs(this.m_value-t.m_value)<=s||this.eq(t)}tolNE(t,s){return!this.tolEQ(t,s)}tolGT(t,s){return this.m_value-t.m_value>s&&this.gt(t)}tolLT(t,s){return t.m_value-this.m_value>s&&this.lt(t)}tolGE(t,s){return!this.tolLT(t,s)}tolLE(t,s){return!this.tolGT(t,s)}isZero(){return Math.abs(this.m_value)<=this.m_eps}isFuzzyZero(){return this.isZero()&&0!==this.m_eps}tolIsZero(t){return Math.abs(this.m_value)<=Math.max(this.m_eps,t)}setPi(){this.setE(E)}setEuler(){this.set(2.718281828459045,M())}static size(){return 1}}function y(t,s){const i=as(t),e=as(s),n=53-b(i),r=53-b(e);return(n>=0?n:0)+(r>=0?r:0)<=52}function T(t,s){const i=t+s;return i-t===s&&i-s===t}function g(t,s){const i=t-s;return t-i===s&&s+i===t}function M(){return Qs()}p.dimensions=1;const E=new p(Math.PI,.5*M()),I=new p(0,0),w=new p(1,0),D=new p(4,0);function A(t,s,i){return t.addE(s.subE(t).mulE(i))}function P(t,s,i){return s.subE(s.subE(t).mulE(w.subE(i)))}function q(t){return Math.atanh(t)}function z(t){let s;if(0===t)s=1;else if(Math.abs(t)>.01)s=q(t)/t;else{let i;const e=-36.841361487904734;s=0;const n=t*t;for(let t=2*Math.trunc(e/Math.log(n)+2.5)-1;t>1;t-=2)i=1/t,s=(s+i)*n;s+=1}return s}function Z(t){const s=Math.PI*Math.PI/6;let i;if(1===t)i=s;else if(t>1)i=s;else if(0===t)i=t;else if(t<0){const s=1+(t=Math.abs(t)),e=Math.log(s);i=e*e/-2-Z(t/s)}else if(t>.5){const e=1-t,n=Math.log(t)*Math.log(e);i=s-Z(e)-n}else{i=0;const s=1+Math.trunc(-16*Math.log(10)/Math.log(t)+1.5);let e=s;for(let n=s;n>0;n--,e-=1)i*=t,i+=1/(e*e);i*=t}return i}function C(t,s){const i=s*t;if(Math.abs(s)<.1){let s=0;for(let t=60;t>=1;t--)s*=i,s+=1/t/t;return s*=t,s}return Z(i)/s}function R(t,s){return t<s?$t(t,s):$t(s,t)}function B(t,s){const i=Math.abs(t);return s>=0?i:-i}function S(t){return Math.round(t)}function k(t,s,i,e,n){n[0]=s[0]+(i[0]-s[0])*e,n[1]=s[1]+(i[1]-s[1])*e,3===t&&(n[2]=s[2]+(i[2]-s[2])*e)}function F(t,s,i,e,n){n[0]=i[0]-(i[0]-s[0])*(1-e),n[1]=i[1]-(i[1]-s[1])*(1-e),3===t&&(n[2]=i[2]-(i[2]-s[2])*(1-e))}function L(t,s,i,e,n){e<=.5?k(t,s,i,e,n):F(t,s,i,e,n)}function O(t,s,i,e,n){n[0]=s[0].addE(i[0].subE(s[0]).mulE(e)),n[1]=s[1].addE(i[1].subE(s[1]).mulE(e))}function G(t,s,i,e,n){n[0]=i[0].subE(i[0].subE(s[0]).mulE(w.subE(e))),n[1]=i[1].subE(i[1].subE(s[1]).mulE(w.subE(e)))}function Q(t,s,i){let e;return e=i<=.5?t+(s-t)*i:s-(s-t)*(1-i),e}function V(t,s,i){return t+(s-t)*i}function U(t,s,i){return s-(s-t)*(1-i)}function Y(t,s,i,e){i<=.5?(e.x=t.x+(s.x-t.x)*i,e.y=t.y+(s.y-t.y)*i):(e.x=s.x-(s.x-t.x)*(1-i),e.y=s.y-(s.y-t.y)*(1-i))}function j(t,s,i,e){i<=.5?(e.x=t.x+(s.x-t.x)*i,e.y=t.y+(s.y-t.y)*i,e.z=t.z+(s.z-t.z)*i):(e.x=s.x-(s.x-t.x)*(1-i),e.y=s.y-(s.y-t.y)*(1-i),e.z=s.z-(s.z-t.z)*(1-i))}function H(t){return t*t}function $(t){return t*t*t}function J(t){return 1/Math.sqrt(t)}function K(t){return t<0?-1:t>0?1:0}function W(t,s,i,e){const n=[0],r=[0],u=[0];return lt(ut(t,i,n),ut(s,e,r),u)+(n[0]+r[0]+u[0])}const X=[0],tt=[0];function st(t,s,i){return mt(ut(t,s,X),i,X[0],tt)}const it=[0],et=[0],nt=[0],rt=[0];function ut(t,s,i){const e=t*s;return ht(t,it,et),ht(s,nt,rt),i[0]=et[0]*rt[0]-(e-it[0]*nt[0]-et[0]*nt[0]-it[0]*rt[0]),e}function ht(t,s,i){const e=134217729*t;s[0]=e-(e-t),i[0]=t-s[0]}const at=[0],ot=[0];function mt(t,s,i,e){const n=lt(t,s,at),r=lt(n,i,ot);return lt(r,at[0]+ot[0],e)}function lt(t,s,i){const e=t+s;return Math.abs(t)>Math.abs(s)?i[0]=t-e+s:i[0]=s-e+t,e}function ct(t,s){return t%s}function ft(t){const s=1-t;if(0===s)return 1;let i;if(s<=.01){const t=s,e=Math.log(t);i=1+t*(.4431471805599453-.25*e+t*(.05680519270997949-.09375*e+t*(.02183137044373718-.05859375*e+t*(.011544521417308362-.042724609375*e+t*(.00714200031339596-.0336456298828125*e+t*(.004854743337164948-.027757644653320312*e+t*(.003514687963781376-.023627042770385742*e)))))))}else{if(t<.016){const s=t,i=.25,e=.046875,n=.01953125,r=.01068115234375,u=.0067291259765625,h=.004626274108886719,a=.0033752918243408203,o=.0025710230693221092;return Js()*(1-s*(i+s*(e+s*(n+s*(r+s*(u+s*(h+s*(a+s*o))))))))}i=bt(0,s,1)-t*dt(0,s,1)/3}return Us(i,1,Js())}function _t(t,i,e=Number.NaN){if(s(i>=0&&i<=1),0===i)return t;let n=1,r=t;if(r<0&&(r=-r,n=-1),1===i){const t=Math.round(r/Hs()),s=r-t*Hs();return n*(2*t+Math.sin(s))}const u=Js(),h=Math.floor(r/u);1&h?r=(h+1)*u-r:r-=h*u;const a=Math.sin(r),o=Number.isNaN(e)?ft(i):e;let m;if(1===a)m=o+Math.sqrt(1-i)*(r-u);else{const t=r*r;if(.01424*Math.pow(t,4)<=2*Qs()){m=r*(1+t*i*(-1/6+t*((4-3*i)/120-(16+(45*i-60)*i)/5040*t)))}else if(i<=.01){const t=Math.sin(2*r),s=Math.sin(4*r),e=Math.sin(6*r),n=Math.sin(8*r),u=Math.sin(10*r);m=r+i*((2*-r+t)/8+i*((-3*r+2*t-.25*s)/64+i*((-20*r+15*t-3*s+e/3)/1024+i*(5*(-140*r+112*t-28*s+16/3*e-.5*n)/65536+7*i*((-63*r+52.5*t-15*s+3.75*e-.625*n+.05*u)/65536+i*(-693*r+594*t-185.625*s+1.375*e-12.375*n+1.8*u-.125*Math.sin(12*r))/1048576)))))}else{const t=a*a,s=Math.cos(r),e=s*s,n=xt(a,s,i);m=a*(bt(e,n,1)-i*t*dt(e,n,1)/3)}}if(1&h){m=o*(h+1)-m}else m+=o*h;return n*m}function vt(t,s,i=Number.NaN){if(0===t)return 0;let e=1,n=t;t<0&&(n=-n,e=-1);const r=Number.isNaN(i)?ft(s):i,u=Math.floor(n/r);1&u?n=(u+1)*r-n:n-=u*r;let h=n<=0?0:n>=r?Js():Nt(n,s,r);return 1&u?h=Js()*(u+1)-h:h+=Js()*u,e*h}function bt(t,i,e){s((0!==t?1:0)+(0!==i?1:0)+1>1);let n=t,r=i,u=e;for(;;){const t=Math.sqrt(n*r)+Math.sqrt(r*u)+Math.sqrt(u*n);n=.25*(n+t),r=.25*(r+t),u=.25*(u+t);const s=(n+r+u)/3,i=(s-n)/s,e=(s-r)/s,h=(s-u)/s;if(Math.abs(i)<=.0024&&Math.abs(e)<=.0024&&Math.abs(h)<=.0024){const t=i*e-h*h,n=i*e*h;return(1+(1/24*t-.1-3/44*n-5*t*t/208+t*n/16)*t+(1/14+3*n/104)*n)/Math.sqrt(s)}}}function dt(t,i,e){s(0!==t||0!==i);let r=t,u=i,h=e;const a=new n(0);let o=1;for(;;){const t=.2*(r+u+3*h),s=(t-r)/t,i=(t-u)/t,e=(t-h)/t;if(Math.abs(s)<=.0015&&Math.abs(i)<=.0015&&Math.abs(e)<=.0015){const n=s*i,r=e*e,u=n-r,h=n-6*r,m=h+u+u,l=3/26,c=h*(.25*(9/22)*h-.21428571428571427-1.5*l*e*m),f=e*(1/6*m+e*(-.4090909090909091*u+e*l*n));return 3*a.getResult()+o*(1+c+f)/(t*Math.sqrt(t))}const n=Math.sqrt(r),m=Math.sqrt(u),l=Math.sqrt(h),c=n*(m+l)+m*l;a.add(o/(l*(h+c))),o*=.25,r=.25*(r+c),u=.25*(u+c),h=.25*(h+c)}}function xt(t,s,i){return t<.999?1-i*H(t):1-i+i*H(s)}function Nt(t,s,i){if(0===s)return t;if(1===s)return Math.asin(t);let e=0,n=!0;if(t<.2){const i=t*t,r=t*(1+i*s*(1/6+i*((13*s-4)/120+(16-284*s+493*s*s)/5040*i))),u=Math.abs(s*(4944*s-64-31224*s*s+37369*s*s*s)/362880*Math.pow(t,9));if(u<Math.abs(r)*Qs())return r;e=r,n=u>.1*r}if(n){const n=1-s,r=1-t/i,u=Math.sqrt(r*r+n*n),h=Math.atan2(n,t+Qs());e=Js()+Math.sqrt(u)*(h-Js())}let r=0;for(let u=0;u<7;u++){r=_t(e,s,i);const n=xt(Math.sin(e),Math.cos(e),s);if(e-=(r-t)/Math.sqrt(n),u>0&&Math.abs(r-t)<=4*Qs()*t)break}return e}class pt{constructor(t){for(this.values=[[1]];this.values.length<t+1;){const t=this.values.at(-1),s=Yt(t.length+1,1);for(let i=1;i<t.length;++i)s[i]=t[i-1]+t[i];this.values.push(s)}}get(t,s){return this.values[t][s]}}function yt(t,i){return s(0),0}const Tt=new pt(32);function gt(t,s){if(t<Tt.values.length)return Tt.get(t,s);const e=Math.exp(yt());return e+.01>ds()&&i("The result value of n choose k is out of range"),e+.01}function Mt(t,s){if(t.isZero())return t.clone();const i=t.clone().divThis(t);if(s<0)return i.divThis(Mt(t,-s));for(t=t.clone(),s=Math.trunc(s);1&s&&i.mulThis(t),s>>=1;)t.mulThis(t);return i}function Et(t,s){if(0===s)return[];const i=t[0].clone().mulDoubleThis(0),e=[];e.length=s;const n=s-1;for(let r=0;r<=n;++r){e[r]=i.clone();for(let s=0;s<=r;++s)e[r].addThis(t[s].clone().mulDoubleThis(gt(r,s)/gt(n,s)))}return e}function It(s,i,e,n,r){return 0===s?0===n?i:1===n?e:r:1===s?0===n?i:1===n?e:Q(i,e,n):(2===s&&t("angular interpolation"),void t(""))}function wt(s,i,e,n,r,u,h,a){if(0===s)for(let t=0;t<u;++t)n[t+r]=0===h?i[t]:1===h?e[t]:a;else if(1===s)if(0===h)Dt(n,i,r,0,u);else if(1===h)Dt(n,e,r,0,u);else for(let t=0;t<u;++t)n[t+r]=Q(i[t],e[t],h);else if(2===s)if(0===h)Dt(n,i,r,0,u);else if(1===h)Dt(n,e,r,0,u);else{let t=0;for(let s=0,a=r;s<u;++s,++a)n[a]=Q(i[s],e[s],h),t+=n[a]*n[a];if(t>0){t=Math.sqrt(t);for(let s=r;s<r+u;++s)n[s]/=t}else{for(let t=r;t<r+u;++t)n[t]=0;n[r]=1}}else t("")}function Dt(t,s,i,e,n){if(0===n)return;let r=0,u=i,h=e;for(;r++<n;)t[u++]=s[h++]}function At(t,s,i){let e=0;for(let n=0;!e&&n<i;++n)e=t[n]-s[n];return e}function Pt(t,s){return t}function qt(t){t.sort((t,s)=>t<s?-1:t>s?1:0)}function zt(t,s){const i=t.slice(0,s);qt(i),Dt(t,i,0,0,s)}function Zt(t,s,i,e){const n=t.slice(s,s+i);n.sort(e),Dt(t,n,s,0,i)}function Ct(t,s){return t<s?-1:t>s?1:0}function Rt(t,s,i,e){return t<i?-1:t>i?1:s<e?-1:s>e?1:0}function Bt(t,s){if(t.length<2)return t.length;let i=0;for(let e=1;e<t.length;++e)s(t[e],t[i])||(i++,t[e]=Pt(t[i],t[i]=t[e]));return 1+i}function St(t,s){t[s]=t.at(-1),t.pop()}function kt(t,s=!1){return{[Symbol.dispose](){this.bForget||t()},bForget:s}}function Ft(t,s,i){t.length=s,t.fill(i)}function Lt(t,s,i){t.length=i;for(let e=0;e<i;++e)t[e]=new s}function Ot(t,s){const i=new Array(s);for(let e=0;e<s;++e)i[e]=new t;return i}function Gt(t,s,i){for(let e=0;e<i;++e)t[e].assign(s[e]);return i}function Qt(t,s){const i=t.slice(0,s);for(let e=0;e<s;++e)i[e]=i[e].clone();return i}function Vt(t){return Array.from({length:t},()=>null)}function Ut(t,s){return Array.from({length:s},()=>t())}function Yt(t,s){const i=new Array(t);return i.fill(s),i}function jt(t,s){return s in t&&1===Object.getOwnPropertyNames(t).length}class Ht{constructor(...t){this.m_elts=t}get length(){return this.m_elts.length}at(t){return this.m_elts[t]}[Symbol.dispose](){for(const t of this.m_elts)t[Symbol.dispose]()}}function $t(t,s){return{first:t,second:s}}const Jt=Math.PI,Kt=2*Math.PI,Wt=.5*Math.PI;class Xt{constructor(t,s){this.m_cr=t,this.m_cc=s,this.m_v=Yt(t*s,0)}get(t,s){return this.m_v[t*this.m_cc+s]}set(t,s,i){this.m_v[t*this.m_cc+s]=i}inc(t,s){return++this.m_v[t*this.m_cc+s]}}const ts=new ArrayBuffer(8),ss=new Float64Array(ts),is=new BigUint64Array(ts),es=0x0fffffffffffffn,ns=0x7ff0000000000000n;function rs(){return Number.EPSILON*Fs}function us(t){return ss[0]=t,is[0]}function hs(t){return is[0]=t,ss[0]}function as(t){return us(t)&es}function os(t){return Number((us(t)&ns)>>52n)}function ms(t){if(0n===t)return-1n;if(1n===t||-1n===t)return 0n;t<0n&&(t=-t);let s=0n,i=512n,e=1n<<s+i;for(;t>=e;)s+=i,i<<=1n,e<<=i;let n=s;i>>=1n;let r=n+i;for(;i>0n;)t<1n<<r||(n=r),i>>=1n,r=n+i;return n}function ls(t,s){return t===s||Number.isNaN(t)&&Number.isNaN(s)}function cs(t,s,i){return t===s||Math.abs(t-s)<=i||Number.isNaN(t)&&Number.isNaN(s)}function fs(t,s){return t<s?-1:t>s?1:0}function _s(t,s){if(t<s)return-1;if(t>s)return 1;if(t===s)return 0;{const i=Number.isNaN(t),e=Number.isNaN(s);return i<e?-1:i>e?1:0}}function vs(){return 2147483647}function bs(){return 32767}function ds(){return 2147483647}function xs(){return-2147483648}const Ns=ds(),ps=BigInt(Ns),ys=2166136261,Ts=16777619;function gs(t){let s=ys,i=t;return s=(s^255&i)*Ts,i>>=8,s=(s^255&i)*Ts,i>>=8,s=(s^255&i)*Ts,i>>=8,s=(s^255&i)*Ts,s&Ns}const Ms=14695981039346656037n,Es=1099511628211n;function Is(t){let s=Ms,i=t;return s=(s^0xffn&i)*Es,i>>=8n,s=(s^0xffn&i)*Es,i>>=8n,s=(s^0xffn&i)*Es,i>>=8n,s=(s^0xffn&i)*Es,i>>=8n,s=(s^0xffn&i)*Es,i>>=8n,s=(s^0xffn&i)*Es,i>>=8n,s=(s^0xffn&i)*Es,s&ps}function ws(t){return 1103515245*t+12345&2147483647}function Ds(t){let s=ys;for(let i=0,e=t.length;i<e;++i)s=(s^t.charCodeAt(i))*Ts;return s&Ns}function As(t,s){return s+2654435769+(t<<6)+(t>>2)&Ns}function Ps(t,s){return As(t,Cs(s))}function qs(t){return As(3735928559,t)}function zs(t,s){return As(t,qs(s))}function Zs(t){return gs(t)}function Cs(t){return Number(Is(t))}function Rs(t){return Xs(t)}function Bs(t){return Cs(us(Rs(t)))}function Ss(t){return ws(t)}const ks=100,Fs=100;function Ls(){return Number.EPSILON*ks}function Os(){return.38196601125010515}function Gs(){return 1.4142135623730951}function Qs(){return Number.EPSILON}function Vs(t,s,i){return t===s||t===i}function Us(t,s,i){return t>=s?t<=i?t:i:s}function Ys(t,s,i){const e=t[0];if(e>=s){if(e<=i)return!1;t[0]=i}else t[0]=s;return!0}function js(t,s){return t>=s?s:t<-s?-s:t}function Hs(){return Jt}function $s(){return Kt}function Js(){return Wt}const Ks=3*Js();function Ws(){return Ks}function Xs(t){return t+0}function ti(t){return{v:t}}class si{constructor(){this.m_rn=ti(0n),this.m_rd=ti(1n),this.m_bNaN=!1,this.m_bNormalized=!1,this.m_power=0,this.m_sign=0}static constructAssign(t,s){const i=t.clone();return void 0!==s&&i.limitPrecisionThis(s),i}static constructDouble(t){return(new si).setDouble(t)}static constructInt64(t){return(new si).setInt64(t)}static constructRational(t,s){return(new si).setRational(t,s)}static constructInt32(t){return this.constructInt64(BigInt(Math.trunc(t)))}[Symbol.toPrimitive](t){return this}compare(t){return this.lt(t)?-1:this.gt(t)?1:0}assignCopy(t){return this.setThis(t)}abs(){return this.clone().absThis()}absThis(){return this.isNAN()||(this.m_sign*=this.m_sign),this}clone(){return(new si).setThis(this)}setThis(t){return this.m_bNaN=t.m_bNaN,this.m_bNormalized=t.m_bNormalized,this.m_rn.v=t.m_rn.v,this.m_rd.v=t.m_rd.v,this.m_power=t.m_power,this.m_sign=t.m_sign,this}setZero(){return this.m_rn.v=0n,this.m_rd.v=1n,this.m_bNaN=!1,this.m_power=0,this.m_bNormalized=!0,this.m_sign=0,this}setDouble(s){if(this.setZero(),0===s)return this;if(Number.isInteger(s)&&Math.abs(s)<ds())return this.setInt32(s);const i=us(s),e=(i&si.s_em)>>52n,n=!!(i&si.s_sm),r=i&si.s_fm;if(e===si.s_emax)return r?(this.m_rn.v=this.m_rd.v=0n,this.m_bNaN=!0,this):(this.m_rn.v=n?-1n:1n,this.m_rd.v=0n,this);0n===e&&t("denormalized numbers not yet implemented");const u=e-1023n,h=u>=0n?u:0n,a=u<0n?-u:0n;return this.m_rn.v=(1n<<52n|r)<<h,this.m_rd.v=1n<<52n+a,this.m_sign=n?-1:1,this.m_bNormalized=!1,this.normalizeThis()}setInt64(t){return 0n===t?this.setZero():(this.m_bNaN=!1,this.m_sign=t>0n?1:-1,this.m_rn.v=t>0n?t:-t,this.m_rd.v=1n,this.m_power=0,this.m_bNormalized=!1,this.normalizeThis())}setRational(t,s){return 0n===t?0n===s?this.setNAN():this.setZero():0n===s?t>0n?this.setPositiveInf():this.setNegativeInf():(this.m_sign=(t>0n?1:-1)*(s>0n?1:-1),this.m_rn.v=t>0n?t:-t,this.m_rd.v=s>0n?s:-s,this.m_power=0,this.m_bNormalized=!1,this.normalizeThis())}setInt32(t){return this.setInt64(BigInt(Math.trunc(t)))}getDouble(){return this.convertToDouble()}toDouble(){return this.convertToDouble()}value(){return this.convertToDouble()}isNAN(){return this.m_bNaN}isPositiveInf(){return!this.isNAN()&&(0n===this.m_rd.v&&1===this.m_sign)}isNegativeInf(){return!this.isNAN()&&(0n===this.m_rd.v&&-1===this.m_sign)}isFinite(){return!this.isNAN()&&0n!==this.m_rd.v}setNAN(){return this.m_bNaN=!0,this.m_rn.v=0n,this.m_rd.v=0n,this.m_power=0,this.m_bNormalized=!0,this}setPositiveInf(){return this.m_rn.v=1n,this.m_rd.v=0n,this.m_bNaN=!1,this.m_bNormalized=!0,this.m_sign=1,this.m_power=0,this}setNegativeInf(){return this.m_rn.v=1n,this.m_rd.v=0n,this.m_bNaN=!1,this.m_bNormalized=!0,this.m_sign=-1,this.m_power=0,this}subThis(t){if(t.isNAN()&&this.setNAN(),this.isPositiveInf()&&t.isPositiveInf())this.setNAN();else{if(this.isPositiveInf()&&t.isNegativeInf())return this.setPositiveInf(),this;if(this.isNegativeInf()&&t.isNegativeInf())this.setNAN();else if(this.isNegativeInf()&&t.isPositiveInf())return this.setNegativeInf(),this}return this.isNAN()?this:this.opPlusMinus(t,!1)}thisSubAbs(t){return s(0),this}mulThis(t){return t.isNAN()&&this.setNAN(),this.isNAN()?this:(this.m_sign*=t.m_sign,0===this.m_sign?this.setZero():(this.m_rn.v*=t.m_rn.v,this.m_rd.v*=t.m_rd.v,this.m_power+=t.m_power,this.m_bNormalized=!1,this.normalizeThis(),this))}mulDoubleThis(t){return this.mulThis(si.constructDouble(t))}thisMulInt64(t){return s(0),this}thisMulInt32(t){return s(0),this}divThis(t){return this.mulThis(t.clone().invertThis())}divDoubleThis(t){return this.divThis(si.constructDouble(t))}addDoubleThis(t){return this.addThis(si.constructDouble(t))}subDoubleThis(t){return this.subThis(si.constructDouble(t))}mul(t){return this.clone().mulThis(t)}mulBigIntThis(t){return this.mulThis(si.constructInt64(t))}mulDouble(t){return this.clone().mulThis(si.constructDouble(t))}div(t){return this.clone().divThis(t)}divDouble(t){return this.clone().divDoubleThis(t)}add(t){return this.clone().addThis(t)}fmSubThis(t,s){return this.subThis(t.clone().mulThis(s))}fmAddThis(t,s){return this.addThis(t.clone().mulThis(s))}addThis(t){if(t.isNAN()&&this.setNAN(),this.isPositiveInf()&&t.isPositiveInf())return this.setPositiveInf(),this;if(this.isPositiveInf()&&t.isNegativeInf())this.setNAN();else{if(this.isNegativeInf()&&t.isNegativeInf())return this.setNegativeInf(),this;this.isNegativeInf()&&t.isPositiveInf()&&this.setNAN()}return this.isNAN()?this:this.opPlusMinus(t,!0)}addDouble(t){return this.clone().addThis(si.constructDouble(t))}sub(t){return this.clone().subThis(t)}subDouble(t){return this.clone().subThis(si.constructDouble(t))}isZero(){return 0===this.m_sign}equals(t){return this.clone().subThis(t).isZero()}lt(t){return!this.isNAN()&&!t.isNAN()&&(!(this.isPositiveInf()&&t.isPositiveInf()||this.isNegativeInf()&&t.isNegativeInf())&&(!this.isPositiveInf()&&(!!t.isPositiveInf()||this.clone().sub(t).LZ())))}absLessAbs(t){return this.abs().lt(t.abs())}gt(t){return this.clone().sub(t).GZ()}lte(t){return this.sub(t).LEZ()}gte(t){return this.sub(t).GEZ()}normalizeThis(){if(this.m_bNormalized)return this;if(0n===this.m_rn.v)return this.setZero();let t=0,s=0xffffffffn;for(;0n===(this.m_rn.v&s)&&s<=this.m_rn.v;)s<<=32n,t+=32;s&=this.m_rn.v,s>>=BigInt(t),t+=_(BigInt.asUintN(32,s))-1;let i=0;for(s=0xffffffffn;0n===(this.m_rd.v&s)&&s<=this.m_rd.v;)s<<=32n,i+=32;return s&=this.m_rd.v,s>>=BigInt(i),i+=_(BigInt.asUintN(32,s))-1,this.m_rn.v>>=BigInt(t),this.m_rd.v>>=BigInt(i),this.m_power+=t-i,this.m_rn.v>1n&&this.m_rd.v>1n&&(this.m_rn.v%this.m_rd.v===0n?(this.m_rn.v/=this.m_rd.v,this.m_rd.v=1n):this.m_rd.v%this.m_rn.v===0n&&(this.m_rd.v/=this.m_rn.v,this.m_rn.v=1n)),this.m_bNormalized=!0,this}negateThis(){return this.isNAN()||(this.m_sign*=-1),this}negate(){return this.clone().negateThis()}invertThis(){return this.isNAN()?this:this.isPositiveInf()||this.isNegativeInf()?(this.setZero(),this):0n===this.m_rn.v?(this.setPositiveInf(),this):(this.m_rd=Pt(this.m_rn,this.m_rn=this.m_rd),this.m_power=-this.m_power,this)}limitPrecisionThis(t){if(0===t)return this;if(this.isZero())return this.setZero();if(!this.isFinite())return this;this.normalizeThis();let s=Number(ms(this.m_rn.v));if(s>t){const i=s-t;this.m_rn.v>>=BigInt(s-t),this.m_power+=i}if(s=Number(ms(this.m_rd.v)),s>t){const i=s-t;this.m_rd.v>>=BigInt(s-t),this.m_power-=i}return this}hiBitIndex(){return Math.max(Number(ms(this.m_rn.v)),Number(ms(this.m_rd.v)))}ldexp(t){return this.clone().ldexpThis(t)}ldexpThis(t){return t&&(this.m_bNormalized=!1,this.m_power+=t,this.normalizeThis()),this}static lerp(t,s,i){return si.lerpLo(s,s,i)}static lerpLo(t,s,i){return s.sub(t).mulThis(i).addThis(t)}static lerpHi(t,s,i){return s.sub(t).mulThis(ii.sub(i)).addThis(t)}LZ(){return!this.isNAN()&&-1===this.m_sign}GZ(){return!this.isNAN()&&1===this.m_sign}LEZ(){return!this.isNAN()&&this.m_sign<=0}GEZ(){return!this.isNAN()&&this.m_sign>=0}toString(){return this.toDouble().toString()}sqr(){return this.clone().sqrThis()}sqrThis(){return this.mulThis(this.clone())}static sqrt(t,e){if(t.m_sign<0n&&i("MP_value: sqrt(-1)"),t.isZero())return t.clone();let n=52,r=2220446049250313e-31;for(;n<e;)2*n<=e?(r*=r,n*=2):(r*=2220446049250313e-31,n+=52);n+=52;const u=ms(t.m_rn.v),h=ms(t.m_rd.v);let a,o=t.m_power+Number(u-h);const m=new si;Math.abs(o)>200?(1&Math.abs(o)&&(o+=1),a=si.constructAssign(t,53).ldexpThis(-o).value(),m.setThis(t).ldexpThis(-o),s(Number.isFinite(a))):(m.setThis(t),a=m.value(),s(Number.isFinite(a)),o=0),a=Math.sqrt(a);const l=si.constructDouble(a),c=si.constructDouble(r);c.mulThis(l).ldexpThis(1);const f=r*a*2,_=l.clone(),v=new si;let b;for(let s=0;s<10;++s){_.mulThis(l),v.setThis(m).subThis(_).absThis();let t=v.value();if(b=1,t<.9)for(;t>f;)t*=t,++b;else b=4;if(v.lte(c))break;for(let s=0;s<b;s++)_.setThis(l).divThis(m).invertThis().addThis(l).ldexpThis(-1).limitPrecisionThis(n),l.setThis(_)}return l.ldexpThis(o/2)}static cubicRoot(t,s){if(t.isZero())return t.clone();let i=52,e=2220446049250313e-31;for(;i<s;)2*i<=s?(e*=e,i*=2):(e*=2220446049250313e-31,i+=52);i+=52;const n=Math.pow(Math.abs(t.value()),1/3),r=si.constructDouble(n),u=r.clone();u.sqrThis().mulDoubleThis(3).mulDoubleThis(e),u.limitPrecisionThis(32),t.LZ()&&r.negateThis();for(let h=0;h<10;++h){const s=r.clone();s.sqrThis().mulThis(r);const e=s.clone();if(e.subThis(t),e.absThis().limitPrecisionThis(32),e.lte(u))break;e.setThis(t),e.ldexpThis(1),e.addThis(s);const n=s.clone();n.ldexpThis(1),n.addThis(t),e.divThis(n),r.mulThis(e),r.limitPrecisionThis(i)}return r}isInTheRangeOfDouble(){return s(0),!1}sign(){return this.m_sign}cosAndSin(t,i){s(0)}pow(t){return Mt(this,t)}static nan(){return s(0),new si}convertToDouble(){if(this.m_bNaN)return Number.NaN;if(this.isZero())return 0;if(0n===this.m_rd.v)return 1===this.m_sign?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;const t=-1===this.m_sign,s=this.m_rn.v<<(this.m_power>=0?BigInt(this.m_power):0n);let i=this.m_rd.v<<(this.m_power<0?BigInt(-this.m_power):0n);const e=s/i;let n=Number(e);if(BigInt(n)!==e)return t?-n:n;let r=s-e*i;if(r){let t=ms(i)-1023n;t>0n&&(i>>=t,r<<=52n,r>>=t);let s=Number(r);Number.isFinite(s)||(r>>=52n,s=Number(r),t=0n),t>0n&&(s/=Math.pow(2,52));n+=s/Number(i)}return t?-n:n}signVal(){return 1===this.m_sign?1n:-1===this.m_sign?-1n:0n}opPlusMinus(t,s){const i=Math.min(this.m_power,t.m_power);let e,n;this.m_power>i?(e=BigInt(this.m_power-i),n=0n):(e=0n,n=BigInt(t.m_power-i));const r=this.signVal()*this.m_rn.v*t.m_rd.v<<e,u=t.signVal()*t.m_rn.v*this.m_rd.v<<n;return this.m_rn.v=s?r+u:r-u,this.m_rd.v*=t.m_rd.v,this.m_power=i,this.m_sign=1,this.m_rn.v<0n&&(this.m_sign=-1,this.m_rn.v=-this.m_rn.v),this.m_bNormalized=!1,this.normalizeThis(),this}}si.s_sm=0x8000000000000000n,si.s_em=0x7ff0000000000000n,si.s_fm=0x000fffffffffffffn,si.s_emax=0x7ffn;const ii=si.constructInt32(1),ei=si.constructInt32(0),ni=si.constructDouble(.5);function ri(t,s){return d(t^s)}function ui(t,s){let i=os(t);const e=os(s);if(i===e){return i-=53-ri(as(t),as(s)),i}return i>e?i:e}function hi(t,s){for(let i=0,e=0,n=t.length;i<n;i+=2,e++)s[e].x=t[i],s[e].y=t[i+1]}function ai(t){const s=new Float64Array(2*t.length);for(let i=0,e=t.length;i<e;++i){const e=i<<1;s[e]=t[i].x,s[e+1]=t[i].y}return s}function oi(t){const s=Ot(mi,t.length);for(let i=0,e=t.length;i<e;++i)s[i].setCoords(t[i][0],t[i][1]);return s}class mi{static construct(t,s){return new mi(t,s)}constructor(t,s){void 0!==t?(this.x=t,this.y=s):this.x=this.y=Number.NaN}clone(){return new mi(this.x,this.y)}assign(t){this.setCoordsPoint2D(t)}setCoords(t,s){return this.x=t,this.y=s,this}setCoordsPoint2D(t){this.x=t.x,this.y=t.y}isEqualPoint2D(t,s){return void 0!==s?Math.abs(this.x-t.x)<=s&&Math.abs(this.y-t.y)<=s:this.x===t.x&&this.y===t.y}isEqual(t,s,i){return void 0!==i?Math.abs(this.x-t)<=i&&Math.abs(this.y-s)<=i:this.x===t&&this.y===s}equalsPoint2D(t,s){return this.isEqualPoint2D(t,s)}setSub(t,s){this.x=t.x-s.x,this.y=t.y-s.y}addThis(t){return this.x+=t.x,this.y+=t.y,this}setAdd(t,s){return this.x=t.x+s.x,this.y=t.y+s.y,this}absoluteOther(t){}absolute(){return s(0),this}setNegate(){this.x=-this.x,this.y=-this.y}setNegateOther(t){this.x=-t.x,this.y=-t.y}interpolateThis(t,s){}interpolate(t,i,e){s(0)}scaleAddThis(t,s){this.x=this.x*t+s.x,this.y=this.y*t+s.y}setScaleAdd(t,s,i){this.x=s.x*t+i.x,this.y=s.y*t+i.y}scaleOther(t,i){s(0)}scale(t){this.x*=t,this.y*=t}compare(t){return this.y<t.y?-1:this.y>t.y?1:this.x<t.x?-1:this.x>t.x?1:0}compareX(t){return this.x<t.x?-1:this.x>t.x?1:this.y<t.y?-1:this.y>t.y?1:0}normalizeOther(t){s(0)}normalize(){const t=this.length();return t?(this.x/=t,this.y/=t):(this.x=1,this.y=0),this}getUnitVector(){return this.clone().normalize()}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}sqrLength(){return this.x*this.x+this.y*this.y}static averageFast(t,i){return s(0),{}}static average(t,s){const i=new mi;if(0===s)return i.setNAN(),i;if(1===s)return i.assign(t[0]),i;const e=new n(t[0].x),r=new n(t[0].y);for(let n=1;n<s;n++)e.add(t[n].x),r.add(t[n].y),255&n||(e.normalize(),r.normalize());return i.x=e.getResult()/s,i.y=r.getResult()/s,i}static calculateLength(t,s){const i=new n(0);for(let e=1;e<s;e++)i.add(mi.distance(t[e],t[e-1]));return i.getResult()}offset(t,s){const i=mi.distance(t,s),e=mi.construct(this.x,this.y);if(0===i)return mi.distance(e,t);const n=s.clone();n.subThis(t),e.subThis(t);return e.crossProduct(n)/i}side(t,s){return t.equals(s)?this.equals(t)?0:1:mi.orientationRobust(s,t,this)}static sqrDistance(t,s){const i=t.x-s.x,e=t.y-s.y;return i*i+e*e}static sqrDistanceCoords(t,s,i,e){const n=i-t,r=e-s;return n*n+r*r}static distance(t,s){return Math.sqrt(mi.sqrDistance(t,s))}dotProduct(t){return this.x*t.x+this.y*t.y}dotProductAbs(t){return Math.abs(this.x*t.x)+Math.abs(this.y*t.y)}crossProduct(t){return this.x*t.y-this.y*t.x}crossProductAbs(t){return s(0),0}rotateDirect(t,s){const i=this.x*t-this.y*s,e=this.x*s+this.y*t;this.x=i,this.y=e}rotateReverse(t,s){const i=this.x*t+this.y*s,e=-this.x*s+this.y*t;this.x=i,this.y=e}leftPerpendicularThis(){const t=this.x;this.x=-this.y,this.y=t}leftPerpendicularOther(t){const s=t.x;this.x=-t.y,this.y=s}rightPerpendicularThis(){const t=this.x;this.x=this.y,this.y=-t}rightPerpendicularOther(t){const s=t.x;this.x=t.y,this.y=-s}equals(t){return this.x===t.x&&this.y===t.y}notequals(t){return this.x!==t.x||this.y!==t.y}not(){return!this.x&&!this.y}gt(t){return this.y>t.y||this.y===t.y&&this.x>t.x}gte(t){return!this.lt(t)}lt(t){return this.y<t.y||this.y===t.y&&this.x<t.x}lte(t){return!this.gt(t)}subThis(t){return this.x-=t.x,this.y-=t.y,this}divThis(t){return this.x/=t,this.y/=t,this}add(t){return new mi(this.x+t.x,this.y+t.y)}sub(t){return new mi(this.x-t.x,this.y-t.y)}negateThis(){return this.x=-this.x,this.y=-this.y,this}negate(){return new mi(-this.x,-this.y)}mul(t){return new mi(this.x*t,this.y*t)}mulThis(t){return this.x*=t,this.y*=t,this}divide(t){return new mi(this.x/t,this.y/t)}setNAN(){this.x=this.y=Number.NaN}isNAN(){return Number.isNaN(this.x)||Number.isNaN(this.y)}static getNAN(){return new mi(Number.NaN,Number.NaN)}isFinite(){return Number.isFinite(this.x)&&Number.isFinite(this.y)}isZero(){return 0===this.x&&0===this.y}norm(t){switch(t){case 0:{const t=Math.abs(this.x),s=Math.abs(this.y),i=t-s;return i>=0?t:i<=0?s:Number.NaN}case 1:return Math.abs(this.x)+Math.abs(this.y);case 2:return Math.sqrt(this.x*this.x+this.y*this.y);default:e("norm")}}getQuarter(){return mi.getQuarterCoords(this.x,this.y)}static getQuarterCoords(t,s){return t>0?s>=0?1:4:s>0?2:0===t?4:3}static compareVectors(t,s){const i=t.getQuarter(),e=s.getQuarter();return e===i?mi.orientationRobustImpl(mi.construct(0,0),s,t,!0):i<e?-1:1}static compareVectorsOrigin(t,s,i){const e=s.sub(t),n=i.sub(t),r=e.getQuarter(),u=n.getQuarter();return u===r?mi.orientationRobustImpl(t,i,s,!0):r<u?-1:1}static orientationRobust(t,s,i){return mi.orientationRobustImpl(t,s,i,!1)}static orientationRobustEx(t,s,i,e){if(t.equals(s)||i.equals(e))return 0;const n=s.x-t.x,r=s.y-t.y,u=e.x-i.x,h=e.y-i.y;{const t=mi.getQuarterCoords(n,r)-1,s=mi.getQuarterCoords(u,h)-1,i=mi.d[t][s];if(0!==i)return i}const a=n*h,o=r*u,m=4*Qs()*(Math.abs(a)+Math.abs(o)),l=a-o;if(Math.abs(l)>=m){return l<0?-1:l>0?1:0}return mi.orientationRobustExMp(t,s,i,e)}static orientationRobustExMp(t,s,i,e){const n=si.constructDouble(s.x),r=si.constructDouble(e.x);n.subThis(si.constructDouble(t.x)),r.subThis(si.constructDouble(i.x));const u=si.constructDouble(s.y),h=si.constructDouble(e.y);return u.subThis(si.constructDouble(t.y)),h.subThis(si.constructDouble(i.y)),n.mulThis(h),u.mulThis(r),n.subThis(u),n.LZ()?-1:n.GZ()?1:0}static orientationNonRobust(t,s,i){const e=s.sub(t).crossProduct(i.sub(t));return e<0?-1:e>0?1:0}static orientationRobustImpl(t,s,i,e){if(s.isEqualPoint2D(t)||i.isEqualPoint2D(t)||s.isEqualPoint2D(i))return 0;const n=s.x-t.x,r=s.y-t.y,u=i.x-t.x,h=i.y-t.y;if(!e){const t=mi.getQuarterCoords(n,r)-1,s=mi.getQuarterCoords(u,h)-1,i=mi.d[t][s];if(0!==i)return i}const a=(Math.abs(n)+Math.abs(r)+Math.abs(u)+Math.abs(h))*(Math.abs(s.x)+Math.abs(s.y)+Math.abs(i.x)+Math.abs(i.y))*8*M(),o=n*h-r*u;if(Math.abs(o)>a){return o<0?-1:1}if(g(s.x,t.x)&&g(i.y,t.y)&&g(s.y,t.y)&&g(i.x,t.x)&&y(n,h)&&y(r,u)){const t=n*h,s=r*u;if(g(t,s)){const i=t-s;return i<0?-1:i>0?1:0}}return mi.orientationRobustMp(t,s,i)}static orientationRobustMp(t,s,i){const e=si.constructDouble(s.x),n=si.constructDouble(i.x);{const s=si.constructDouble(t.x);e.subThis(s),n.subThis(s)}const r=si.constructDouble(i.y),u=si.constructDouble(s.y);{const s=si.constructDouble(t.y);r.subThis(s),u.subThis(s)}return e.mulThis(r),u.mulThis(n),e.subThis(u),e.LZ()?-1:e.GZ()?1:0}static inCircleRobust(t,s,i,e){const n=new p,r=new p;n.set(t.x),n.subThis(e.x),r.set(t.y),r.subThis(e.y);const u=new p,h=new p;u.set(s.x),u.subThis(e.x),h.set(s.y),h.subThis(e.y);const a=new p,o=new p;a.set(i.x),a.subThis(e.x),o.set(i.y),o.subThis(e.y);const m=n.mulE(h).subE(r.mulE(u)),l=u.mulE(o).subE(h.mulE(a)),c=n.mulE(o).subE(r.mulE(a)),f=n.mulE(n).addE(r.mulE(r)),_=u.mulE(u).addE(h.mulE(h)),v=a.mulE(a).addE(o.mulE(o)),b=f.mulE(l).subE(_.mulE(c)).addE(v.mulE(m));if(!b.isFuzzyZero()){const t=b.value();return t<0?-1:t>0?1:0}return mi.inCircleRobustMp(t,s,i,e)}static inCircleRobustMp(t,s,i,e){do{if(!g(t.x,e.x)||!g(t.y,e.y))break;if(!g(s.x,e.x)||!g(s.y,e.y))break;if(!g(i.x,e.x)||!g(i.y,e.y))break;const n=t.x-e.x,r=t.y-e.y,u=s.x-e.x,h=s.y-e.y,a=i.x-e.x,o=i.y-e.y;if(!y(n,h)||!y(r,u))break;if(!y(u,o)||!y(h,a))break;if(!y(n,o)||!y(r,a))break;if(!y(n,n)||!y(r,r))break;if(!y(u,u)||!y(h,h))break;if(!y(a,a)||!y(o,o))break;const m=n*h,l=r*u,c=u*o,f=h*a,_=n*o,v=r*a,b=n*n,d=r*r,x=u*u,N=h*h,p=a*a,M=o*o;if(!g(m,l))break;if(!g(c,f))break;if(!g(_,v))break;if(!T(b,d))break;if(!T(x,N))break;if(!T(p,M))break;const E=m-l,I=c-f,w=_-v,D=b+d,A=x+N,P=p+M;if(!y(D,I))break;if(!y(A,w))break;if(!y(P,E))break;const q=D*I,z=A*w,Z=P*E;if(!g(q,z))break;const C=q-z;if(!T(C,Z))break;const R=C+Z;return R<0?-1:R>0?1:0}while(0);const n=si.constructDouble(e.x),r=si.constructDouble(e.y),u=si.constructDouble(t.x),h=si.constructDouble(t.y);u.subThis(n),h.subThis(r);const a=si.constructDouble(s.x),o=si.constructDouble(s.y);a.subThis(n),o.subThis(r);const m=si.constructDouble(i.x),l=si.constructDouble(i.y);m.subThis(n),l.subThis(r);const c=u.mul(o).sub(h.mul(a)),f=a.mul(l).sub(o.mul(m)),_=u.mul(l).sub(h.mul(m)),v=u.mul(u).add(h.mul(h)),b=a.mul(a).add(o.mul(o)),d=m.mul(m).add(l.mul(l)),x=v.mul(f).sub(b.mul(_)).add(d.mul(c));return x.LZ()?-1:x.GZ()?1:0}static inCircleRobustMp3Point(t,s,i){const e=si.constructDouble(t.x),n=si.constructDouble(t.y),r=si.constructDouble(s.x),u=si.constructDouble(s.y),h=si.constructDouble(i.x),a=si.constructDouble(i.y),o=h.mul(h).add(a.mul(a)).sub(h.mul(e).add(a.mul(n)).add(h.mul(r)).add(a.mul(u))).add(e.mul(r).add(n.mul(u)));return o.LZ()?-1:o.GZ()?1:0}static inCircleRobust3Point(t,s,i){const e=new p(t.x),n=new p(t.y),r=new p(s.x),u=new p(s.y),h=new p(i.x),a=new p(i.y),o=h.mulE(h).addE(a.mulE(a)).subE(h.mulE(e).addE(a.mulE(n)).addE(h.mulE(r)).addE(a.mulE(u))).addE(e.mulE(r).addE(n.mulE(u)));if(!o.isFuzzyZero()){const t=o.value();return t<0?-1:t>0?1:0}return mi.inCircleRobustMp3Point(t,s,i)}static calculateCircleCenterFromThreePoints(t,s,i){if(t.equals(i)||t.equals(s)||i.equals(s))return mi.getNAN();const e=li(t,s,i);return e.isNAN()?ci(t,s,i):e}static calculateAngle(t,s){return Math.atan2(t.crossProduct(s),t.dotProduct(s))}static isBisectorRobust(t,i,e){return s(0),!1}static size(){return 2}get 0(){return this.x}get 1(){return this.y}set 0(t){this.x=t}set 1(t){this.y=t}static compareZorder(t,s){const i=mi.c_compare_zorder_xx[t.x<0?1:0]|mi.c_compare_zorder_yy[t.y<0?1:0],e=mi.c_compare_zorder_xx[s.x<0?1:0]|mi.c_compare_zorder_yy[s.y<0?1:0];if(i===e){let i=0,e=0;for(let n=0;n<2;++n){const r=ui(t[n],s[n]);r>i&&(i=r,e=n)}return t[e]<s[e]}return i<e}static lerp(t,s,i){const e=new mi;return Y(t,s,i,e),e}static getClosestCoordinate(t,s,i,e=!1){const n=mi.getNAN();n.setSub(s,t);const r=n.sqrLength();if(0===r)return.5;if(s.isEqualPoint2D(i))return 1;const u=mi.getNAN();u.setSub(i,t);let h=u.dotProduct(n)/r;return e||(h<0?h=0:h>1&&(h=1)),h}static intersectLinesAtOnePoint(t,s,i,e){if(t.equals(s)||i.equals(e))return mi.getNAN();const n=s.x-t.x,r=i.x-e.x,u=s.y-t.y,h=i.y-e.y,a=n*h-r*u;if(!a)return mi.getNAN();const o=a;if(0===o)return mi.getNAN();let m=(i.x-t.x)*h-(i.y-t.y)*r;m/=o;const l=new mi;return Y(t,s,m,l),l.isFinite()?l:mi.getNAN()}toString(){return`[${this.x},${this.y}]`}}function li(t,s,i){const e=new p(s.x);e.subThis(t.x);const n=new p(s.y);n.subThis(t.y);const r=new p(i.x);r.subThis(t.x);const u=new p(i.y);u.subThis(t.y);const h=e.clone();h.mulThisE(u);let a=n.clone();if(a.mulThisE(r),h.subThisE(a),0===h.value())return mi.getNAN();h.mulThis(2);const o=e.clone();o.mulThisE(e);const m=n.clone();m.mulThisE(n);const l=o.clone();l.addThisE(m);const c=r.clone();c.mulThisE(r);const f=u.clone();f.mulThisE(u);const _=c.clone();_.addThisE(f);const v=n.clone();v.mulThisE(_),a=u.clone(),a.mulThisE(l),v.subThisE(a),v.divThisE(h);const b=e.clone();b.mulThisE(_),a=r.clone(),a.mulThisE(l),b.subThisE(a),b.divThisE(h);const d=mi.construct(t.x-v.value(),t.y+b.value()),x=t.sub(d).length(),N=s.sub(d).length(),y=i.sub(d).length(),T=1e-15*(x+Math.abs(t.x)+Math.abs(s.x)+Math.abs(i.x)+Math.abs(t.y)+Math.abs(s.y)+Math.abs(i.y));return Math.abs(x-N)<=T&&Math.abs(x-y)<=T&&v.eps()<T&&b.eps()<T?d:mi.getNAN()}function ci(t,s,i){const e=si.constructDouble(s.x);e.subDoubleThis(t.x);const n=si.constructDouble(s.y);n.subDoubleThis(t.y);const r=si.constructDouble(i.x);r.subDoubleThis(t.x);const u=si.constructDouble(i.y);u.subDoubleThis(t.y);const h=e.clone();h.mulThis(u);let a=n.clone();if(a.mulThis(r),h.subThis(a),h.isZero())return mi.getNAN();h.mulDoubleThis(2);const o=e.clone();o.mulThis(e);const m=n.clone();m.mulThis(n);const l=o.clone();l.addThis(m);const c=r.clone();c.mulThis(r);const f=u.clone();f.mulThis(u);const _=c.clone();_.addThis(f);const v=n.clone();v.mulThis(_),a=u.clone(),a.mulThis(l),v.subThis(a),v.divThis(h);const b=e.clone();b.mulThis(_),a=r.clone(),a.mulThis(l),b.subThis(a),b.divThis(h);return mi.construct(t.x-v.value(),t.y+b.value())}mi.dimensions=2,mi.d=[[0,1,0,-1],[-1,0,1,0],[0,-1,0,1],[1,0,-1,0]],mi.c_compare_zorder_xx=[2,0],mi.c_compare_zorder_yy=[1,0];export{Bs as $,As as A,Zs as B,Vt as C,Gt as D,x as E,ls as F,S as G,Qs as H,Ds as I,Ss as J,n as K,oi as L,si as M,St as N,Ps as O,mi as P,Y as Q,Ct as R,Ht as S,bs as T,I as U,Ys as V,R as W,p as X,zs as Y,ai as Z,hi as _,H as a,rs as a0,Os as a1,qs as a2,wt as a3,Zt as a4,Gs as a5,fs as a6,cs as a7,w as a8,Qt as a9,ei as aA,ii as aB,Et as aC,Xs as aD,Rt as aE,st as aF,$ as aG,gt as aH,J as aI,xs as aJ,At as aK,Vs as aa,Xt as ab,Js as ac,It as ad,jt as ae,V as af,U as ag,zt as ah,L as ai,Hs as aj,js as ak,Ws as al,k as am,F as an,O as ao,G as ap,D as aq,ni as ar,$s as as,_t as at,vt as au,Lt as av,A as aw,P as ax,ft as ay,Jt as az,Dt as b,Pt as c,Yt as d,K as e,B as f,Ls as g,kt as h,ds as i,vs as j,Ut as k,$t as l,Ot as m,ct as n,Wt as o,Kt as p,Q as q,_s as r,Us as s,W as t,Bt as u,qt as v,Ft as w,j as x,z as y,C as z};
|
|
5
|
+
import{t,g as s,q as i,a as e}from"./Geometry.js";class n{constructor(t){this.sum=t,this.compensation=0}assign(t){return this.compensation=t.compensation,this.sum=t.sum,this}reset(){this.sum=this.compensation=0}resetToStart(t){this.sum=t,this.compensation=0}normalize(){const t=[Number.NaN];this.sum=lt(this.sum,this.compensation,t),this.compensation=t[0]}add(t){const s=this.sum+t;let i;if(Math.abs(this.sum)>=Math.abs(t)){const e=this.sum-s+t;i=this.compensation+e}else{const e=t-s+this.sum;i=this.compensation+e}this.sum=s,this.compensation=i}sub(t){this.add(-t)}addProduct(t,s){const i=[0],e=ut(t,s,i);this.add(e),this.add(i[0])}mul(t){const s=new n(0);s.addProduct(this.sum,t),s.addProduct(this.compensation,t),this.assign(s)}getResult(){return this.sum+this.compensation}pe(t){return this.add(t),this}me(t){return this.add(-t),this}}const r=0x00000000ffffffffn,u=0x0000ffffn,h=0x000000ffn,a=0x0fn,o=0xffff0000n,m=0xff00n,l=0xf0n,c=[5,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1],f=[-1,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3];function _(t){let s=0;return t&u||(s+=16,t>>=16n),t&h||(s+=8,t>>=8n),t&a||(s+=4,t>>=4n),s+c[Number(BigInt.asUintN(4,t))]}function v(t){let s=0;return t&o&&(s+=16,t>>=16n),t&m&&(s+=8,t>>=8n),t&l&&(s+=4,t>>=4n),s+f[Number(BigInt.asUintN(4,t))]+1}function b(t){let s=0;return t&r||(s=32,t>>=32n),s+_(BigInt.asUintN(32,t))}function d(t){let s=0;return 0xffffffff00000000n&t&&(s=32,t>>=32n),s+v(t)}class x{constructor(t,s){if(this.m_EnvelopeType=1,void 0!==t){if(t instanceof x)return this.vmin=t.vmin,void(this.vmax=t.vmax);this.vmin=t,this.vmax=s,this.normalize()}else this.setEmpty()}static construct(t,s){return new x(t,s)}static constructEmpty(){return new x}setCoords(t,s){this.vmin=t,this.vmax=s,this.normalize()}setCoordsFromEnvelope(t){this.vmin=t.vmin,this.vmax=t.vmax}setEmpty(){this.vmin=Number.NaN,this.vmax=Number.NaN}getCenter(){return.5*(this.vmin+this.vmax)}equalsRange(t,s){return ls(this.vmin,t)&&ls(this.vmax,s)}equals(t,s){return!(!this.isEmpty()||!t.isEmpty())||(void 0!==s?Math.abs(this.vmin-t.vmin)<=s&&Math.abs(this.vmax-t.vmax)<=s:this.vmin===t.vmin&&this.vmax===t.vmax)}width(){return this.vmax-this.vmin}isEmpty(){return Number.isNaN(this.vmin)||Number.isNaN(this.vmax)}isZero(){return this.vmin===this.vmax}setInfinite(){this.vmin=Number.NEGATIVE_INFINITY,this.vmax=Number.POSITIVE_INFINITY}move(t){this.isEmpty()||(this.vmin+=t,this.vmax+=t)}contains(t){return t.vmin>=this.vmin&&t.vmax<=this.vmax}containsCoordinate(t){return t>=this.vmin&&t<=this.vmax}containsRightExclusive(t){return t>=this.vmin&&t<this.vmax}containsExclusiveCoordinate(t){return t>this.vmin&&t<this.vmax}containsExclusive(t){return t.vmin>this.vmin&&t.vmax<this.vmax}isIntersecting(t){return this.vmin<=t.vmin?this.vmax>=t.vmin:t.vmax>=this.vmin}mergeCoordinate(t){if(this.isEmpty())return this.vmin=t,void(this.vmax=t);this.mergeNeCoordinate(t)}merge(t){if(t.isEmpty())return;const s=t.vmin,i=t.vmax;this.mergeCoordinate(s),this.mergeCoordinate(i)}mergeNe(t){const s=t.vmin,i=t.vmax;this.mergeNeCoordinate(s),this.mergeNeCoordinate(i)}mergeNeCoordinate(t){t<this.vmin?this.vmin=t:t>this.vmax&&(this.vmax=t)}intersect(t){this.isEmpty()||t.isEmpty()?this.setEmpty():(this.vmin<t.vmin&&(this.vmin=t.vmin),this.vmax>t.vmax&&(this.vmax=t.vmax),this.vmin>this.vmax&&this.setEmpty())}inflate(t){this.isEmpty()||(this.vmin-=t,this.vmax+=t,this.vmax<this.vmin&&this.setEmpty())}normalize(){this.vmin<=this.vmax||(this.vmin>this.vmax?this.vmax=Pt(this.vmin,this.vmin=this.vmax):this.setEmpty())}isValid(){return this.isEmpty()||this.vmin<=this.vmax}snapClip(t){return Us(t,this.vmin,this.vmax)}calculateToleranceFromEnvelope(){if(this.isEmpty())return Ls();return(Math.abs(this.vmin)+Math.abs(this.vmax)+1)*Ls()}static unit(){return N}normalizeNoNAN(){this.vmin>this.vmax&&(this.vmax=Pt(this.vmin,this.vmin=this.vmax))}setCoordsNoNAN(t,s){this.vmin=t,this.vmax=s,this.normalizeNoNAN()}clone(){return new x(this.vmin,this.vmax)}}const N=new x(0,1);class p{static getNAN(){return new p(Number.NaN)}constructor(t,s){this.m_value=t??0,this.m_eps=s??0}[Symbol.toPrimitive](t){return this}clone(){return new p(this.m_value,this.m_eps)}assign(t){return this.m_value=t.m_value,this.m_eps=t.m_eps,this}scaleError(t){this.m_eps*=t}setError(t){this.m_eps=t}set(t,s){return this.m_value=t,this.m_eps=s??0,this}setWithEps(t,s){return void 0===s&&(s=1),this.m_value=t,this.m_eps=p.ulp(t)*s,this}setE(t){return this.m_value=t.m_value,this.m_eps=t.m_eps,this}precise(){return new p(this.m_value)}value(){return this.m_value}toDouble(){return this.m_value}eps(){return this.m_eps}resetError(){return this.m_eps=0,this}absThis(){return this.m_value=Math.abs(this.m_value),this}add(t){return this.clone().addThis(t)}addE(t){return this.clone().addThisE(t)}addThisE(t){const s=this.m_value+t.m_value,i=this.m_eps+t.m_eps+p.ulp(s);return this.m_value=s,this.m_eps=i,this}addThis(t){const s=this.m_value+t,i=this.m_eps+p.ulp(s);return this.m_value=s,this.m_eps=i,this}subE(t){return this.clone().subThisE(t)}sub(t){return this.clone().subThis(t)}subThisE(t){const s=this.m_value-t.m_value,i=this.m_eps+t.m_eps+p.ulp(s);return this.m_value=s,this.m_eps=i,this}subThis(t){const s=this.m_value-t,i=this.m_eps+p.ulp(s);return this.m_value=s,this.m_eps=i,this}setAddE(t,s){return this.m_value=t.m_value+s.m_value,this.m_eps=t.m_eps+s.m_eps+p.ulp(this.m_value),this}setAdd(t,s){return this.m_value=t+s,this.m_eps=p.ulp(this.m_value),this}setAddEN(t,s){return this.m_value=t.m_value+s,this.m_eps=t.m_eps+p.ulp(this.m_value),this}setAddNE(t,s){return this.m_value=t+s.m_value,this.m_eps=s.m_eps+p.ulp(this.m_value),this}setSubE(t,s){return this.m_value=t.m_value-s.m_value,this.m_eps=t.m_eps+s.m_eps+p.ulp(this.m_value),this}setSub(t,s){return this.m_value=t-s,this.m_eps=p.ulp(this.m_value),this}setSubEN(t,s){return this.m_value=t.m_value-s,this.m_eps=t.m_eps+p.ulp(this.m_value),this}setSubNE(t,s){return this.m_value=t-s.m_value,this.m_eps=s.m_eps+p.ulp(this.m_value),this}mulThisE(t){const s=this.m_value*t.m_value;return this.m_eps=this.m_eps*Math.abs(t.m_value)+t.m_eps*Math.abs(this.m_value)+this.m_eps*t.m_eps+p.ulp(s),this.m_value=s,this}mulThis(t){const s=this.m_value*t;return this.m_eps=this.m_eps*Math.abs(t)+p.ulp(s),this.m_value=s,this}mul(t){return this.clone().mulThis(t)}mulE(t){return this.clone().mulThisE(t)}setMulE(t,s){const i=t.m_value*s.m_value;return this.m_eps=t.m_eps*Math.abs(s.m_value)+s.m_eps*Math.abs(t.m_value)+t.m_eps*s.m_eps+p.ulp(i),this.m_value=i,this}setMul(t,s){return this.m_value=t*s,this.m_eps=p.ulp(this.m_value),this}setMulEN(t,s){return this.setE(t),this.mulThis(s)}setMulNE(t,s){return this.setE(s),this.mulThis(t)}mulThisByPower2(t){return this.m_value*=t,this.m_eps*=Math.abs(t),this}static st_mulByPower2(t,s){return new p(t.m_value,t.m_eps).mulThisByPower2(s)}divE(t){return this.clone().divThisE(t)}divThisE(t){const s=Math.abs(t.m_value),i=this.m_value/t.m_value;let e=(this.m_eps+Math.abs(i)*t.m_eps)/s;if(t.m_eps>.01*s){const i=t.m_eps/s;e*=1+(1+i)*i}return this.m_value=i,this.m_eps=e+p.ulp(i),this}divThis(t){const s=Math.abs(t);return this.m_value/=t,this.m_eps=this.m_eps/s+p.ulp(this.m_value),this}setDivE(t,s){return this.setE(t),this.divThisE(s)}setDiv(t,s){return this.m_value=t/s,this.m_eps=p.ulp(this.m_value),this}setDivEN(t,s){return this.setE(t),this.divThis(s)}setDivNE(t,s){return this.set(t),this.divThisE(s)}divThisByPower2(t){return this.m_value/=t,this.m_eps/=Math.abs(t),this}invThis(){return this.setE(w.clone().divThisE(this)),this}sqrt(){return this.clone().sqrtThis()}sqrtThis(){let t,s;return this.m_value>=0?(t=Math.sqrt(this.m_value),s=this.m_value>10*this.m_eps?.5*this.m_eps/t:this.m_value>this.m_eps?t-Math.sqrt(this.m_value-this.m_eps):Math.max(t,Math.sqrt(this.m_value+this.m_eps)-t),s+=p.ulp(t)):this.m_value<-this.m_eps?(t=Number.NaN,s=Number.NaN):(t=0,s=Math.sqrt(this.m_eps)),this.m_value=t,this.m_eps=s,this}sqr(){return this.clone().sqrThis()}sqrThis(){const t=this.m_value*this.m_value;return this.m_eps=2*this.m_eps*Math.abs(this.m_value)+this.m_eps*this.m_eps+p.ulp(t),this.m_value=t,this}setSin(t){const s=Math.sin(t.m_value),i=Math.cos(t.m_value);this.m_value=s;const e=Math.abs(s),n=Math.abs(t.value());return this.m_eps=(Math.abs(i)+.5*e*t.m_eps)*t.m_eps+p.ulp(e+n),this}static ulp(t){let s=us(t);const i=((0x7ff0000000000000n&s)>>52n)-1075n;return i>-1023n?(s=i+0x3ffn<<52n,hs(s)):0===t?0:Number.MIN_VALUE}setCos(t){const s=Math.sin(t.m_value),i=Math.cos(t.m_value);this.m_value=i;const e=Math.abs(i),n=Math.abs(t.value());return this.m_eps=(Math.abs(s)+.5*e*t.m_eps)*t.m_eps+p.ulp(e+n),this}static st_cosAndSin(t,s,i){const e=Math.sin(t.m_value),n=Math.cos(t.m_value);i.m_value=e,s.m_value=n;const r=Math.abs(e),u=Math.abs(n),h=Math.abs(t.value());i.m_eps=(Math.abs(n)+.5*r*t.m_eps)*t.m_eps+p.ulp(r+h),s.m_eps=(Math.abs(e)+.5*u*t.m_eps)*t.m_eps+p.ulp(u+h)}negate(){return this.clone().negateThis()}negateThis(){return this.m_value=-this.m_value,this}setAbs(){return this.m_value=Math.abs(this.m_value),this}isInInterval(t){return x.construct(this.m_value-this.m_eps,this.m_value+this.m_eps).isIntersecting(t)}eq(t){return Math.abs(this.m_value-t.m_value)<=this.m_eps+t.m_eps}ne(t){return!this.eq(t)}gt(t){return this.m_value-t.m_value>this.m_eps+t.m_eps}lt(t){return t.m_value-this.m_value>this.m_eps+t.m_eps}ge(t){return!this.lt(t)}le(t){return!this.gt(t)}tolEQ(t,s){return Math.abs(this.m_value-t.m_value)<=s||this.eq(t)}tolNE(t,s){return!this.tolEQ(t,s)}tolGT(t,s){return this.m_value-t.m_value>s&&this.gt(t)}tolLT(t,s){return t.m_value-this.m_value>s&&this.lt(t)}tolGE(t,s){return!this.tolLT(t,s)}tolLE(t,s){return!this.tolGT(t,s)}isZero(){return Math.abs(this.m_value)<=this.m_eps}isFuzzyZero(){return this.isZero()&&0!==this.m_eps}tolIsZero(t){return Math.abs(this.m_value)<=Math.max(this.m_eps,t)}setPi(){this.setE(E)}setEuler(){this.set(2.718281828459045,M())}static size(){return 1}}function y(t,s){const i=as(t),e=as(s),n=53-b(i),r=53-b(e);return(n>=0?n:0)+(r>=0?r:0)<=52}function T(t,s){const i=t+s;return i-t===s&&i-s===t}function g(t,s){const i=t-s;return t-i===s&&s+i===t}function M(){return Qs()}p.dimensions=1;const E=new p(Math.PI,.5*M()),I=new p(0,0),w=new p(1,0),D=new p(4,0);function A(t,s,i){return t.addE(s.subE(t).mulE(i))}function P(t,s,i){return s.subE(s.subE(t).mulE(w.subE(i)))}function q(t){return Math.atanh(t)}function z(t){let s;if(0===t)s=1;else if(Math.abs(t)>.01)s=q(t)/t;else{let i;const e=-36.841361487904734;s=0;const n=t*t;for(let t=2*Math.trunc(e/Math.log(n)+2.5)-1;t>1;t-=2)i=1/t,s=(s+i)*n;s+=1}return s}function Z(t){const s=Math.PI*Math.PI/6;let i;if(1===t)i=s;else if(t>1)i=s;else if(0===t)i=t;else if(t<0){const s=1+(t=Math.abs(t)),e=Math.log(s);i=e*e/-2-Z(t/s)}else if(t>.5){const e=1-t,n=Math.log(t)*Math.log(e);i=s-Z(e)-n}else{i=0;const s=1+Math.trunc(-16*Math.log(10)/Math.log(t)+1.5);let e=s;for(let n=s;n>0;n--,e-=1)i*=t,i+=1/(e*e);i*=t}return i}function C(t,s){const i=s*t;if(Math.abs(s)<.1){let s=0;for(let t=60;t>=1;t--)s*=i,s+=1/t/t;return s*=t,s}return Z(i)/s}function R(t,s){return t<s?$t(t,s):$t(s,t)}function B(t,s){const i=Math.abs(t);return s>=0?i:-i}function S(t){return Math.round(t)}function k(t,s,i,e,n){n[0]=s[0]+(i[0]-s[0])*e,n[1]=s[1]+(i[1]-s[1])*e,3===t&&(n[2]=s[2]+(i[2]-s[2])*e)}function F(t,s,i,e,n){n[0]=i[0]-(i[0]-s[0])*(1-e),n[1]=i[1]-(i[1]-s[1])*(1-e),3===t&&(n[2]=i[2]-(i[2]-s[2])*(1-e))}function L(t,s,i,e,n){e<=.5?k(t,s,i,e,n):F(t,s,i,e,n)}function O(t,s,i,e,n){n[0]=s[0].addE(i[0].subE(s[0]).mulE(e)),n[1]=s[1].addE(i[1].subE(s[1]).mulE(e))}function G(t,s,i,e,n){n[0]=i[0].subE(i[0].subE(s[0]).mulE(w.subE(e))),n[1]=i[1].subE(i[1].subE(s[1]).mulE(w.subE(e)))}function Q(t,s,i){let e;return e=i<=.5?t+(s-t)*i:s-(s-t)*(1-i),e}function V(t,s,i){return t+(s-t)*i}function U(t,s,i){return s-(s-t)*(1-i)}function Y(t,s,i,e){i<=.5?(e.x=t.x+(s.x-t.x)*i,e.y=t.y+(s.y-t.y)*i):(e.x=s.x-(s.x-t.x)*(1-i),e.y=s.y-(s.y-t.y)*(1-i))}function j(t,s,i,e){i<=.5?(e.x=t.x+(s.x-t.x)*i,e.y=t.y+(s.y-t.y)*i,e.z=t.z+(s.z-t.z)*i):(e.x=s.x-(s.x-t.x)*(1-i),e.y=s.y-(s.y-t.y)*(1-i),e.z=s.z-(s.z-t.z)*(1-i))}function H(t){return t*t}function $(t){return t*t*t}function J(t){return 1/Math.sqrt(t)}function K(t){return t<0?-1:t>0?1:0}function W(t,s,i,e){const n=[0],r=[0],u=[0];return lt(ut(t,i,n),ut(s,e,r),u)+(n[0]+r[0]+u[0])}const X=[0],tt=[0];function st(t,s,i){return mt(ut(t,s,X),i,X[0],tt)}const it=[0],et=[0],nt=[0],rt=[0];function ut(t,s,i){const e=t*s;return ht(t,it,et),ht(s,nt,rt),i[0]=et[0]*rt[0]-(e-it[0]*nt[0]-et[0]*nt[0]-it[0]*rt[0]),e}function ht(t,s,i){const e=134217729*t;s[0]=e-(e-t),i[0]=t-s[0]}const at=[0],ot=[0];function mt(t,s,i,e){const n=lt(t,s,at),r=lt(n,i,ot);return lt(r,at[0]+ot[0],e)}function lt(t,s,i){const e=t+s;return Math.abs(t)>Math.abs(s)?i[0]=t-e+s:i[0]=s-e+t,e}function ct(t,s){return t%s}function ft(t){const s=1-t;if(0===s)return 1;let i;if(s<=.01){const t=s,e=Math.log(t);i=1+t*(.4431471805599453-.25*e+t*(.05680519270997949-.09375*e+t*(.02183137044373718-.05859375*e+t*(.011544521417308362-.042724609375*e+t*(.00714200031339596-.0336456298828125*e+t*(.004854743337164948-.027757644653320312*e+t*(.003514687963781376-.023627042770385742*e)))))))}else{if(t<.016){const s=t,i=.25,e=.046875,n=.01953125,r=.01068115234375,u=.0067291259765625,h=.004626274108886719,a=.0033752918243408203,o=.0025710230693221092;return Js()*(1-s*(i+s*(e+s*(n+s*(r+s*(u+s*(h+s*(a+s*o))))))))}i=bt(0,s,1)-t*dt(0,s,1)/3}return Us(i,1,Js())}function _t(t,i,e=Number.NaN){if(s(i>=0&&i<=1),0===i)return t;let n=1,r=t;if(r<0&&(r=-r,n=-1),1===i){const t=Math.round(r/Hs()),s=r-t*Hs();return n*(2*t+Math.sin(s))}const u=Js(),h=Math.floor(r/u);1&h?r=(h+1)*u-r:r-=h*u;const a=Math.sin(r),o=Number.isNaN(e)?ft(i):e;let m;if(1===a)m=o+Math.sqrt(1-i)*(r-u);else{const t=r*r;if(.01424*Math.pow(t,4)<=2*Qs()){m=r*(1+t*i*(-1/6+t*((4-3*i)/120-(16+(45*i-60)*i)/5040*t)))}else if(i<=.01){const t=Math.sin(2*r),s=Math.sin(4*r),e=Math.sin(6*r),n=Math.sin(8*r),u=Math.sin(10*r);m=r+i*((2*-r+t)/8+i*((-3*r+2*t-.25*s)/64+i*((-20*r+15*t-3*s+e/3)/1024+i*(5*(-140*r+112*t-28*s+16/3*e-.5*n)/65536+7*i*((-63*r+52.5*t-15*s+3.75*e-.625*n+.05*u)/65536+i*(-693*r+594*t-185.625*s+1.375*e-12.375*n+1.8*u-.125*Math.sin(12*r))/1048576)))))}else{const t=a*a,s=Math.cos(r),e=s*s,n=xt(a,s,i);m=a*(bt(e,n,1)-i*t*dt(e,n,1)/3)}}if(1&h){m=o*(h+1)-m}else m+=o*h;return n*m}function vt(t,s,i=Number.NaN){if(0===t)return 0;let e=1,n=t;t<0&&(n=-n,e=-1);const r=Number.isNaN(i)?ft(s):i,u=Math.floor(n/r);1&u?n=(u+1)*r-n:n-=u*r;let h=n<=0?0:n>=r?Js():Nt(n,s,r);return 1&u?h=Js()*(u+1)-h:h+=Js()*u,e*h}function bt(t,i,e){s((0!==t?1:0)+(0!==i?1:0)+1>1);let n=t,r=i,u=e;for(;;){const t=Math.sqrt(n*r)+Math.sqrt(r*u)+Math.sqrt(u*n);n=.25*(n+t),r=.25*(r+t),u=.25*(u+t);const s=(n+r+u)/3,i=(s-n)/s,e=(s-r)/s,h=(s-u)/s;if(Math.abs(i)<=.0024&&Math.abs(e)<=.0024&&Math.abs(h)<=.0024){const t=i*e-h*h,n=i*e*h;return(1+(1/24*t-.1-3/44*n-5*t*t/208+t*n/16)*t+(1/14+3*n/104)*n)/Math.sqrt(s)}}}function dt(t,i,e){s(0!==t||0!==i);let r=t,u=i,h=e;const a=new n(0);let o=1;for(;;){const t=.2*(r+u+3*h),s=(t-r)/t,i=(t-u)/t,e=(t-h)/t;if(Math.abs(s)<=.0015&&Math.abs(i)<=.0015&&Math.abs(e)<=.0015){const n=s*i,r=e*e,u=n-r,h=n-6*r,m=h+u+u,l=9/22,c=3/26,f=h*(.25*l*h-.21428571428571427-1.5*c*e*m),_=e*(1/6*m+e*(-l*u+e*c*n));return 3*a.getResult()+o*(1+f+_)/(t*Math.sqrt(t))}const n=Math.sqrt(r),m=Math.sqrt(u),l=Math.sqrt(h),c=n*(m+l)+m*l;a.add(o/(l*(h+c))),o*=.25,r=.25*(r+c),u=.25*(u+c),h=.25*(h+c)}}function xt(t,s,i){return t<.999?1-i*H(t):1-i+i*H(s)}function Nt(t,s,i){if(0===s)return t;if(1===s)return Math.asin(t);let e=0,n=!0;if(t<.2){const i=t*t,r=t*(1+i*s*(1/6+i*((13*s-4)/120+(16-284*s+493*s*s)/5040*i))),u=Math.abs(s*(4944*s-64-31224*s*s+37369*s*s*s)/362880*Math.pow(t,9));if(u<Math.abs(r)*Qs())return r;e=r,n=u>.1*r}if(n){const n=1-s,r=1-t/i,u=Math.sqrt(r*r+n*n),h=Math.atan2(n,t+Qs());e=Js()+Math.sqrt(u)*(h-Js())}let r=0;for(let u=0;u<7;u++){r=_t(e,s,i);const n=xt(Math.sin(e),Math.cos(e),s);if(e-=(r-t)/Math.sqrt(n),u>0&&Math.abs(r-t)<=4*Qs()*t)break}return e}class pt{constructor(t){for(this.values=[[1]];this.values.length<t+1;){const t=this.values.at(-1),s=Yt(t.length+1,1);for(let i=1;i<t.length;++i)s[i]=t[i-1]+t[i];this.values.push(s)}}get(t,s){return this.values[t][s]}}function yt(t,i){return s(0),0}const Tt=new pt(32);function gt(t,s){if(t<Tt.values.length)return Tt.get(t,s);const e=Math.exp(yt());return e+.01>ds()&&i("The result value of n choose k is out of range"),e+.01}function Mt(t,s){if(t.isZero())return t.clone();const i=t.clone().divThis(t);if(s<0)return i.divThis(Mt(t,-s));for(t=t.clone(),s=Math.trunc(s);1&s&&i.mulThis(t),s>>=1;)t.mulThis(t);return i}function Et(t,s){if(0===s)return[];const i=t[0].clone().mulDoubleThis(0),e=[];e.length=s;const n=s-1;for(let r=0;r<=n;++r){e[r]=i.clone();for(let s=0;s<=r;++s)e[r].addThis(t[s].clone().mulDoubleThis(gt(r,s)/gt(n,s)))}return e}function It(s,i,e,n,r){return 0===s?0===n?i:1===n?e:r:1===s?0===n?i:1===n?e:Q(i,e,n):(2===s&&t("angular interpolation"),void t(""))}function wt(s,i,e,n,r,u,h,a){if(0===s)for(let t=0;t<u;++t)n[t+r]=0===h?i[t]:1===h?e[t]:a;else if(1===s)if(0===h)Dt(n,i,r,0,u);else if(1===h)Dt(n,e,r,0,u);else for(let t=0;t<u;++t)n[t+r]=Q(i[t],e[t],h);else if(2===s)if(0===h)Dt(n,i,r,0,u);else if(1===h)Dt(n,e,r,0,u);else{let t=0;for(let s=0,a=r;s<u;++s,++a)n[a]=Q(i[s],e[s],h),t+=n[a]*n[a];if(t>0){t=Math.sqrt(t);for(let s=r;s<r+u;++s)n[s]/=t}else{for(let t=r;t<r+u;++t)n[t]=0;n[r]=1}}else t("")}function Dt(t,s,i,e,n){if(0===n)return;let r=0,u=i,h=e;for(;r++<n;)t[u++]=s[h++]}function At(t,s,i){let e=0;for(let n=0;!e&&n<i;++n)e=t[n]-s[n];return e}function Pt(t,s){return t}function qt(t){t.sort((t,s)=>t<s?-1:t>s?1:0)}function zt(t,s){const i=t.slice(0,s);qt(i),Dt(t,i,0,0,s)}function Zt(t,s,i,e){const n=t.slice(s,s+i);n.sort(e),Dt(t,n,s,0,i)}function Ct(t,s){return t<s?-1:t>s?1:0}function Rt(t,s,i,e){return t<i?-1:t>i?1:s<e?-1:s>e?1:0}function Bt(t,s){if(t.length<2)return t.length;let i=0;for(let e=1;e<t.length;++e)s(t[e],t[i])||(i++,t[e]=Pt(t[i],t[i]=t[e]));return 1+i}function St(t,s){t[s]=t.at(-1),t.pop()}function kt(t,s=!1){return{[Symbol.dispose](){this.bForget||t()},bForget:s}}function Ft(t,s,i){t.length=s,t.fill(i)}function Lt(t,s,i){t.length=i;for(let e=0;e<i;++e)t[e]=new s}function Ot(t,s){const i=new Array(s);for(let e=0;e<s;++e)i[e]=new t;return i}function Gt(t,s,i){for(let e=0;e<i;++e)t[e].assign(s[e]);return i}function Qt(t,s){const i=t.slice(0,s);for(let e=0;e<s;++e)i[e]=i[e].clone();return i}function Vt(t){return Array.from({length:t},()=>null)}function Ut(t,s){return Array.from({length:s},()=>t())}function Yt(t,s){const i=new Array(t);return i.fill(s),i}function jt(t,s){return s in t&&1===Object.getOwnPropertyNames(t).length}class Ht{constructor(...t){this.m_elts=t}get length(){return this.m_elts.length}at(t){return this.m_elts[t]}[Symbol.dispose](){for(const t of this.m_elts)t[Symbol.dispose]()}}function $t(t,s){return{first:t,second:s}}const Jt=Math.PI,Kt=2*Math.PI,Wt=.5*Math.PI;class Xt{constructor(t,s){this.m_cr=t,this.m_cc=s,this.m_v=Yt(t*s,0)}get(t,s){return this.m_v[t*this.m_cc+s]}set(t,s,i){this.m_v[t*this.m_cc+s]=i}inc(t,s){return++this.m_v[t*this.m_cc+s]}}const ts=new ArrayBuffer(8),ss=new Float64Array(ts),is=new BigUint64Array(ts),es=0x0fffffffffffffn,ns=0x7ff0000000000000n;function rs(){return Number.EPSILON*Fs}function us(t){return ss[0]=t,is[0]}function hs(t){return is[0]=t,ss[0]}function as(t){return us(t)&es}function os(t){return Number((us(t)&ns)>>52n)}function ms(t){if(0n===t)return-1n;if(1n===t||-1n===t)return 0n;t<0n&&(t=-t);let s=0n,i=512n,e=1n<<s+i;for(;t>=e;)s+=i,i<<=1n,e<<=i;let n=s;i>>=1n;let r=n+i;for(;i>0n;)t<1n<<r||(n=r),i>>=1n,r=n+i;return n}function ls(t,s){return t===s||Number.isNaN(t)&&Number.isNaN(s)}function cs(t,s,i){return t===s||Math.abs(t-s)<=i||Number.isNaN(t)&&Number.isNaN(s)}function fs(t,s){return t<s?-1:t>s?1:0}function _s(t,s){if(t<s)return-1;if(t>s)return 1;if(t===s)return 0;{const i=Number.isNaN(t),e=Number.isNaN(s);return i<e?-1:i>e?1:0}}function vs(){return 2147483647}function bs(){return 32767}function ds(){return 2147483647}function xs(){return-2147483648}const Ns=ds(),ps=BigInt(Ns),ys=2166136261,Ts=16777619;function gs(t){let s=ys,i=t;return s=(s^255&i)*Ts,i>>=8,s=(s^255&i)*Ts,i>>=8,s=(s^255&i)*Ts,i>>=8,s=(s^255&i)*Ts,s&Ns}const Ms=14695981039346656037n,Es=1099511628211n;function Is(t){let s=Ms,i=t;return s=(s^0xffn&i)*Es,i>>=8n,s=(s^0xffn&i)*Es,i>>=8n,s=(s^0xffn&i)*Es,i>>=8n,s=(s^0xffn&i)*Es,i>>=8n,s=(s^0xffn&i)*Es,i>>=8n,s=(s^0xffn&i)*Es,i>>=8n,s=(s^0xffn&i)*Es,s&ps}function ws(t){return 1103515245*t+12345&2147483647}function Ds(t){let s=ys;for(let i=0,e=t.length;i<e;++i)s=(s^t.charCodeAt(i))*Ts;return s&Ns}function As(t,s){return s+2654435769+(t<<6)+(t>>2)&Ns}function Ps(t,s){return As(t,Cs(s))}function qs(t){return As(3735928559,t)}function zs(t,s){return As(t,qs(s))}function Zs(t){return gs(t)}function Cs(t){return Number(Is(t))}function Rs(t){return Xs(t)}function Bs(t){return Cs(us(Rs(t)))}function Ss(t){return ws(t)}const ks=100,Fs=100;function Ls(){return Number.EPSILON*ks}function Os(){return.38196601125010515}function Gs(){return 1.4142135623730951}function Qs(){return Number.EPSILON}function Vs(t,s,i){return t===s||t===i}function Us(t,s,i){return t>=s?t<=i?t:i:s}function Ys(t,s,i){const e=t[0];if(e>=s){if(e<=i)return!1;t[0]=i}else t[0]=s;return!0}function js(t,s){return t>=s?s:t<-s?-s:t}function Hs(){return Jt}function $s(){return Kt}function Js(){return Wt}const Ks=3*Js();function Ws(){return Ks}function Xs(t){return t+0}function ti(t){return{v:t}}class si{constructor(){this.m_rn=ti(0n),this.m_rd=ti(1n),this.m_bNaN=!1,this.m_bNormalized=!1,this.m_power=0,this.m_sign=0}static constructAssign(t,s){const i=t.clone();return void 0!==s&&i.limitPrecisionThis(s),i}static constructDouble(t){return(new si).setDouble(t)}static constructInt64(t){return(new si).setInt64(t)}static constructRational(t,s){return(new si).setRational(t,s)}static constructInt32(t){return this.constructInt64(BigInt(Math.trunc(t)))}[Symbol.toPrimitive](t){return this}compare(t){return this.lt(t)?-1:this.gt(t)?1:0}assignCopy(t){return this.setThis(t)}abs(){return this.clone().absThis()}absThis(){return this.isNAN()||(this.m_sign*=this.m_sign),this}clone(){return(new si).setThis(this)}setThis(t){return this.m_bNaN=t.m_bNaN,this.m_bNormalized=t.m_bNormalized,this.m_rn.v=t.m_rn.v,this.m_rd.v=t.m_rd.v,this.m_power=t.m_power,this.m_sign=t.m_sign,this}setZero(){return this.m_rn.v=0n,this.m_rd.v=1n,this.m_bNaN=!1,this.m_power=0,this.m_bNormalized=!0,this.m_sign=0,this}setDouble(s){if(this.setZero(),0===s)return this;if(Number.isInteger(s)&&Math.abs(s)<ds())return this.setInt32(s);const i=us(s),e=(i&si.s_em)>>52n,n=!!(i&si.s_sm),r=i&si.s_fm;if(e===si.s_emax)return r?(this.m_rn.v=this.m_rd.v=0n,this.m_bNaN=!0,this):(this.m_rn.v=n?-1n:1n,this.m_rd.v=0n,this);0n===e&&t("denormalized numbers not yet implemented");const u=e-1023n,h=u>=0n?u:0n,a=u<0n?-u:0n;return this.m_rn.v=(1n<<52n|r)<<h,this.m_rd.v=1n<<52n+a,this.m_sign=n?-1:1,this.m_bNormalized=!1,this.normalizeThis()}setInt64(t){return 0n===t?this.setZero():(this.m_bNaN=!1,this.m_sign=t>0n?1:-1,this.m_rn.v=t>0n?t:-t,this.m_rd.v=1n,this.m_power=0,this.m_bNormalized=!1,this.normalizeThis())}setRational(t,s){return 0n===t?0n===s?this.setNAN():this.setZero():0n===s?t>0n?this.setPositiveInf():this.setNegativeInf():(this.m_sign=(t>0n?1:-1)*(s>0n?1:-1),this.m_rn.v=t>0n?t:-t,this.m_rd.v=s>0n?s:-s,this.m_power=0,this.m_bNormalized=!1,this.normalizeThis())}setInt32(t){return this.setInt64(BigInt(Math.trunc(t)))}getDouble(){return this.convertToDouble()}toDouble(){return this.convertToDouble()}value(){return this.convertToDouble()}isNAN(){return this.m_bNaN}isPositiveInf(){return!this.isNAN()&&(0n===this.m_rd.v&&1===this.m_sign)}isNegativeInf(){return!this.isNAN()&&(0n===this.m_rd.v&&-1===this.m_sign)}isFinite(){return!this.isNAN()&&0n!==this.m_rd.v}setNAN(){return this.m_bNaN=!0,this.m_rn.v=0n,this.m_rd.v=0n,this.m_power=0,this.m_bNormalized=!0,this}setPositiveInf(){return this.m_rn.v=1n,this.m_rd.v=0n,this.m_bNaN=!1,this.m_bNormalized=!0,this.m_sign=1,this.m_power=0,this}setNegativeInf(){return this.m_rn.v=1n,this.m_rd.v=0n,this.m_bNaN=!1,this.m_bNormalized=!0,this.m_sign=-1,this.m_power=0,this}subThis(t){if(t.isNAN()&&this.setNAN(),this.isPositiveInf()&&t.isPositiveInf())this.setNAN();else{if(this.isPositiveInf()&&t.isNegativeInf())return this.setPositiveInf(),this;if(this.isNegativeInf()&&t.isNegativeInf())this.setNAN();else if(this.isNegativeInf()&&t.isPositiveInf())return this.setNegativeInf(),this}return this.isNAN()?this:this.opPlusMinus(t,!1)}thisSubAbs(t){return s(0),this}mulThis(t){return t.isNAN()&&this.setNAN(),this.isNAN()?this:(this.m_sign*=t.m_sign,0===this.m_sign?this.setZero():(this.m_rn.v*=t.m_rn.v,this.m_rd.v*=t.m_rd.v,this.m_power+=t.m_power,this.m_bNormalized=!1,this.normalizeThis(),this))}mulDoubleThis(t){return this.mulThis(si.constructDouble(t))}thisMulInt64(t){return s(0),this}thisMulInt32(t){return s(0),this}divThis(t){return this.mulThis(t.clone().invertThis())}divDoubleThis(t){return this.divThis(si.constructDouble(t))}addDoubleThis(t){return this.addThis(si.constructDouble(t))}subDoubleThis(t){return this.subThis(si.constructDouble(t))}mul(t){return this.clone().mulThis(t)}mulBigIntThis(t){return this.mulThis(si.constructInt64(t))}mulDouble(t){return this.clone().mulThis(si.constructDouble(t))}div(t){return this.clone().divThis(t)}divDouble(t){return this.clone().divDoubleThis(t)}add(t){return this.clone().addThis(t)}fmSubThis(t,s){return this.subThis(t.clone().mulThis(s))}fmAddThis(t,s){return this.addThis(t.clone().mulThis(s))}addThis(t){if(t.isNAN()&&this.setNAN(),this.isPositiveInf()&&t.isPositiveInf())return this.setPositiveInf(),this;if(this.isPositiveInf()&&t.isNegativeInf())this.setNAN();else{if(this.isNegativeInf()&&t.isNegativeInf())return this.setNegativeInf(),this;this.isNegativeInf()&&t.isPositiveInf()&&this.setNAN()}return this.isNAN()?this:this.opPlusMinus(t,!0)}addDouble(t){return this.clone().addThis(si.constructDouble(t))}sub(t){return this.clone().subThis(t)}subDouble(t){return this.clone().subThis(si.constructDouble(t))}isZero(){return 0===this.m_sign}equals(t){return this.clone().subThis(t).isZero()}lt(t){return!this.isNAN()&&!t.isNAN()&&(!(this.isPositiveInf()&&t.isPositiveInf()||this.isNegativeInf()&&t.isNegativeInf())&&(!this.isPositiveInf()&&(!!t.isPositiveInf()||this.clone().sub(t).LZ())))}absLessAbs(t){return this.abs().lt(t.abs())}gt(t){return this.clone().sub(t).GZ()}lte(t){return this.sub(t).LEZ()}gte(t){return this.sub(t).GEZ()}normalizeThis(){if(this.m_bNormalized)return this;if(0n===this.m_rn.v)return this.setZero();let t=0,s=0xffffffffn;for(;0n===(this.m_rn.v&s)&&s<=this.m_rn.v;)s<<=32n,t+=32;s&=this.m_rn.v,s>>=BigInt(t),t+=_(BigInt.asUintN(32,s))-1;let i=0;for(s=0xffffffffn;0n===(this.m_rd.v&s)&&s<=this.m_rd.v;)s<<=32n,i+=32;return s&=this.m_rd.v,s>>=BigInt(i),i+=_(BigInt.asUintN(32,s))-1,this.m_rn.v>>=BigInt(t),this.m_rd.v>>=BigInt(i),this.m_power+=t-i,this.m_rn.v>1n&&this.m_rd.v>1n&&(this.m_rn.v%this.m_rd.v===0n?(this.m_rn.v/=this.m_rd.v,this.m_rd.v=1n):this.m_rd.v%this.m_rn.v===0n&&(this.m_rd.v/=this.m_rn.v,this.m_rn.v=1n)),this.m_bNormalized=!0,this}negateThis(){return this.isNAN()||(this.m_sign*=-1),this}negate(){return this.clone().negateThis()}invertThis(){return this.isNAN()?this:this.isPositiveInf()||this.isNegativeInf()?(this.setZero(),this):0n===this.m_rn.v?(this.setPositiveInf(),this):(this.m_rd=Pt(this.m_rn,this.m_rn=this.m_rd),this.m_power=-this.m_power,this)}limitPrecisionThis(t){if(0===t)return this;if(this.isZero())return this.setZero();if(!this.isFinite())return this;this.normalizeThis();let s=Number(ms(this.m_rn.v));if(s>t){const i=s-t;this.m_rn.v>>=BigInt(s-t),this.m_power+=i}if(s=Number(ms(this.m_rd.v)),s>t){const i=s-t;this.m_rd.v>>=BigInt(s-t),this.m_power-=i}return this}hiBitIndex(){return Math.max(Number(ms(this.m_rn.v)),Number(ms(this.m_rd.v)))}ldexp(t){return this.clone().ldexpThis(t)}ldexpThis(t){return t&&(this.m_bNormalized=!1,this.m_power+=t,this.normalizeThis()),this}static lerp(t,s,i){return si.lerpLo(s,s,i)}static lerpLo(t,s,i){return s.sub(t).mulThis(i).addThis(t)}static lerpHi(t,s,i){return s.sub(t).mulThis(ii.sub(i)).addThis(t)}LZ(){return!this.isNAN()&&-1===this.m_sign}GZ(){return!this.isNAN()&&1===this.m_sign}LEZ(){return!this.isNAN()&&this.m_sign<=0}GEZ(){return!this.isNAN()&&this.m_sign>=0}toString(){return this.toDouble().toString()}sqr(){return this.clone().sqrThis()}sqrThis(){return this.mulThis(this.clone())}static sqrt(t,e){if(t.m_sign<0n&&i("MP_value: sqrt(-1)"),t.isZero())return t.clone();let n=52,r=2220446049250313e-31;for(;n<e;)2*n<=e?(r*=r,n*=2):(r*=2220446049250313e-31,n+=52);n+=52;const u=ms(t.m_rn.v),h=ms(t.m_rd.v);let a,o=t.m_power+Number(u-h);const m=new si;Math.abs(o)>200?(1&Math.abs(o)&&(o+=1),a=si.constructAssign(t,53).ldexpThis(-o).value(),m.setThis(t).ldexpThis(-o),s(Number.isFinite(a))):(m.setThis(t),a=m.value(),s(Number.isFinite(a)),o=0),a=Math.sqrt(a);const l=si.constructDouble(a),c=si.constructDouble(r);c.mulThis(l).ldexpThis(1);const f=r*a*2,_=l.clone(),v=new si;let b;for(let s=0;s<10;++s){_.mulThis(l),v.setThis(m).subThis(_).absThis();let t=v.value();if(b=1,t<.9)for(;t>f;)t*=t,++b;else b=4;if(v.lte(c))break;for(let s=0;s<b;s++)_.setThis(l).divThis(m).invertThis().addThis(l).ldexpThis(-1).limitPrecisionThis(n),l.setThis(_)}return l.ldexpThis(o/2)}static cubicRoot(t,s){if(t.isZero())return t.clone();let i=52,e=2220446049250313e-31;for(;i<s;)2*i<=s?(e*=e,i*=2):(e*=2220446049250313e-31,i+=52);i+=52;const n=Math.pow(Math.abs(t.value()),1/3),r=si.constructDouble(n),u=r.clone();u.sqrThis().mulDoubleThis(3).mulDoubleThis(e),u.limitPrecisionThis(32),t.LZ()&&r.negateThis();for(let h=0;h<10;++h){const s=r.clone();s.sqrThis().mulThis(r);const e=s.clone();if(e.subThis(t),e.absThis().limitPrecisionThis(32),e.lte(u))break;e.setThis(t),e.ldexpThis(1),e.addThis(s);const n=s.clone();n.ldexpThis(1),n.addThis(t),e.divThis(n),r.mulThis(e),r.limitPrecisionThis(i)}return r}isInTheRangeOfDouble(){return s(0),!1}sign(){return this.m_sign}cosAndSin(t,i){s(0)}pow(t){return Mt(this,t)}static nan(){return s(0),new si}convertToDouble(){if(this.m_bNaN)return Number.NaN;if(this.isZero())return 0;if(0n===this.m_rd.v)return 1===this.m_sign?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;const t=-1===this.m_sign,s=this.m_rn.v<<(this.m_power>=0?BigInt(this.m_power):0n);let i=this.m_rd.v<<(this.m_power<0?BigInt(-this.m_power):0n);const e=s/i;let n=Number(e);if(BigInt(n)!==e)return t?-n:n;let r=s-e*i;if(r){let t=ms(i)-1023n;t>0n&&(i>>=t,r<<=52n,r>>=t);let s=Number(r);Number.isFinite(s)||(r>>=52n,s=Number(r),t=0n),t>0n&&(s/=Math.pow(2,52));n+=s/Number(i)}return t?-n:n}signVal(){return 1===this.m_sign?1n:-1===this.m_sign?-1n:0n}opPlusMinus(t,s){const i=Math.min(this.m_power,t.m_power);let e,n;this.m_power>i?(e=BigInt(this.m_power-i),n=0n):(e=0n,n=BigInt(t.m_power-i));const r=this.signVal()*this.m_rn.v*t.m_rd.v<<e,u=t.signVal()*t.m_rn.v*this.m_rd.v<<n;return this.m_rn.v=s?r+u:r-u,this.m_rd.v*=t.m_rd.v,this.m_power=i,this.m_sign=1,this.m_rn.v<0n&&(this.m_sign=-1,this.m_rn.v=-this.m_rn.v),this.m_bNormalized=!1,this.normalizeThis(),this}}si.s_sm=0x8000000000000000n,si.s_em=0x7ff0000000000000n,si.s_fm=0x000fffffffffffffn,si.s_emax=0x7ffn;const ii=si.constructInt32(1),ei=si.constructInt32(0),ni=si.constructDouble(.5);function ri(t,s){return d(t^s)}function ui(t,s){let i=os(t);const e=os(s);if(i===e){return i-=53-ri(as(t),as(s)),i}return i>e?i:e}function hi(t,s){for(let i=0,e=0,n=t.length;i<n;i+=2,e++)s[e].x=t[i],s[e].y=t[i+1]}function ai(t){const s=new Float64Array(2*t.length);for(let i=0,e=t.length;i<e;++i){const e=i<<1;s[e]=t[i].x,s[e+1]=t[i].y}return s}function oi(t){const s=Ot(mi,t.length);for(let i=0,e=t.length;i<e;++i)s[i].setCoords(t[i][0],t[i][1]);return s}class mi{static construct(t,s){return new mi(t,s)}constructor(t,s){void 0!==t?(this.x=t,this.y=s):this.x=this.y=Number.NaN}clone(){return new mi(this.x,this.y)}assign(t){this.setCoordsPoint2D(t)}setCoords(t,s){return this.x=t,this.y=s,this}setCoordsPoint2D(t){this.x=t.x,this.y=t.y}isEqualPoint2D(t,s){return void 0!==s?Math.abs(this.x-t.x)<=s&&Math.abs(this.y-t.y)<=s:this.x===t.x&&this.y===t.y}isEqual(t,s,i){return void 0!==i?Math.abs(this.x-t)<=i&&Math.abs(this.y-s)<=i:this.x===t&&this.y===s}equalsPoint2D(t,s){return this.isEqualPoint2D(t,s)}setSub(t,s){this.x=t.x-s.x,this.y=t.y-s.y}addThis(t){return this.x+=t.x,this.y+=t.y,this}setAdd(t,s){return this.x=t.x+s.x,this.y=t.y+s.y,this}absoluteOther(t){}absolute(){return s(0),this}setNegate(){this.x=-this.x,this.y=-this.y}setNegateOther(t){this.x=-t.x,this.y=-t.y}interpolateThis(t,s){}interpolate(t,i,e){s(0)}scaleAddThis(t,s){this.x=this.x*t+s.x,this.y=this.y*t+s.y}setScaleAdd(t,s,i){this.x=s.x*t+i.x,this.y=s.y*t+i.y}scaleOther(t,i){s(0)}scale(t){this.x*=t,this.y*=t}compare(t){return this.y<t.y?-1:this.y>t.y?1:this.x<t.x?-1:this.x>t.x?1:0}compareX(t){return this.x<t.x?-1:this.x>t.x?1:this.y<t.y?-1:this.y>t.y?1:0}normalizeOther(t){s(0)}normalize(){const t=this.length();return t?(this.x/=t,this.y/=t):(this.x=1,this.y=0),this}getUnitVector(){return this.clone().normalize()}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}sqrLength(){return this.x*this.x+this.y*this.y}static averageFast(t,i){return s(0),{}}static average(t,s){const i=new mi;if(0===s)return i.setNAN(),i;if(1===s)return i.assign(t[0]),i;const e=new n(t[0].x),r=new n(t[0].y);for(let n=1;n<s;n++)e.add(t[n].x),r.add(t[n].y),255&n||(e.normalize(),r.normalize());return i.x=e.getResult()/s,i.y=r.getResult()/s,i}static calculateLength(t,s){const i=new n(0);for(let e=1;e<s;e++)i.add(mi.distance(t[e],t[e-1]));return i.getResult()}offset(t,s){const i=mi.distance(t,s),e=mi.construct(this.x,this.y);if(0===i)return mi.distance(e,t);const n=s.clone();n.subThis(t),e.subThis(t);return e.crossProduct(n)/i}side(t,s){return t.equals(s)?this.equals(t)?0:1:mi.orientationRobust(s,t,this)}static sqrDistance(t,s){const i=t.x-s.x,e=t.y-s.y;return i*i+e*e}static sqrDistanceCoords(t,s,i,e){const n=i-t,r=e-s;return n*n+r*r}static distance(t,s){return Math.sqrt(mi.sqrDistance(t,s))}dotProduct(t){return this.x*t.x+this.y*t.y}dotProductAbs(t){return Math.abs(this.x*t.x)+Math.abs(this.y*t.y)}crossProduct(t){return this.x*t.y-this.y*t.x}crossProductAbs(t){return s(0),0}rotateDirect(t,s){const i=this.x*t-this.y*s,e=this.x*s+this.y*t;this.x=i,this.y=e}rotateReverse(t,s){const i=this.x*t+this.y*s,e=-this.x*s+this.y*t;this.x=i,this.y=e}leftPerpendicularThis(){const t=this.x;this.x=-this.y,this.y=t}leftPerpendicularOther(t){const s=t.x;this.x=-t.y,this.y=s}rightPerpendicularThis(){const t=this.x;this.x=this.y,this.y=-t}rightPerpendicularOther(t){const s=t.x;this.x=t.y,this.y=-s}equals(t){return this.x===t.x&&this.y===t.y}notequals(t){return this.x!==t.x||this.y!==t.y}not(){return!this.x&&!this.y}gt(t){return this.y>t.y||this.y===t.y&&this.x>t.x}gte(t){return!this.lt(t)}lt(t){return this.y<t.y||this.y===t.y&&this.x<t.x}lte(t){return!this.gt(t)}subThis(t){return this.x-=t.x,this.y-=t.y,this}divThis(t){return this.x/=t,this.y/=t,this}add(t){return new mi(this.x+t.x,this.y+t.y)}sub(t){return new mi(this.x-t.x,this.y-t.y)}negateThis(){return this.x=-this.x,this.y=-this.y,this}negate(){return new mi(-this.x,-this.y)}mul(t){return new mi(this.x*t,this.y*t)}mulThis(t){return this.x*=t,this.y*=t,this}divide(t){return new mi(this.x/t,this.y/t)}setNAN(){this.x=this.y=Number.NaN}isNAN(){return Number.isNaN(this.x)||Number.isNaN(this.y)}static getNAN(){return new mi(Number.NaN,Number.NaN)}isFinite(){return Number.isFinite(this.x)&&Number.isFinite(this.y)}isZero(){return 0===this.x&&0===this.y}norm(t){switch(t){case 0:{const t=Math.abs(this.x),s=Math.abs(this.y),i=t-s;return i>=0?t:i<=0?s:Number.NaN}case 1:return Math.abs(this.x)+Math.abs(this.y);case 2:return Math.sqrt(this.x*this.x+this.y*this.y);default:e("norm")}}getQuarter(){return mi.getQuarterCoords(this.x,this.y)}static getQuarterCoords(t,s){return t>0?s>=0?1:4:s>0?2:0===t?4:3}static compareVectors(t,s){const i=t.getQuarter(),e=s.getQuarter();return e===i?mi.orientationRobustImpl(mi.construct(0,0),s,t,!0):i<e?-1:1}static compareVectorsOrigin(t,s,i){const e=s.sub(t),n=i.sub(t),r=e.getQuarter(),u=n.getQuarter();return u===r?mi.orientationRobustImpl(t,i,s,!0):r<u?-1:1}static orientationRobust(t,s,i){return mi.orientationRobustImpl(t,s,i,!1)}static orientationRobustEx(t,s,i,e){if(t.equals(s)||i.equals(e))return 0;const n=s.x-t.x,r=s.y-t.y,u=e.x-i.x,h=e.y-i.y;{const t=mi.getQuarterCoords(n,r)-1,s=mi.getQuarterCoords(u,h)-1,i=mi.d[t][s];if(0!==i)return i}const a=n*h,o=r*u,m=4*Qs()*(Math.abs(a)+Math.abs(o)),l=a-o;if(Math.abs(l)>=m){return l<0?-1:l>0?1:0}return mi.orientationRobustExMp(t,s,i,e)}static orientationRobustExMp(t,s,i,e){const n=si.constructDouble(s.x),r=si.constructDouble(e.x);n.subThis(si.constructDouble(t.x)),r.subThis(si.constructDouble(i.x));const u=si.constructDouble(s.y),h=si.constructDouble(e.y);return u.subThis(si.constructDouble(t.y)),h.subThis(si.constructDouble(i.y)),n.mulThis(h),u.mulThis(r),n.subThis(u),n.LZ()?-1:n.GZ()?1:0}static orientationNonRobust(t,s,i){const e=s.sub(t).crossProduct(i.sub(t));return e<0?-1:e>0?1:0}static orientationRobustImpl(t,s,i,e){if(s.isEqualPoint2D(t)||i.isEqualPoint2D(t)||s.isEqualPoint2D(i))return 0;const n=s.x-t.x,r=s.y-t.y,u=i.x-t.x,h=i.y-t.y;if(!e){const t=mi.getQuarterCoords(n,r)-1,s=mi.getQuarterCoords(u,h)-1,i=mi.d[t][s];if(0!==i)return i}const a=(Math.abs(n)+Math.abs(r)+Math.abs(u)+Math.abs(h))*(Math.abs(s.x)+Math.abs(s.y)+Math.abs(i.x)+Math.abs(i.y))*8*M(),o=n*h-r*u;if(Math.abs(o)>a){return o<0?-1:1}if(g(s.x,t.x)&&g(i.y,t.y)&&g(s.y,t.y)&&g(i.x,t.x)&&y(n,h)&&y(r,u)){const t=n*h,s=r*u;if(g(t,s)){const i=t-s;return i<0?-1:i>0?1:0}}return mi.orientationRobustMp(t,s,i)}static orientationRobustMp(t,s,i){const e=si.constructDouble(s.x),n=si.constructDouble(i.x);{const s=si.constructDouble(t.x);e.subThis(s),n.subThis(s)}const r=si.constructDouble(i.y),u=si.constructDouble(s.y);{const s=si.constructDouble(t.y);r.subThis(s),u.subThis(s)}return e.mulThis(r),u.mulThis(n),e.subThis(u),e.LZ()?-1:e.GZ()?1:0}static inCircleRobust(t,s,i,e){const n=new p,r=new p;n.set(t.x),n.subThis(e.x),r.set(t.y),r.subThis(e.y);const u=new p,h=new p;u.set(s.x),u.subThis(e.x),h.set(s.y),h.subThis(e.y);const a=new p,o=new p;a.set(i.x),a.subThis(e.x),o.set(i.y),o.subThis(e.y);const m=n.mulE(h).subE(r.mulE(u)),l=u.mulE(o).subE(h.mulE(a)),c=n.mulE(o).subE(r.mulE(a)),f=n.mulE(n).addE(r.mulE(r)),_=u.mulE(u).addE(h.mulE(h)),v=a.mulE(a).addE(o.mulE(o)),b=f.mulE(l).subE(_.mulE(c)).addE(v.mulE(m));if(!b.isFuzzyZero()){const t=b.value();return t<0?-1:t>0?1:0}return mi.inCircleRobustMp(t,s,i,e)}static inCircleRobustMp(t,s,i,e){do{if(!g(t.x,e.x)||!g(t.y,e.y))break;if(!g(s.x,e.x)||!g(s.y,e.y))break;if(!g(i.x,e.x)||!g(i.y,e.y))break;const n=t.x-e.x,r=t.y-e.y,u=s.x-e.x,h=s.y-e.y,a=i.x-e.x,o=i.y-e.y;if(!y(n,h)||!y(r,u))break;if(!y(u,o)||!y(h,a))break;if(!y(n,o)||!y(r,a))break;if(!y(n,n)||!y(r,r))break;if(!y(u,u)||!y(h,h))break;if(!y(a,a)||!y(o,o))break;const m=n*h,l=r*u,c=u*o,f=h*a,_=n*o,v=r*a,b=n*n,d=r*r,x=u*u,N=h*h,p=a*a,M=o*o;if(!g(m,l))break;if(!g(c,f))break;if(!g(_,v))break;if(!T(b,d))break;if(!T(x,N))break;if(!T(p,M))break;const E=m-l,I=c-f,w=_-v,D=b+d,A=x+N,P=p+M;if(!y(D,I))break;if(!y(A,w))break;if(!y(P,E))break;const q=D*I,z=A*w,Z=P*E;if(!g(q,z))break;const C=q-z;if(!T(C,Z))break;const R=C+Z;return R<0?-1:R>0?1:0}while(0);const n=si.constructDouble(e.x),r=si.constructDouble(e.y),u=si.constructDouble(t.x),h=si.constructDouble(t.y);u.subThis(n),h.subThis(r);const a=si.constructDouble(s.x),o=si.constructDouble(s.y);a.subThis(n),o.subThis(r);const m=si.constructDouble(i.x),l=si.constructDouble(i.y);m.subThis(n),l.subThis(r);const c=u.mul(o).sub(h.mul(a)),f=a.mul(l).sub(o.mul(m)),_=u.mul(l).sub(h.mul(m)),v=u.mul(u).add(h.mul(h)),b=a.mul(a).add(o.mul(o)),d=m.mul(m).add(l.mul(l)),x=v.mul(f).sub(b.mul(_)).add(d.mul(c));return x.LZ()?-1:x.GZ()?1:0}static inCircleRobustMp3Point(t,s,i){const e=si.constructDouble(t.x),n=si.constructDouble(t.y),r=si.constructDouble(s.x),u=si.constructDouble(s.y),h=si.constructDouble(i.x),a=si.constructDouble(i.y),o=h.mul(h).add(a.mul(a)).sub(h.mul(e).add(a.mul(n)).add(h.mul(r)).add(a.mul(u))).add(e.mul(r).add(n.mul(u)));return o.LZ()?-1:o.GZ()?1:0}static inCircleRobust3Point(t,s,i){const e=new p(t.x),n=new p(t.y),r=new p(s.x),u=new p(s.y),h=new p(i.x),a=new p(i.y),o=h.mulE(h).addE(a.mulE(a)).subE(h.mulE(e).addE(a.mulE(n)).addE(h.mulE(r)).addE(a.mulE(u))).addE(e.mulE(r).addE(n.mulE(u)));if(!o.isFuzzyZero()){const t=o.value();return t<0?-1:t>0?1:0}return mi.inCircleRobustMp3Point(t,s,i)}static calculateCircleCenterFromThreePoints(t,s,i){if(t.equals(i)||t.equals(s)||i.equals(s))return mi.getNAN();const e=li(t,s,i);return e.isNAN()?ci(t,s,i):e}static calculateAngle(t,s){return Math.atan2(t.crossProduct(s),t.dotProduct(s))}static isBisectorRobust(t,i,e){return s(0),!1}static size(){return 2}get 0(){return this.x}get 1(){return this.y}set 0(t){this.x=t}set 1(t){this.y=t}static compareZorder(t,s){const i=mi.c_compare_zorder_xx[t.x<0?1:0]|mi.c_compare_zorder_yy[t.y<0?1:0],e=mi.c_compare_zorder_xx[s.x<0?1:0]|mi.c_compare_zorder_yy[s.y<0?1:0];if(i===e){let i=0,e=0;for(let n=0;n<2;++n){const r=ui(t[n],s[n]);r>i&&(i=r,e=n)}return t[e]<s[e]}return i<e}static lerp(t,s,i){const e=new mi;return Y(t,s,i,e),e}static getClosestCoordinate(t,s,i,e=!1){const n=mi.getNAN();n.setSub(s,t);const r=n.sqrLength();if(0===r)return.5;if(s.isEqualPoint2D(i))return 1;const u=mi.getNAN();u.setSub(i,t);let h=u.dotProduct(n)/r;return e||(h<0?h=0:h>1&&(h=1)),h}static intersectLinesAtOnePoint(t,s,i,e){if(t.equals(s)||i.equals(e))return mi.getNAN();const n=s.x-t.x,r=i.x-e.x,u=s.y-t.y,h=i.y-e.y,a=n*h-r*u;if(!a)return mi.getNAN();const o=a;if(0===o)return mi.getNAN();let m=(i.x-t.x)*h-(i.y-t.y)*r;m/=o;const l=new mi;return Y(t,s,m,l),l.isFinite()?l:mi.getNAN()}toString(){return`[${this.x},${this.y}]`}}function li(t,s,i){const e=new p(s.x);e.subThis(t.x);const n=new p(s.y);n.subThis(t.y);const r=new p(i.x);r.subThis(t.x);const u=new p(i.y);u.subThis(t.y);const h=e.clone();h.mulThisE(u);let a=n.clone();if(a.mulThisE(r),h.subThisE(a),0===h.value())return mi.getNAN();h.mulThis(2);const o=e.clone();o.mulThisE(e);const m=n.clone();m.mulThisE(n);const l=o.clone();l.addThisE(m);const c=r.clone();c.mulThisE(r);const f=u.clone();f.mulThisE(u);const _=c.clone();_.addThisE(f);const v=n.clone();v.mulThisE(_),a=u.clone(),a.mulThisE(l),v.subThisE(a),v.divThisE(h);const b=e.clone();b.mulThisE(_),a=r.clone(),a.mulThisE(l),b.subThisE(a),b.divThisE(h);const d=mi.construct(t.x-v.value(),t.y+b.value()),x=t.sub(d).length(),N=s.sub(d).length(),y=i.sub(d).length(),T=1e-15*(x+Math.abs(t.x)+Math.abs(s.x)+Math.abs(i.x)+Math.abs(t.y)+Math.abs(s.y)+Math.abs(i.y));return Math.abs(x-N)<=T&&Math.abs(x-y)<=T&&v.eps()<T&&b.eps()<T?d:mi.getNAN()}function ci(t,s,i){const e=si.constructDouble(s.x);e.subDoubleThis(t.x);const n=si.constructDouble(s.y);n.subDoubleThis(t.y);const r=si.constructDouble(i.x);r.subDoubleThis(t.x);const u=si.constructDouble(i.y);u.subDoubleThis(t.y);const h=e.clone();h.mulThis(u);let a=n.clone();if(a.mulThis(r),h.subThis(a),h.isZero())return mi.getNAN();h.mulDoubleThis(2);const o=e.clone();o.mulThis(e);const m=n.clone();m.mulThis(n);const l=o.clone();l.addThis(m);const c=r.clone();c.mulThis(r);const f=u.clone();f.mulThis(u);const _=c.clone();_.addThis(f);const v=n.clone();v.mulThis(_),a=u.clone(),a.mulThis(l),v.subThis(a),v.divThis(h);const b=e.clone();b.mulThis(_),a=r.clone(),a.mulThis(l),b.subThis(a),b.divThis(h);return mi.construct(t.x-v.value(),t.y+b.value())}mi.dimensions=2,mi.d=[[0,1,0,-1],[-1,0,1,0],[0,-1,0,1],[1,0,-1,0]],mi.c_compare_zorder_xx=[2,0],mi.c_compare_zorder_yy=[1,0];export{hi as $,As as A,Zs as B,Vt as C,Gt as D,x as E,ls as F,S as G,Qs as H,Ds as I,Ss as J,n as K,oi as L,si as M,St as N,Ps as O,mi as P,Y as Q,Ct as R,Ht as S,bs as T,I as U,Ys as V,R as W,p as X,zs as Y,rs as Z,ai as _,H as a,Bs as a0,Os as a1,qs as a2,wt as a3,Zt as a4,Gs as a5,fs as a6,cs as a7,w as a8,Qt as a9,ei as aA,ii as aB,Et as aC,Xs as aD,Rt as aE,st as aF,$ as aG,gt as aH,J as aI,xs as aJ,At as aK,Vs as aa,Xt as ab,Js as ac,It as ad,jt as ae,V as af,U as ag,zt as ah,L as ai,Hs as aj,js as ak,Ws as al,k as am,F as an,O as ao,G as ap,D as aq,ni as ar,$s as as,_t as at,vt as au,Lt as av,A as aw,P as ax,ft as ay,Jt as az,Dt as b,Pt as c,Yt as d,K as e,B as f,Ls as g,kt as h,ds as i,vs as j,Ut as k,$t as l,Ot as m,ct as n,Wt as o,Kt as p,Q as q,_s as r,Us as s,W as t,Bt as u,qt as v,Ft as w,j as x,z as y,C as z};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"./Envelope2D.js";import"./Geometry.js";export{P as ProjectionTransformation,
|
|
5
|
+
import"./Envelope2D.js";import"./Geometry.js";export{P as ProjectionTransformation,v as create,x as createEx,y as createFromAoi,z as createImplEx,A as makeExtendedParams,B as makeExtendedParamsInternal,C as queryTransformationList}from"./UnitFactory.js";import"./Point2D.js";
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{P as e}from"./Point2D.js";import{f as t,G as n,a as r}from"./Geometry.js";import{Envelope2D as o}from"./Envelope2D.js";import{
|
|
5
|
+
import{P as e}from"./Point2D.js";import{f as t,G as n,a as r}from"./Geometry.js";import{Envelope2D as o}from"./Envelope2D.js";import{H as i}from"./UnitFactory.js";function s(){return g(new e,-1,Number.NaN)}function g(e,t,n){return{m_coordinate:e.clone(),m_vertexIndex:t,m_geometryIndex:0,m_distance:n,m_bRightSide:!1,isEmpty:u}}function u(){return Number.isNaN(this.m_distance)}function c(e,r,i=-1,s=-1){if(e.isEmpty())return 3;const g=e.getGeometryType();if(t(g))return a(e,r,i,s);if(g===n.enumPolygon)return f(e,r,i,s);if(g===n.enumPolyline)return m(e,r,i,s);if(g===n.enumEnvelope){const t=new o;return e.queryEnvelope(t),t.contains(r)?t.containsExclusive(r)?1:2:0}return 3}function a(t,n,o,i){if(o>=0||i>=0)return r("");if(t.isDegenerate(0))return t.getStartXY().equals(n)?2:3;if(!t.isCurve()){const r=e.orientationRobust(n,t.getStartXY(),t.getEndXY());return r<0?1:r>0?0:2}const s=t.getClosestCoordinate(n,!1),g=t.getTangent(s),u=t.getCoord2D(s),c=e.orientationRobust(n,u,u.add(g));return c<0?1:c>0?0:2}function f(e,t,n,s){(n>=0||s>=0)&&r("");const g=new o;e.queryEnvelope(g);const u=i(e,t,0);return 0===u?0:1===u?1:2}function m(t,n,o,i){(o<0&&i>=0||o>=0&&i<0)&&r("");const s=t.querySegmentIterator();if(o<0){let t=Number.MAX_VALUE,r=0;for(;s.nextPath();)for(;s.hasNextSegment();){const g=s.nextSegment(),u=g.getClosestCoordinate(n,!1),c=g.getCoord2D(u),a=e.sqrDistance(c,n);a<t?(r=1,o=s.getStartPointIndex(),i=s.getPathIndex(),t=a):a===t&&r++}if(0===r)return 3;if(1===r){s.resetToVertex(o,i);return c(s.nextSegment(),n)}}const g=h(n,s,o,i);if(-1!==g.i1&&-1===g.i2)return g.bRight1?1:0;if(-1!==g.i1&&-1!==g.i2){if(g.bRight1===g.bRight2)return g.bRight1?1:0;{s.resetToVertex(g.i1,-1);const e=s.nextSegment().getTangent(1);s.resetToVertex(g.i2,-1);const t=s.nextSegment().getTangent(0);return e.crossProduct(t)>=0?1:0}}s.resetToVertex(o,i);return c(s.nextSegment(),n)}function x(e,t,n){for(e.resetToVertex(t,n);e.hasNextSegment();){if(!e.nextSegment().isDegenerate(0))return e.getStartPointIndex()}for(e.resetToVertex(t,n);e.hasPreviousSegment();){if(!e.previousSegment().isDegenerate(0))return e.getStartPointIndex()}return-1}function S(e,t){for(e.resetToVertex(t,-1),e.nextSegment();e.hasNextSegment();){if(!e.nextSegment().isDegenerate(0))return e.getStartPointIndex()}return-1}function d(e,t){for(e.resetToVertex(t,-1);e.hasPreviousSegment();){if(!e.previousSegment().isDegenerate(0))return e.getStartPointIndex()}return-1}function h(t,n,r,o){const i={i1:-1,i2:-1,bRight1:!1,bRight2:!1};if(i.i1=x(n,r,o),-1!==i.i1){n.resetToVertex(i.i1,-1);const r=n.nextSegment(),o=r.getClosestCoordinate(t,!1),s=r.getCoord2D(o),g=e.sqrDistance(s,t);{const e=s.clone();e.subThis(r.getStartXY());const n=t.clone();n.subThis(r.getStartXY()),i.bRight1=e.crossProduct(n)<0}if(i.i2=S(n,i.i1),-1!==i.i2){n.resetToVertex(i.i2,-1);const r=n.nextSegment(),o=r.getClosestCoordinate(t,!1),s=r.getCoord2D(o);if(e.sqrDistance(s,t)>g)i.i2=-1;else{const e=s.clone();e.subThis(r.getStartXY());const n=t.clone();n.subThis(r.getStartXY()),i.bRight2=e.crossProduct(n)<0}}if(-1===i.i2&&(i.i2=d(n,i.i1),-1!==i.i2)){n.resetToVertex(i.i2,-1);const r=n.nextSegment(),o=r.getClosestCoordinate(t,!1),s=r.getCoord2D(o);if(e.sqrDistance(s,t)>g)i.i2=-1;else{const e=s.clone();e.subThis(r.getStartXY());const n=t.clone();n.subThis(r.getStartXY()),i.bRight2=e.crossProduct(n)<0;const o=i.i1;i.i1=i.i2,i.i2=o;const g=i.bRight1;i.bRight1=i.bRight2,i.bRight2=g}}}return i}export{g as a,c,s as m};
|