@arcgis/core 5.2.0-next.136 → 5.2.0-next.138
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/analysis/LineOfSightAnalysisObserver.d.ts +12 -0
- package/analysis/LineOfSightAnalysisObserver.js +1 -1
- package/analysis/LineOfSightAnalysisTarget.d.ts +12 -0
- package/analysis/LineOfSightAnalysisTarget.js +1 -1
- package/arcade/featureset/sources/FeatureLayerParquet.js +1 -1
- package/arcgisGlobal.d.ts +4 -0
- package/assets/components/assets/icon/blockHeightMedium16.json +1 -0
- package/assets/components/assets/icon/blockHeightMedium24.json +1 -0
- package/assets/components/assets/icon/blockHeightMedium32.json +1 -0
- package/assets/components/assets/icon/blockHeightShort16.json +1 -0
- package/assets/components/assets/icon/blockHeightShort24.json +1 -0
- package/assets/components/assets/icon/blockHeightShort32.json +1 -0
- package/assets/components/assets/icon/blockHeightTall16.json +1 -0
- package/assets/components/assets/icon/blockHeightTall24.json +1 -0
- package/assets/components/assets/icon/blockHeightTall32.json +1 -0
- package/assets/components/assets/icon/cursorCircle16.json +1 -0
- package/assets/components/assets/icon/cursorCircle24.json +1 -0
- package/assets/components/assets/icon/cursorCircle32.json +1 -0
- package/assets/components/assets/icon/dictionary16.json +1 -0
- package/assets/components/assets/icon/dictionary24.json +1 -0
- package/assets/components/assets/icon/dictionary32.json +1 -0
- package/assets/components/assets/icon/jobDependency16.json +1 -0
- package/assets/components/assets/icon/jobDependency24.json +1 -0
- package/assets/components/assets/icon/jobDependency32.json +1 -0
- package/assets/components/assets/icon/referenceChip16.json +1 -0
- package/assets/components/assets/icon/referenceChip24.json +1 -0
- package/assets/components/assets/icon/referenceChip32.json +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{4e6f95d8c624d513849a.js → 05963f57cbe5a5249496.js} +1 -1
- package/assets/esri/core/workers/chunks/{0b8681ca4a83e97f1f71.js → 067de1910190da228291.js} +1 -1
- package/assets/esri/core/workers/chunks/{3c0fd1c6cda44e9f40ab.js → 070684943698fa43c2b4.js} +1 -1
- package/assets/esri/core/workers/chunks/{bc1cb4b9a02e6c78deb7.js → 076e8d2e08ff2a013736.js} +1 -1
- package/assets/esri/core/workers/chunks/{c10e040368065411506a.js → 10445313d0d57b34511b.js} +1 -1
- package/assets/esri/core/workers/chunks/{d537c59b46cdaaf66034.js → 1188d0a136fffc009643.js} +1 -1
- package/assets/esri/core/workers/chunks/{20af3f085f60c32c6c53.js → 178083d8ed7707b45ca2.js} +1 -1
- package/assets/esri/core/workers/chunks/{f5efe3e800c6e23efcf3.js → 1819c45655c836b9a8d7.js} +1 -1
- package/assets/esri/core/workers/chunks/1b946714ca4a1a7359d4.js +2 -0
- package/assets/esri/core/workers/chunks/{d8d8b38ac8a91d9e45fc.js → 1cc744ab5eee5ee3bed8.js} +1 -1
- package/assets/esri/core/workers/chunks/{05e39b4de7f62c5b22cc.js → 20f75cc777af13fa249b.js} +1 -1
- package/assets/esri/core/workers/chunks/2a1ec30f9ad305763f81.js +2 -0
- package/assets/esri/core/workers/chunks/34570e6bbf559f18c1a5.js +1 -0
- package/assets/esri/core/workers/chunks/{60f6d5da9480dd36e877.js → 3dddae78286d05eb10fc.js} +1 -1
- package/assets/esri/core/workers/chunks/{9efd30bbd02ec0d1031b.js → 3ec3589f6e74d7cb87cf.js} +1 -1
- package/assets/esri/core/workers/chunks/{0bec054fca104f3bf141.js → 3f776d9fd2ab68b21fca.js} +1 -1
- package/assets/esri/core/workers/chunks/402a82c77420254831bc.js +1 -0
- package/assets/esri/core/workers/chunks/{e2ebf0ea3af2e6907987.js → 406f24ec13eb30d43405.js} +1 -1
- package/assets/esri/core/workers/chunks/43fc42405167a5537039.js +1 -0
- package/assets/esri/core/workers/chunks/{ddedc414bb478b376221.js → 46b2d4addfc73f9183a4.js} +1 -1
- package/assets/esri/core/workers/chunks/498d6dfd3bb0d3490548.js +1 -0
- package/assets/esri/core/workers/chunks/{36ef86701883a20dd6f6.js → 4a640548032355e57acd.js} +1 -1
- package/assets/esri/core/workers/chunks/5566f14afb63065e438f.js +1 -0
- package/assets/esri/core/workers/chunks/{c3b96d1d43afccd23e45.js → 590e6c70206122e4cc3c.js} +2 -2
- package/assets/esri/core/workers/chunks/{54860dd53a46cf4c47f3.js → 59295b99bdff4045a0e7.js} +1 -1
- package/assets/esri/core/workers/chunks/5aeb5e18514644fe2cf9.js +1 -0
- package/assets/esri/core/workers/chunks/{5da86409d70098fc6a10.js → 5b3cfe95314a75a735c1.js} +1 -1
- package/assets/esri/core/workers/chunks/{a54678bfa0f1807b61cd.js → 5c855af73ee3c3e764fb.js} +1 -1
- package/assets/esri/core/workers/chunks/{06da3409992bb1fa85b0.js → 5e90c1b49f2b7e21d05a.js} +39 -31
- package/assets/esri/core/workers/chunks/5fd099ca1024707387b2.js +1 -0
- package/assets/esri/core/workers/chunks/{30f808cac8a34f95ea6e.js → 6079d27f4ab319fb8f0c.js} +1 -1
- package/assets/esri/core/workers/chunks/66c2a28a851130b87c04.js +1 -0
- package/assets/esri/core/workers/chunks/{dac90b3631f7f7158f68.js → 67f15538c51838201fc7.js} +1 -1
- package/assets/esri/core/workers/chunks/{cfaba0470619786e1ef8.js → 68d8ae42ab71d01a70a5.js} +2 -2
- package/assets/esri/core/workers/chunks/6aebf7cfd294e88bf926.js +1 -0
- package/assets/esri/core/workers/chunks/{864e7030c4ddbfcf0114.js → 6ccf9535013fe672c93b.js} +1 -1
- package/assets/esri/core/workers/chunks/{ba7f0cf7e495d3ec2d55.js → 6e62581d933e7298d1f6.js} +1 -1
- package/assets/esri/core/workers/chunks/{83b5dd4029e00abd80bf.js → 700b1d5bc67b7e1b3ff3.js} +1 -1
- package/assets/esri/core/workers/chunks/{f9fea72cc222a30ef2f9.js → 72399062767abdfb0bee.js} +1 -1
- package/assets/esri/core/workers/chunks/{2a7fbfd77002a24bf737.js → 747461bb6a1bc2f0a64d.js} +1 -1
- package/assets/esri/core/workers/chunks/{c333f6ed42985bb2b11f.js → 7851aef196eea5d6c94e.js} +1 -1
- package/assets/esri/core/workers/chunks/{f0b6bd6fab5320c3082f.js → 7a05b18f655c1167ce0a.js} +1 -1
- package/assets/esri/core/workers/chunks/{04296b75d0f81fbd1bb5.js → 864194927d05ebc4cc31.js} +1 -1
- package/assets/esri/core/workers/chunks/{3c4a13a9f0b305394a26.js → 876f7633c15f1e31078d.js} +1 -1
- package/assets/esri/core/workers/chunks/{62298dba3f6cbdc3f4ae.js → 879b2f0ff1977bca9376.js} +1 -1
- package/assets/esri/core/workers/chunks/{b547b3bce729c9dac90d.js → 898359be6996fd9763b8.js} +1 -1
- package/assets/esri/core/workers/chunks/8cb716f110d164030309.js +1 -0
- package/assets/esri/core/workers/chunks/8dc1c3042267618fd710.js +2 -0
- package/assets/esri/core/workers/chunks/{625f02db93d7fbf175ca.js → 9001e9a1e81bce175ddd.js} +1 -1
- package/assets/esri/core/workers/chunks/{9ffa6c8d93d3443834c6.js → 912080c90b5cc2e817cf.js} +1 -1
- package/assets/esri/core/workers/chunks/96c50a0dda0f1503ef92.js +2 -0
- package/assets/esri/core/workers/chunks/{13e4379441499599c3b5.js → 9cbde13e536676767900.js} +1 -1
- package/assets/esri/core/workers/chunks/{408db4f32850b77264ae.js → 9cd3fcb5fca6f9dbbcd8.js} +1 -1
- package/assets/esri/core/workers/chunks/a054da6cbd8ee4774a57.js +1 -0
- package/assets/esri/core/workers/chunks/a05790444115e4cf1bcc.js +1 -0
- package/assets/esri/core/workers/chunks/{d1f2685782b423ef87a6.js → a556dd4e9e6d35e33a2c.js} +1 -1
- package/assets/esri/core/workers/chunks/{00d576d355599c88931e.js → bc38def1983089514e4b.js} +1 -1
- package/assets/esri/core/workers/chunks/{0725e515f3004bdd5c56.js → ca2adcbcf44454484fd5.js} +1 -1
- package/assets/esri/core/workers/chunks/{f3507b9e831ffd7a6bf8.js → cca8bd07bcd1d267a2e8.js} +1 -1
- package/assets/esri/core/workers/chunks/cfae60b9d2f2939e9c16.js +1 -0
- package/assets/esri/core/workers/chunks/{1d6b2a64f4e40e5cc13d.js → d201fbf3ceff946d2bd6.js} +1 -1
- package/assets/esri/core/workers/chunks/{4439078780d9ba49fd26.js → d51bb11baadc741c46bc.js} +1 -1
- package/assets/esri/core/workers/chunks/db1ab9b9c8bf5c7635d3.js +1 -0
- package/assets/esri/core/workers/chunks/de02a6a1f4810f99e9bb.js +1 -0
- package/assets/esri/core/workers/chunks/e630f3c56c077cb2bd8e.js +1 -0
- package/assets/esri/core/workers/chunks/e81173724e8de8c1e65b.js +1 -0
- package/assets/esri/core/workers/chunks/{2025288bed125594ceda.js → f6e62d2d279a328cbed7.js} +1 -1
- package/assets/esri/core/workers/chunks/{47c19778fcee7154ca38.js → f8bc474434fd365ab174.js} +1 -1
- package/assets/esri/core/workers/chunks/{9a20dc26cb9c7b2087cf.js → f95a1f878c9c1146180e.js} +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ar.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.bg.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.bs.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ca.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.cs.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.da.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.de.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.el.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.en.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.es.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.et.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.fi.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.fr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.he.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.hr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.hu.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.id.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.it.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ja.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ko.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.lt.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.lv.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.nl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.no.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.pl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.pt-BR.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.pt-PT.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ro.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ru.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sk.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sv.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.th.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.tr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.uk.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.vi.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.zh-CN.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.zh-HK.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.zh-TW.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.ar.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.bg.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.bs.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.ca.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.cs.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.da.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.de.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.el.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.es.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.et.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.fi.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.fr.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.he.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.hr.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.hu.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.id.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.it.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.ja.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.ko.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.lt.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.lv.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.nl.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.no.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.pl.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.pt-BR.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.pt-PT.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.ro.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.ru.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.sk.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.sl.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.sr.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.sv.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.th.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.tr.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.uk.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.vi.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.zh-CN.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.zh-HK.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/messages.zh-TW.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.ar.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.bg.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.bs.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.ca.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.cs.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.da.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.de.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.el.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.en.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.es.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.et.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.fi.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.fr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.he.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.hr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.hu.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.id.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.it.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.ja.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.ko.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.lt.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.lv.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.nl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.no.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.pl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.pt-BR.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.pt-PT.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.ro.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.ru.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.sk.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.sl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.sr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.sv.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.th.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.tr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.uk.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.vi.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.zh-CN.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.zh-HK.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.zh-TW.json +1 -1
- package/chunks/Bufferer-CclWhXVb.js +1 -1
- package/chunks/Component.glsl.js +3 -3
- package/chunks/DefaultMaterial.glsl.js +2 -2
- package/chunks/Distance2DCalculator-DjIp2uQi.js +1 -1
- package/chunks/Envelope.js +1 -1
- package/chunks/Envelope2D.js +1 -1
- package/chunks/FocusArea.glsl.js +8 -10
- package/chunks/GaussianSplat.glsl.js +2 -2
- package/chunks/GeodeticDistanceCalculator-zRp89-dW.js +1 -1
- package/chunks/GeodeticUtils.js +1 -1
- package/chunks/Geometry.js +1 -1
- package/chunks/GeometryCleaner-CIE8Wfmb.js +1 -1
- package/chunks/GlobalIllumination.glsl.js +3 -3
- package/chunks/LineMarker.glsl.js +35 -42
- package/chunks/MultiPathImpl.js +1 -1
- package/chunks/OperatorAffineTransform.js +1 -1
- package/chunks/OperatorClip.js +1 -1
- package/chunks/OperatorDensify.js +1 -1
- package/chunks/OperatorDistance.js +1 -1
- package/chunks/OperatorGeneralize.js +1 -1
- package/chunks/OperatorGeodesicBuffer.js +1 -1
- package/chunks/OperatorGeodeticArea.js +1 -1
- package/chunks/OperatorGeodeticDensifyByLength.js +1 -1
- package/chunks/OperatorGeodeticDistance.js +1 -1
- package/chunks/OperatorGeodeticLength.js +1 -1
- package/chunks/OperatorGraphicBuffer.js +1 -1
- package/chunks/OperatorIntegrate.js +1 -1
- package/chunks/OperatorMultiPartToSinglePart.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/Path.glsl.js +2 -2
- package/chunks/Point2D.js +1 -1
- package/chunks/RealisticTree.glsl.js +2 -2
- package/chunks/RibbonLine.glsl.js +51 -57
- package/chunks/SideCalculator2D-DX0718xq.js +1 -1
- package/chunks/Terrain.glsl.js +2 -2
- package/chunks/Transformation2D.js +1 -1
- package/chunks/UnitFactory.js +1 -1
- package/config.js +1 -1
- package/core/workers/RemoteClient.js +1 -1
- package/core/workers/workerFactory.js +1 -1
- package/editing/fieldUtils.d.ts +12 -0
- package/editing/sharedTemplates/templateDefinitions/TemplateDefinitionBase.js +1 -1
- package/geometry/operators/extendOperator.js +1 -1
- package/geometry/operators/gx/operatorAlphaShape.js +1 -1
- package/geometry/operators/gx/operatorBoundary.js +1 -1
- package/geometry/operators/gx/operatorBuffer.js +1 -1
- package/geometry/operators/gx/operatorConvexHull.js +1 -1
- package/geometry/operators/gx/operatorLabelPoint.js +1 -1
- package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
- package/geometry/operators/gx/operatorLocateBetween.js +1 -1
- package/geometry/operators/gx/operatorMinimumBoundingCircle.js +1 -1
- package/geometry/operators/gx/operatorOffset.js +1 -1
- package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
- package/geometry/operators/gx/operatorPolygonSlicer.js +1 -1
- package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
- package/geometry/operators/isNearOperator.js +1 -1
- package/geometry/operators/reshapeOperator.js +1 -1
- package/geometry/operators/support/jsonConverter.js +1 -1
- package/geometry/support/curves/ellipticArc7Utils.js +1 -1
- package/geometry/support/ellipseUtils.js +2 -0
- package/interfaces.d.ts +15 -18
- package/kernel.js +1 -1
- package/layers/LinkChartLayer.js +1 -1
- package/layers/ParquetLayer.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/list/LayerItemCollection.d.ts +1 -0
- package/layers/list/types.d.ts +5 -1
- package/layers/orientedImagery/core/coverageUtils.js +1 -1
- package/layers/orientedImagery/queries.js +1 -1
- package/layers/support/TimeSeriesCalculation.d.ts +1 -1
- package/layers/support/TimeSeriesCalculation.js +1 -1
- package/layers/support/dataSeriesUtils.d.ts +10 -0
- package/layers/support/timeSeriesUtils.js +17 -6
- package/libs/lyr3d/Lyr3DModule.js +1 -1
- package/networks/UtilityNetwork.d.ts +15 -0
- package/networks/UtilityNetwork.js +1 -1
- package/package.json +4 -4
- package/popup/FeatureContent.d.ts +14 -1
- package/popup/FeatureContent.js +1 -1
- package/popup/FeatureContentCollection.d.ts +4 -10
- package/popup/FeatureContentCollection.js +1 -1
- package/popup/actions.js +1 -1
- package/popup/support/featureUtils.js +1 -1
- package/renderers/support/RenderingInfo.js +1 -1
- package/renderers/support/renderingInfoUtils.js +1 -1
- package/renderers/visualVariables/SizeVariable.d.ts +16 -20
- package/renderers/visualVariables/support/SizeStop.d.ts +6 -2
- package/rest/networks/support/TraceLocation.js +1 -1
- package/rest/networks/support/TraceResult.d.ts +7 -0
- package/rest/networks/support/TraceResult.js +1 -1
- package/smartMapping/renderers/color.js +1 -1
- package/smartMapping/renderers/opacity.js +1 -1
- package/smartMapping/renderers/size.js +1 -1
- package/smartMapping/renderers/support/timeSeriesUtils.js +1 -1
- package/smartMapping/statistics/histogramForTimeSeries.d.ts +11 -0
- package/smartMapping/statistics/histogramForTimeSeries.js +2 -0
- package/smartMapping/statistics/summaryStatisticsForTimeSeries.d.ts +11 -0
- package/smartMapping/statistics/summaryStatisticsForTimeSeries.js +2 -0
- package/smartMapping/statistics/support/timeSeriesUtils.js +24 -0
- package/smartMapping/statistics/types.d.ts +50 -0
- package/support/tests/serviceMockDependencies.js +1 -1
- package/support/tests/setupServiceMocksMesh.js +1 -1
- package/symbols/cim/CIMPlacements.js +1 -1
- package/symbols/cim/callouts/calloutAnalysisUtils.js +1 -1
- package/symbols/cim/callouts/effects/BackgroundCallout.js +1 -1
- package/symbols/cim/callouts/effects/BalloonCallout.js +1 -1
- package/symbols/cim/callouts/effects/PointSymbolCallout.js +1 -1
- package/symbols/cim/callouts/effects/calloutUtils.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/views/2d/analysis/AreaMeasurement/AreaMeasurementTool.js +1 -1
- package/views/2d/analysis/DistanceMeasurement/DistanceMeasurementTool.js +1 -1
- package/views/2d/engine/vectorTiles/decluttering/CollisionJob.js +1 -1
- package/views/2d/engine/vectorTiles/decluttering/SymbolFader.js +1 -1
- package/views/2d/engine/vectorTiles/decluttering/jobsUtil.js +1 -1
- package/views/2d/engine/webgl/collisions/LabelMetric.js +1 -1
- package/views/2d/engine/webgl/definitions.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedPolyMeshWriters.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/ComputedAnimatedParams.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/ComputedMarkerParams.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/CalloutMeshWriterPolicy.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/AFeatureShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextParams.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
- package/views/2d/layers/SketchLayerView2D.js +1 -1
- package/views/2d/layers/features/layerAdapters/AnnotationLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/DimensionLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/StreamLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/labelingUtils.js +1 -1
- package/views/2d/layers/features/schema/ExceedsLimitCache.js +1 -1
- package/views/2d/layers/features/schema/TimeSchema.js +2 -0
- package/views/2d/layers/features/schema/processor/LabelMatcherSchema.js +1 -1
- package/views/2d/layers/features/schema/processor/MatcherSchema.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/SymbolSchema.js +1 -1
- package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
- package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
- package/views/2d/layers/support/annodime/cimAnnotations.js +1 -1
- package/views/2d/layers/support/vectorTileDebugUtils.js +1 -1
- package/views/2d/layers/support/visualVariableSimpleUtils.js +1 -1
- package/views/2d/types.d.ts +2 -1
- package/views/3d/analysis/LineOfSight/LineOfSightEditTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightItemManipulatedObject3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightItemTool.js +1 -1
- package/views/3d/analysis/LineOfSightAnalysisView3D.d.ts +24 -0
- package/views/3d/analysis/Viewshed/ViewshedEditTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedObserverManipulatedObject3D.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedPlacementController.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementShiftTool.js +1 -1
- package/views/3d/camera/constraintUtils.js +1 -1
- package/views/3d/input/handlers/ground/GroundDoubleClickMove.js +1 -1
- package/views/3d/input/handlers/ground/GroundNavigation.js +1 -1
- package/views/3d/interactive/editingTools/tooltipUtils3D.js +1 -1
- package/views/3d/interactive/placementTools/GroundNavigationPlacementTool3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/i3s/I3SOverrides.js +1 -1
- package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
- package/views/3d/state/controllers/GroundNavigationController.js +1 -1
- package/views/3d/state/controllers/momentum/GroundNavigationMomentumController.js +1 -1
- package/views/3d/state/utils/OffsetCorrectionController.js +1 -1
- package/views/3d/state/utils/groundNavigationUtils.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +16 -8
- package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +5 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/evaluateSceneLightingFragment.glsl.js +12 -0
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +2 -2
- package/views/3d/webgl-engine/effects/focusArea/FocusArea.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
- package/views/SelectionManager.d.ts +3 -3
- package/views/draw/support/Reshape.js +1 -1
- package/views/interactive/options/bindViewToolOptions.js +1 -1
- package/views/interactive/sketch/SketchLabelOptions.d.ts +3 -0
- package/views/interactive/sketch/SketchLabelOptions.js +1 -1
- package/views/interactive/sketch/SketchTooltipOptions.d.ts +3 -0
- package/views/interactive/sketch/SketchTooltipOptions.js +1 -1
- package/views/interactive/sketch/SketchValueOptions.d.ts +3 -0
- package/views/interactive/sketch/SketchValueOptions.js +1 -1
- package/views/interactive/snapping/SnappingOptions.d.ts +3 -0
- package/views/interactive/snapping/SnappingOptions.js +1 -1
- package/views/interactive/snapping/snappingUtils.js +1 -1
- package/views/interactive/tooltip/fields/parsingAndFormattingUtils.js +1 -1
- package/views/layers/SketchLayerView.d.ts +34 -0
- package/views/layers/SketchLayerView.js +2 -0
- package/views/layers/types.d.ts +3 -2
- package/views/selection/types.d.ts +15 -4
- package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
- package/widgets/BasemapGallery.js +1 -1
- package/widgets/Bookmarks/BookmarksViewModel.d.ts +4 -0
- package/widgets/Bookmarks/BookmarksVisibleElements.d.ts +5 -1
- package/widgets/Bookmarks/types.d.ts +2 -0
- package/widgets/Editor/EditorViewModel.d.ts +31 -30
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/components/Settings.js +1 -1
- package/widgets/Editor/types.d.ts +44 -0
- package/widgets/Editor.d.ts +30 -27
- package/widgets/Editor.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.d.ts +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/support/FeatureStore.d.ts +1 -1
- package/widgets/FeatureTable/support/FeatureStore.js +1 -1
- package/widgets/FeatureTable.d.ts +6 -0
- package/widgets/FeatureTable.js +1 -1
- package/widgets/Histogram/types.d.ts +10 -2
- package/widgets/HistogramRangeSlider/types.d.ts +4 -1
- package/widgets/LayerList/LayerListViewModel.d.ts +2 -1
- package/widgets/Legend/LegendViewModel.d.ts +2 -0
- package/widgets/Legend/styles/card/CardView.d.ts +2 -0
- package/widgets/Legend/styles/classic/ClassicView.d.ts +4 -1
- package/widgets/Legend.d.ts +3 -0
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.d.ts +7 -0
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/support/VideoFeatureCache.js +2 -0
- package/widgets/OrientedImageryViewer/types.d.ts +9 -0
- package/widgets/OrientedImageryViewer.d.ts +7 -0
- package/widgets/OrientedImageryViewer.js +2 -2
- package/widgets/PanoramicVideoViewer.js +1 -1
- package/widgets/PanoramicViewer/PanoramicVideoViewerViewModel.js +1 -1
- package/widgets/ScaleRangeSlider/types.d.ts +9 -2
- package/widgets/Sketch/SketchViewModel.d.ts +32 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch.d.ts +27 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/Slider/types.d.ts +58 -13
- package/widgets/Slider.d.ts +6 -0
- package/widgets/smartMapping/BinaryColorSizeSlider/BinaryColorSizeSliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/ClassedColorSlider/ClassedColorSliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/ClassedSizeSlider/ClassedSizeSliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/ColorSizeSlider/ColorSizeSliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/ColorSlider/ColorSliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/HeatmapSlider/HeatmapSliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/OpacitySlider/OpacitySliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/SizeSlider/SizeSliderViewModel.d.ts +3 -0
- package/widgets/smartMapping/SmartMappingPrimaryHandleSliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/SmartMappingSliderViewModel.d.ts +2 -0
- package/widgets/smartMapping/types.d.ts +30 -7
- package/widgets/support/FilterBuilder/FilterBuilderViewModel.d.ts +21 -11
- package/widgets/support/FilterBuilder/FilterBuilderViewModel.js +1 -1
- package/widgets/support/FilterBuilder/types.d.ts +28 -0
- package/widgets/support/FilterBuilder.js +1 -1
- package/widgets/support/FilterCondition/FilterConditionViewModel.d.ts +24 -0
- package/widgets/support/FilterCondition/FilterConditionViewModel.js +1 -1
- package/widgets/support/FilterCondition/types.d.ts +16 -1
- package/widgets/support/FilterCondition.js +1 -1
- package/widgets/support/SnappingControls/snappingLayerListUtils.js +1 -1
- package/widgets/support/iconUtils.js +1 -1
- package/assets/esri/core/workers/chunks/0606ab6fdfc1dfea3856.js +0 -1
- package/assets/esri/core/workers/chunks/078dcd17f46403d44b24.js +0 -1
- package/assets/esri/core/workers/chunks/1289204f8ca96032c17a.js +0 -1
- package/assets/esri/core/workers/chunks/12b5a645c0987a0efe54.js +0 -2
- package/assets/esri/core/workers/chunks/152fe3d6ad7aebbd23d1.js +0 -1
- package/assets/esri/core/workers/chunks/17b938ba49fb1e7ab8c4.js +0 -1
- package/assets/esri/core/workers/chunks/1dbb3e25e005a8220779.js +0 -2
- package/assets/esri/core/workers/chunks/3d6fef25af7e1a51e1bd.js +0 -1
- package/assets/esri/core/workers/chunks/3ef367c9b7bf1588307d.js +0 -1
- package/assets/esri/core/workers/chunks/5f4feca26102088ea565.js +0 -1
- package/assets/esri/core/workers/chunks/74211d096cc3296e0968.js +0 -1
- package/assets/esri/core/workers/chunks/7926faab76a721a2e1c4.js +0 -1
- package/assets/esri/core/workers/chunks/ad28486bc6afaa346de5.js +0 -1
- package/assets/esri/core/workers/chunks/ad29c729e90b5866713c.js +0 -1
- package/assets/esri/core/workers/chunks/b72a2514aa4cc4ae7d1b.js +0 -1
- package/assets/esri/core/workers/chunks/bb51cf52b8ea8283f4f8.js +0 -1
- package/assets/esri/core/workers/chunks/be761749f8d77fbd9df5.js +0 -1
- package/assets/esri/core/workers/chunks/dbfd25aa0d19aed5890c.js +0 -1
- package/assets/esri/core/workers/chunks/de28a86775235bd5d3c4.js +0 -2
- package/assets/esri/core/workers/chunks/f6cfc901267a229de7a1.js +0 -2
- package/assets/esri/core/workers/chunks/fb147097149a89e671ff.js +0 -1
- package/support/revision.js +0 -2
- /package/assets/esri/core/workers/chunks/{1dbb3e25e005a8220779.js.LICENSE.txt → 1b946714ca4a1a7359d4.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{f6cfc901267a229de7a1.js.LICENSE.txt → 2a1ec30f9ad305763f81.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{c3b96d1d43afccd23e45.js.LICENSE.txt → 590e6c70206122e4cc3c.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{cfaba0470619786e1ef8.js.LICENSE.txt → 68d8ae42ab71d01a70a5.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{de28a86775235bd5d3c4.js.LICENSE.txt → 8dc1c3042267618fd710.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{12b5a645c0987a0efe54.js.LICENSE.txt → 96c50a0dda0f1503ef92.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{b as e,G as t,h as n,d as r}from"./Geometry.js";import{aD as i,a4 as a,D as o,r as s,av as c}from"./UnitFactory.js";import{P as l,a as u}from"./MultiPathImpl.js";import{q as d,c as f,P as p}from"./Point2D.js";import{k as m}from"./Envelope.js";import{Envelope2D as h}from"./Envelope2D.js";import{O as g}from"./OperatorDensify.js";import{O as _}from"./OperatorClip.js";function v(){return{m_pGcs:new p,m_xyz:new m,m_factor:NaN,m_geoLength:NaN,setValues:y,setLength:b,assign:x}}function y(e,t,n,r){this.m_factor=e,this.m_pGcs.assign(t),this.m_xyz.assign(r),this.m_geoLength=n}function b(e){this.m_geoLength=e}function x(e){this.m_pGcs.assign(e.m_pGcs),this.m_xyz.assign(e.m_xyz),this.m_factor=e.m_factor,this.m_geoLength=e.m_geoLength}class S{getOperatorType(){return 10315}supportsCurves(){return!0}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}_ExecuteShapePreservingLength(e,t,n,r,o){if(e.hasNonLinearSegments()&&(e=new g().execute(e,0,t.getTolerance(0),0,o)),t.isPannable()){let r=90,a=-90;if(n.getUnit().getUnitToBaseFactor()===1&&(r*=Math.PI/180,a*=Math.PI/180),t.getCoordinateSystemType()===2){let e=null,n=[0,0,0,0];e=t.getPECoordSys(),n[0]=0,n[1]=r,n[2]=0,n[3]=a,i.geogToProj(e,2,n),r=n[1],a=n[3]}let s=new h;e.queryEnvelope(s),s.ymin=a,s.ymax=r,e=new _().execute(e,s,t,o)}else{let n=t.getPCSHorizon();e=new a().execute(e,n,t,o),e===n&&(e=e.clone())}return e.isEmpty()?0:this._ExecuteIterativeApproach(e,t,n,r,1,o)}_ExecuteIterativeApproach(e,t,n,a,o,c){let l=s();n.querySpheroidData(l);let u=l.majorSemiAxis,h=l.e2,g=n.getUnit().getUnitToBaseFactor(),_=d(v,40),y=f(40,NaN),b=v(),x=v(),S,T=[0,0,0,0],E=t.getPECoordSys(),D=new p,O=new p,k=new p,A=new p,j=new p,M=0,N=e.querySegmentIterator();for(;N.nextPath();)for(;N.hasNextSegment();){let e=N.nextSegment();D.assign(e.getStartXY()),O.assign(e.getEndXY()),t.getCoordinateSystemType()===2?(T[0]=D.x,T[1]=D.y,T[2]=O.x,T[3]=O.y,i.projToGeog(E,2,T),k.x=T[0]*g,k.y=T[1]*g,A.x=T[2]*g,A.y=T[3]*g):(k.setCoordsPoint2D(D),A.setCoordsPoint2D(O),k.scale(g),A.scale(g));let n=new m,a=new m;C(u,h,k,n),C(u,h,A,a);let s=w(u,n,a);b.setValues(0,k,NaN,n),x.setValues(1,A,s,a),S=o,_[0].assign(x),y[0]=o;let c=0;for(;;){c>128&&r(`iterations exceeded`);let n=(b.m_factor+x.m_factor)*.5,a=e.getCoord2D(n);t.getCoordinateSystemType()===2?(T[0]=a.x,T[1]=a.y,i.projToGeog(E,1,T),j.x=T[0]*g,j.y=T[1]*g):(j.setCoordsPoint2D(a),j.scale(g)),k.setCoordsPoint2D(b.m_pGcs),A.setCoordsPoint2D(x.m_pGcs);let l=new m;C(u,h,j,l);let d=w(u,b.m_xyz,l),f=w(u,x.m_xyz,l);s=x.m_geoLength,Number.isNaN(s)&&(s=w(u,b.m_xyz,x.m_xyz));let p=d+f,v=S===o&&p>=20&&Math.abs(p-s)>1e-8*(s+p);if(c+2<40&&(v||Math.abs(p-s)>0&&S>0))x.setLength(f),_[c].assign(x),x.setValues(n,j,d,l),_[++c].assign(x),v?(S=o,y[c]=o):(S--,y[c-1]=S,y[c]=S);else{if(M+=p,c===0)break;b.assign(x),x.assign(_[--c]),S=y[c]}}}return M}execute(r,i,a){if((!i||i.getCoordinateSystemType()===0)&&e(``),r.isEmpty()||r.getDimension()<1)return 0;let s=null,c=i.getGCS();c!==i&&(s=o(i,c,null));let d=r.getGeometryType();if(d===t.enumEnvelope){let e=new l;return e.addEnvelope(r,!1),this._ExecuteShapePreservingLength(e,i,c,s,a)}if(n(d)){let e=new u;return e.addSegment(r,!0),this._ExecuteShapePreservingLength(e,i,c,s,a)}return this._ExecuteShapePreservingLength(r,i,c,s,a)}}function C(e,t,n,r){r.assign(c(e,t,n))}function w(e,t,n){let r=e,i=new m;i.setSub(t,n);let a=i.length();return 2*r*Math.asin(a/(2*r))}export{S as O};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{G as e}from"./GeometryCursor.js";import{a as t,c as n,p as r,q as i,g as a,G as o,h as s,j as c,t as l}from"./Geometry.js";import{E as u,P as d}from"./Envelope.js";import{Envelope2D as f}from"./Envelope2D.js";import{a as p,S as m,L as h}from"./MultiPathImpl.js";import{n as g,P as _,d as v}from"./Point2D.js";import{T as y}from"./Transformation2D.js";import{O as b,F as x,ag as S,aO as C,J as w,I as T,H as E,K as D,a4 as O,a3 as k,_ as A,ax as ee,aP as te,aw as ne}from"./UnitFactory.js";import{c as j}from"./OperatorClip.js";function M(e){let t=e.getInputSR(),n=e.getOutputSR(),r=!1;do{if(t.equals(n)){r=!1;break}if(!L(t)||!L(n)){r=!1;break}if(t.getCoordinateSystemType()===2){r=!0;break}if(n.getCoordinateSystemType()===2){r=!0;break}let i=e.getGeographicTransformations();if(i!==null&&i.count()>0){r=!0;break}}while(0);return r}class re{m_horizon2;m_sr;m_bInclusive2;m_pannableExtent;m_horizon2Env=new f;m_gcs360;m_gcs180;m_gcs90;m_pannableFactor;m_period;m_gcsTolerance;m_qtIter;m_segIter;constructor(e,t,n,r){this.m_horizon2=e,this.m_sr=t,this.m_bInclusive2=n,this.m_pannableExtent=r.clone(),this.m_segIter=null,this.m_qtIter=null,e===null?(this.m_horizon2Env.setEmpty(),this.m_gcs360=NaN,this.m_gcs180=NaN,this.m_gcs90=NaN,this.m_pannableFactor=NaN,this.m_period=NaN):(e.queryEnvelope(this.m_horizon2Env),this.m_gcs360=r.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_gcsTolerance=t==null?NaN:t.getTolerance(0)}isPointStartInHorizon(e,t){if(!this.m_horizon2)return!0;let n=q(new d(e),this.m_horizon2,!0,this.m_period);do{let t=e.clone();if(t.x-=n*this.m_period,this.m_horizon2.getGeometryType()===o.enumPolygon){let e;if(e=this.m_horizon2Env.contains(t)?D(this.m_horizon2,t,0):0,this.m_bInclusive2){if(e===0)return!1}else if(e===1)return!1}else{let e=this.m_horizon2Env.contains(t);if(this.m_bInclusive2){if(!e)return!1}else if(e)return!1}}while(this.m_horizon2Env.xmin+ ++n*this.m_period<e.x);return!0}isAdjoiningLineInHorizon(e,t,n){if(!this.m_horizon2)return!0;let r=new _,i=new _;Y(e,t,this.m_gcs90,this.m_gcs180,this.m_gcs360,r,i);let s=Math.max(r.x,i.x),c=new h;c.setStart2D(r),c.setEnd2D(i);let l=q(c,this.m_horizon2,!0,this.m_period);do{let e=r.clone(),t=i.clone();if(e.x-=l*this.m_period,t.x-=l*this.m_period,this.m_horizon2.getGeometryType()===o.enumPolygon){let n=new h;n.setStartXY(e),n.setEndXY(t);let r=new f,i=new f;if(n.queryEnvelope(r),i.setCoords({env2D:r}),i.inflateCoords(this.m_gcsTolerance,this.m_gcsTolerance),this.m_horizon2Env.isIntersecting(i)){let e=this.m_horizon2.getImpl(),t=e.getAccelerators();t!==null&&t.getRasterizedGeometry()!==null&&a(0);{let r=null;if(t!==null&&(r=t.getQuadTree()),r!==null){this.m_qtIter||=r.getIteratorForQT(),this.m_qtIter.resetIterator(n,this.m_gcsTolerance),this.m_segIter||=e.querySegmentIterator();for(let e=this.m_qtIter.next();e!==-1;e=this.m_qtIter.next()){let t=r.getElement(e);if(this.m_segIter.resetToVertex(t,-1),this.m_segIter.nextSegment().isIntersecting(n,this.m_gcsTolerance))return!1}}else for(this.m_segIter||=e.querySegmentIterator(),this.m_segIter.resetToFirstPath();this.m_segIter.nextPath();)for(;this.m_segIter.hasNextSegment();){let e=this.m_segIter.nextSegment(),t=new f;if(e.queryEnvelope(t),t.isIntersecting(i)&&e.isIntersecting(n,this.m_gcsTolerance))return!1}}}}else if(this.m_bInclusive2){let n=this.m_horizon2Env.contains(e),r=this.m_horizon2Env.contains(t);if(n&&r)return!0}else{let n=this.m_horizon2Env.clone();if(n.inflateCoords(this.m_gcsTolerance,this.m_gcsTolerance),n.clipLine(e,t)!==0)return!1}}while(this.m_horizon2Env.xmin+ ++l*this.m_period<s);return!this.m_bInclusive2}isEnvelopeInHorizon(e,t){if(!this.m_horizon2)return!0;let n=new u({env2D:e}),r=q(n,this.m_horizon2,!0,this.m_period);do{let i=e.clone();if(i.move(-r*this.m_period,0),n.setCoords(i.xmin,i.ymin,i.xmax,i.ymax),!K(n,this.m_horizon2,this.m_sr,this.m_bInclusive2,t))return!1}while(this.m_horizon2Env.xmin+ ++r*this.m_period<e.xmax);return!0}}class ie{m_splitLines2=null;m_transform1;m_pannableExtent;m_gcs360;m_gcs180;m_gcs90;m_gcsTolerance;m_halfGcsTolerance;m_gcsToleranceSq;m_scalars=[];m_splitIter=null;constructor(e,t,n){this.m_splitLines2=e,this.m_transform1=t,this.m_pannableExtent=n.clone(),this.m_gcs360=n.width(),this.m_gcs180=.5*this.m_gcs360,this.m_gcs90=.25*this.m_gcs360,t===null?(this.m_gcsTolerance=NaN,this.m_halfGcsTolerance=NaN,this.m_gcsToleranceSq=NaN):(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)}hasSplitLines(){return this.m_splitLines2!=null}getSplitLineFactorEx(e,t,n,r,i,a){let o=new _,s=new _;Y(r,i,this.m_gcs90,this.m_gcs180,this.m_gcs360,o,s);let c=new h;for(c.setStartXY(o),c.setEndXY(s),this.m_splitIter?this.m_splitIter.resetToFirstPath():this.m_splitIter=this.m_splitLines2.getImpl().querySegmentIterator();this.m_splitIter.nextPath();)for(;this.m_splitIter.hasNextSegment();){let r=this.m_splitIter.nextSegment(),i=.5*(r.getStartX()+r.getEndX());U(this.m_gcs180,this.m_gcs360,i,c);let o=new f;c.queryEnvelope(o),o.inflateCoords(this.m_gcsTolerance,this.m_gcsTolerance);let s=new f;if(r.queryEnvelope(s),!(!o.isIntersecting(s)||(this.m_scalars.length<2&&(this.m_scalars.length=2),c.intersect(r,null,this.m_scalars,null,this.m_gcsTolerance)!==1))&&this.m_scalars[0]>0&&this.m_scalars[0]<1){let i=$(t,n,this.m_scalars[0]),o=V(e.getCoord2D(i),this.m_transform1);return r.isIntersectingPoint(o,this.m_halfGcsTolerance)?i:this.getSplitLineFactor(e,t,n,r,a)}}return-1}getSplitLineFactor(e,t,n,r,i){let a=t,o=n,s=.5*(r.getStartX()+r.getEndX()),c=new h,l=e.getCoord2D(a),u=e.getCoord2D(o),d=V(l,this.m_transform1),f=V(u,this.m_transform1);for(;a<o;){let t=new _,n=new _;Y(d,f,this.m_gcs90,this.m_gcs180,this.m_gcs360,t,n),c.setStartXY(t),c.setEndXY(n),U(this.m_gcs180,this.m_gcs360,s,c);let i=_.sqrDistance(c.getStartXY(),c.getEndXY());if(i<=this.m_gcsToleranceSq)break;if(Number.isNaN(i))return NaN;let p=$(a,o,this.m_scalars[0]);if(a<p&&p<o||(p=.5*(o+a)),a===p||p===o)return p;let m=e.getCoord2D(p),h=V(m,this.m_transform1),g=new _;Y(d,h,this.m_gcs90,this.m_gcs180,this.m_gcs360,t,g),c.setStartXY(t),c.setEndXY(g),U(this.m_gcs180,this.m_gcs360,s,c);let v=c.intersect(r,null,this.m_scalars,null,this.m_halfGcsTolerance);if(v!==0){if(this.m_scalars[0]===1)return p;o=p,u.setCoordsPoint2D(m),f.setCoordsPoint2D(h)}else{if(Y(h,f,this.m_gcs90,this.m_gcs180,this.m_gcs360,g,n),c.setStartXY(g),c.setEndXY(n),U(this.m_gcs180,this.m_gcs360,s,c),v=c.intersect(r,null,this.m_scalars,null,this.m_halfGcsTolerance),v===0||this.m_scalars[0]===0)return p;a=p,l.setCoordsPoint2D(m),d.setCoordsPoint2D(h)}}return .5*(o+a)}}class N{m_bPrepared=!1;m_bNeedsShapePreservingProject=!1;m_inputTransform=null;m_transform1=null;m_transform2=null;m_extentFrom=null;m_horizon1=null;m_horizon2=null;m_pannableExtentFrom=new f;m_pannableExtentTo=new f;m_pannableExtentGcsTo=new f;m_bClipTopBottomFrom=!1;m_bNeedsGeoTransform=!1;m_bIsPannableFrom=!1;m_bIsPannableTo=!1;m_bInclusive1=!1;m_bInclusive2=!1;m_bSrFromIsPcs=!1;m_bSrToIsPcs=!1;m_fromTolerance=NaN;m_toTolerance=NaN;m_gcsToTolerance=NaN;m_aFrom=NaN;m_mpuFrom=NaN;m_rpuFrom=NaN;m_rpuGcsTo=NaN;m_aTo=NaN;m_mpuTo=NaN;m_stages=0;constructor(){}prepare(e,n,r){this.m_bPrepared&&i(``),e||t(``);let o=e.getInputSR(),s=e.getOutputSR();(!L(o)||!L(s))&&t(`shape preserving project requires PCS or GCS`);let c=o.getCoordinateSystemType(),l=s.getCoordinateSystemType();this.m_bSrFromIsPcs=c===2,this.m_bSrToIsPcs=l===2;let u=null,d=null,f=null,p=null;this.m_bSrFromIsPcs?(u=o,f=o.getGCS(),this.m_aFrom=Q(f),this.m_mpuFrom=Z(u),this.m_rpuFrom=NaN):(f=o,this.m_rpuFrom=X(f),this.m_aFrom=NaN),this.m_bSrToIsPcs?(d=s,p=s.getGCS(),this.m_aTo=Q(p),this.m_mpuTo=Z(d)):(p=s,this.m_aTo=NaN,this.m_mpuTo=NaN),this.m_rpuGcsTo=X(p);let m=e.getGeographicTransformations();this.m_bNeedsGeoTransform=m!==null&&m.count()>0;let h=o.equals(s);if(this.m_bNeedsShapePreservingProject=!h&&(this.m_bSrFromIsPcs||this.m_bSrToIsPcs||this.m_bNeedsGeoTransform),!this.m_bNeedsShapePreservingProject){this.m_inputTransform=e,this.m_extentFrom=n?n.clone():null,this.m_bPrepared=!0;return}if(this.m_bIsPannableFrom=o.isPannable(),this.m_bIsPannableTo=s.isPannable(),this.m_bIsPannableFrom&&(this.m_pannableExtentFrom=o.getPannableExtent()),this.m_bIsPannableTo&&(this.m_pannableExtentTo=s.getPannableExtent()),!this.m_bSrToIsPcs)this.m_pannableExtentGcsTo=this.m_pannableExtentTo.clone();else{this.m_pannableExtentGcsTo=p.getPannableExtent();let e=d.getCentralMeridian(),t=this.m_pannableExtentGcsTo.getCenter();t.x=e,this.m_pannableExtentGcsTo.centerAt(t)}this.m_fromTolerance=o.getTolerance(0),this.m_toTolerance=s.getTolerance(0),this.m_gcsToTolerance=p.getTolerance(0);{let t=e.getExtendedParams(),i=t.clipWithInputHorizon,a=t.clipWithOutputHorizon;i&&this.setHorizon1(e,n,r),a&&this.setHorizon2(e,r),this.checkAndSetStages(e,r)}let g=T();g.setFlag(1073741824,!0),g.setFlag(536870912,!0);let _=E();if(_.clipWithInputHorizon=!1,_.clipWithOutputHorizon=!1,this.m_stages===1)this.m_transform1=x(!1,o,s,m,_,g);else if(this.m_stages===2){g.setFlag(2147483648,!0),this.m_transform1=x(!1,o,p,m,_,g);let e=T();this.m_transform2=x(!1,p,s,null,_,e)}else{a(d!=null),_.centralMeridianOfOutputGCS=d.getCentralMeridian(),this.m_transform1=x(!1,o,p,m,_,g);let e=T();e.setFlag(2147483648,!0),this.m_transform2=x(!1,p,s,null,_,e)}this.m_inputTransform=e,this.m_extentFrom=n?n.clone():null,this.m_bPrepared=!0}execute(e,t,n,r){return this.m_bPrepared||i(``),a(!e.hasAttribute(10)),this.execute_(e,t,n,r)}checkIfNeedsReset(e,t){return a(0),!1}setHorizon1(e,t,n){let r=e.getInputSR(),i=null,a,o=new f;if(this.m_bSrFromIsPcs){a=!0,i=r.getPCSHorizon(),i.queryEnvelope(o),this.m_bIsPannableFrom&&(i=new u({xmin:this.m_pannableExtentFrom.xmin,ymin:o.ymin,xmax:this.m_pannableExtentFrom.xmax,ymax:o.ymax}));let e=!1;t!=null&&(e=ce(t,i,r,a,this.m_bIsPannableFrom,this.m_pannableExtentFrom,n)),e||(this.m_horizon1=i,this.m_bInclusive1=a)}else this.m_bClipTopBottomFrom=!0,this.m_bInclusive1=!0}setHorizon2(e,t){let n=e.getOutputSR();if(n.getCoordinateSystemType()===1){this.m_horizon2=null,this.m_bInclusive2=!1;return}let r=null,i=new f,a=n.getGCSHorisonIsInclusive();r=n.getGCSHorizon(),r.queryEnvelope(i);let o=n.getCentralMeridian();if(this.m_bIsPannableTo){let e=new u({xmin:this.m_pannableExtentGcsTo.xmin,ymin:i.ymin,xmax:this.m_pannableExtentGcsTo.xmax,ymax:i.ymax});e.centerAt(o,0),r=e}this.m_horizon2=r,this.m_bInclusive2=a}checkAndSetStages(e,t){let n=e.getOutputSR().getGCSSplitLines();if(!this.m_horizon2&&!n){this.m_stages=1;return}if(this.m_horizon2.getGeometryType()===o.enumEnvelope){let e=new f;this.m_horizon2.queryEnvelope(e);let t=e.width(),n=e.height();t>=g/this.m_rpuGcsTo&&n>=Math.PI/this.m_rpuGcsTo&&(this.m_horizon2=null)}if(!this.m_horizon2&&!n){this.m_stages=1;return}if(this.m_horizon2!==null&&!this.m_bNeedsGeoTransform&&!this.m_bSrFromIsPcs){let t=e.getOutputSR().getGCS();if(e.getInputSR().equals(t)){this.m_horizon1=this.m_horizon2,this.m_bInclusive1=this.m_bInclusive2,this.m_bClipTopBottomFrom=!1,this.m_horizon2=null,this.m_bInclusive2=!1,this.m_stages=1;return}this.m_stages=2;return}this.m_stages=3}execute_(e,t,i,a){if(!this.m_bNeedsShapePreservingProject)return new b().execute(e,this.m_inputTransform,a);if(!e)return null;n(e),r(e);let l=e.getGeometryType(),u;return s(l)?(u=ae(e),l=o.enumPolyline):u=e,u.isEmpty()?u:c(l)?this.executeEx(e,t,i,a):new b().execute(e,this.m_inputTransform,a)}executeEx(e,t,n,r){e.hasNonLinearSegments()&&l(``);let i;i=this.m_bIsPannableFrom?new b().foldInto360Range(e,this.m_transform1.getInputSR()):e;let a=n;a>0||(a=100*this.m_toTolerance);let o;return o=this.m_stages===1?this.executeGood(i,t,a,r):this.m_stages===2?this.executeBad(i,t,a,r):this.executeUgly(i,t,a,r),this.filterOverDensification(o,this.m_inputTransform.getOutputSR(),a,r)}executeGood(e,t,n,r){let i=n*n,a;a=t>0?this.getMinLengthInSrFrom(t):this.getMinLengthInSrFrom(1e-5);let o;return o=this.m_bClipTopBottomFrom?S(e,this.m_transform1.getInputSR()):W(e,this.m_transform1.getInputSR(),this.m_horizon1,this.m_bInclusive1,this.m_bIsPannableFrom,this.m_pannableExtentFrom,!0,NaN,r),o=C(o,this.m_transform1.getOutputSR(),r),o=R(o,this.m_transform1,this.m_bIsPannableFrom,this.m_pannableExtentFrom,this.m_bIsPannableTo,this.m_pannableExtentTo,null,null,null,null,a,i,r),o=new b().execute(o,this.m_transform1,r),o}executeBad(e,t,n,r){let i;i=t>0?t*(Math.PI/180/this.m_rpuGcsTo):1e-5*(Math.PI/180/this.m_rpuGcsTo);let a=n*n,o;return o=this.m_bClipTopBottomFrom?S(e,this.m_transform1.getInputSR()):e,o=new b().execute(o,this.m_transform1,r),o=W(o,this.m_transform2.getInputSR(),this.m_horizon2,this.m_bInclusive2,!0,this.m_pannableExtentGcsTo,!0,NaN,r),o=C(o,this.m_transform2.getOutputSR(),r),o=R(o,this.m_transform2,!0,this.m_pannableExtentGcsTo,this.m_bIsPannableTo,this.m_pannableExtentTo,null,null,null,null,i,a,r),o=new b().execute(o,this.m_transform2,r),o}executeUgly(e,t,n,r){let i=n*n,a;a=t>0?this.getMinLengthInSrFrom(t):this.getMinLengthInSrFrom(1e-5);let o=null;o=this.m_bClipTopBottomFrom?S(e,this.m_transform1.getInputSR()):W(e,this.m_transform1.getInputSR(),this.m_horizon1,this.m_bInclusive1,this.m_bIsPannableFrom,this.m_pannableExtentFrom,!0,NaN,r);let s=o,c=new re(this.m_horizon2,this.m_transform2.getInputSR(),this.m_bInclusive2,this.m_pannableExtentGcsTo),l=this.m_transform2.getOutputSR().getGCSSplitLines(),u=new ie(l,this.m_transform1,this.m_pannableExtentGcsTo);if(o=R(o,this.m_transform1,this.m_bIsPannableFrom,this.m_pannableExtentFrom,this.m_bIsPannableTo,this.m_pannableExtentTo,this.m_transform2,c,this.m_pannableExtentGcsTo,u,a,i,r),o!==null){s=null,o=new b().execute(o,this.m_transform1,r);let e=2*(Math.PI/180/this.m_rpuGcsTo);return o=W(o,this.m_transform2.getInputSR(),this.m_horizon2,this.m_bInclusive2,!0,this.m_pannableExtentGcsTo,!1,e,r),o=new b().execute(o,this.m_transform2,r),o}let d=NaN;d=n>0?n:100*this.m_toTolerance,d/=this.m_rpuGcsTo*this.m_aTo/this.m_mpuTo;let f=d*d;o=R(s,this.m_transform1,this.m_bIsPannableFrom,this.m_pannableExtentFrom,!0,this.m_pannableExtentGcsTo,null,null,null,null,a,f,r),s=null,o=new b().execute(o,this.m_transform1,r);let p;return p=t>0?t*(Math.PI/180/this.m_rpuGcsTo):1e-5*(Math.PI/180/this.m_rpuGcsTo),o=W(o,this.m_transform2.getInputSR(),this.m_horizon2,this.m_bInclusive2,!0,this.m_pannableExtentGcsTo,!1,NaN,r),o=C(o,this.m_transform2.getOutputSR(),r),o=R(o,this.m_transform2,!0,this.m_pannableExtentGcsTo,this.m_bIsPannableTo,this.m_pannableExtentTo,null,null,null,null,p,i,r),o=new b().execute(o,this.m_transform2,r),o}getMinLengthInSrFrom(e){let t;return t=this.m_bSrFromIsPcs?this.m_aFrom*(e*Math.PI/180)/this.m_mpuFrom:e*Math.PI/180*(1/this.m_rpuFrom),t}filterOverDensification(e,t,n,r){let i=P(e,n);return i.dropAttribute(10),i!==e&&i.getGeometryType()===o.enumPolygon&&(i=new w().execute(i,t,!1,r)),i}}function P(e,t){if(e.isEmpty()||!e.hasAttribute(10))return e;let n=t*t,r=e.getAttributeStreamRef(10),i=!1,a=new h,o=[],s=!1;for(let t=0,c=e.getPathCount();t<c;t++){let c=e.getPathStart(t),l=e.getPathEnd(t),u=e.isClosedPath(t);if(l>c){let e=u?c:l-1;(r.read(c)!==0||r.read(e)!==0)&&(i||=(r=r.clone(),!0),r.write(c,0),r.write(e,0))}else continue;let d=u?l+1:l,f=c;for(let t=c;t<d;t++){let u=t===l?c:t;if(r.read(u)===0){if(t-f>1){o.push({from:f,to:t});let u=new _;for(;o.length>0;){let t=o.at(-1);o.pop(),a.setStartXY(e.getXY(t.from));let d=t.to===l?c:t.to;a.setEndXY(e.getXY(d));let f=n,p=-1;for(let n=t.from+1,r=t.to;n<r;n++){let t=e.getXY(n),r=a.getClosestCoordinate(t,!1);a.queryCoord2D(r,u);let i=_.sqrDistance(u,t);f<i&&(f=i,p=n)}p>=0?(i||=(r=r.clone(),!0),r.write(p,0),p-t.from>1&&o.push({from:t.from,to:p}),t.to-p>1&&o.push({from:p,to:t.to})):s=!0}}f=u}}}if(!s)return e;let c=F(e,r,1);return c.dropAttribute(10),c}function F(e,t,n){let r=e.createInstance(),i=new d;for(let a=0,o=e.getPathCount();a<o;a++){let o=!0,s=0,c=0,l=e.getPathStart(a),u=e.getPathEnd(a),d=!0;for(let f=l;f<u;f++)t.read(f)===n?(!d&&c>0&&(r.addSegmentsFromPath(e,a,s-l,c,o),c=0),d=!0):d?(d=!1,e.getPointByVal(f,i),o?(r.startPathPoint(i),o=!1):r.lineToPoint(i),s=f):c++;c>0&&r.addSegmentsFromPath(e,a,s-l,c,o)}return r}function I(e,t){for(let n=0;n<e;n++){let r=Math.ceil(n/2)/(e+1);n%2!=0&&(r=-r);let i=.5+r;t[n]=i}}function L(e){if(!e)return!1;let t=e.getCoordinateSystemType();return t===2||t===1}function R(e,t,n,r,i,a,o,s,c,l,u,d,f){let p=e.createInstance();p.addAttribute(10);let h=e.querySegmentIterator(),g=[],_=[],v=new m,y=e.getDescription().getAttributeCount()>1,b=new ue(t,n,r,i,a,o,s,l,u,d,y?_:null,g,f);for(;h.nextPath();)for(;h.hasNextSegment();){let e=h.nextSegment(),t=e.getStartXY(),n=e.getEndXY(),r=t.compare(n)>0,i=H(r,e,v);if(g.length=0,_.length=0,!b.densifySegment(h.isFirstSegmentInPath(),i))return null;r&&se(y?_:null,g),g.at(-1).setCoordsPoint2D(e.getEndXY());let a=p.getPointCount();if(!y)z(h.isFirstSegmentInPath(),h.isLastSegmentInPath()&&!h.isPathClosed(),g,p);else{let t=H(r,e,v);B(h.isFirstSegmentInPath(),h.isLastSegmentInPath()&&!h.isPathClosed(),e,t,_,g,p)}if(b.needsPostFiltering()){p.addAttribute(10);let e=p.getAttributeStreamRef(10);for(let t=1,n=g.length-1;t<n;t++)e.write(t+a,1)}}return p}function z(e,t,n,r){e&&r.insertPath2D(-1,null,0,0,!0);let i=r.getPathCount()-1;t?r.insertPointsFromPoints(i,-1,n,0,n.length,!0):r.insertPointsFromPoints(i,-1,n,0,n.length-1,!0)}function B(e,t,n,r,i,a,o){o.reserve(o.getPointCount()+a.length-1);let s=new d;if(n.queryStart(s),e?o.startPathPoint(s):o.lineToPoint(s),a.length>2){let e=r.calculateLength2D();for(let t=1;t<a.length-1;t++){let n=r.lengthToT(i[t]*e);r.queryCoord(n,s),s.setXY(a[t]),o.lineToPoint(s)}}t&&(n.queryEnd(s),o.lineToPoint(s))}function ae(e){let t=new p({vd:e.getDescription()});return t.addSegment(e,!0),t}function V(e,t){let n=t.getInputSR(),r=t.getOutputSR(),i=new _;n.getCoordinateSystemType()===2?(i.setCoordsPoint2D(e),ee(n,0,[i],1)):i.setCoordsPoint2D(e);let a=new _;a.setCoordsPoint2D(i),te(t,[a],null,1,!1);let o=new _;return r.getCoordinateSystemType()===2?(o.setCoordsPoint2D(a),ne(r,[o],1,!1)):o.setCoordsPoint2D(a),o}function oe(e,t,n,r,i,a,o,s){if(i){let i=a.width(),c=.5*i;if(r){let r=.25*i,a=!1,l=new _,u=new _;if(Math.abs(e.y)===r?(l.setCoords(n.x,e.y),u.setCoordsPoint2D(n),a=!0):Math.abs(n.y)===r&&(u.setCoords(e.x,n.y),l.setCoordsPoint2D(e),a=!0),Math.abs(t.y)===r&&(a||=(l.setCoordsPoint2D(e),u.setCoordsPoint2D(n),!0),l.x=t.x),a)return J(t,l,c,i,o),J(t,u,c,i,s),!0}let l=0;e.x-t.x>c&&n.x-t.x>c?l-=i:t.x-e.x>c&&t.x-n.x>c&&(l+=i),Math.abs(t.x-(e.x+l))<c?(o.setCoordsPoint2D(e),J(o,n,c,i,s),o.x+=l,s.x+=l):(o.setCoordsPoint2D(n),J(o,e,c,i,s),o.x+=l,s.x+=l)}else o.setCoordsPoint2D(e),s.setCoordsPoint2D(n);return!1}function H(e,t,n){return e?(n.create(t.getGeometryType()),t.copyTo(n.get()),n.get().reverse(),n.get()):t}function se(e,t){t.reverse(),e!==null&&e.reverse()}function U(e,t,n,r){let i=.5*(r.getStartX()+r.getEndX());if(i-n>e){let e=new y;e.setShiftCoords(-t,0),r.applyTransformation(e)}else if(n-i>e){let e=new y;e.setShiftCoords(t,0),r.applyTransformation(e)}}function W(e,t,n,r,i,a,o,s,c){let l=[!1];o&&G(e,t,n,r,i,a,!0,s,l,c);let u=e;return l[0]||(u=G(u,t,n,r,i,a,!1,s,null,c)),u=le(u,i,a,u!==e),u}function G(e,t,n,r,i,a,s,c,l,u){if(s&&(l[0]=!1),n==null)return e;let d=new f,p=new f;n.queryEnvelope(d),e.queryEnvelope(p);let m=e.getGeometryType(),h=n.getGeometryType(),g=t.getTolerance(0);if(!i){if(s)return l[0]=K(e,n,t,r,u),null;let i;return i=r?h===o.enumEnvelope?j(e,d,g,c,u):new O().execute(e,n,t,u):new k().execute(e,n,t,u),i===n&&(i=n.clone()),i}let _=a.width(),v=_*Math.ceil(d.width()/_),b=null;if(r){let a=q(e,n,i,v),x=0,S=new y;do{let i=null;if(h===o.enumEnvelope){let o=n.clone();if(S.setShiftCoords(a*v,0),o.applyTransformation(S),s){if(l[0]=K(e,o,t,r,u),!l[0])return null}else{let t=new f;o.queryEnvelope(t),i=j(e,t,g,c,u)}}else{let o=e.clone();if(S.setShiftCoords(-a*v,0),o.applyTransformation(S),s){if(l[0]=K(o,n,t,r,u),!l[0])return null}else i=new O().execute(o,n,t,u),i===n&&(i=n.clone())}if(!s){if(i.isEmpty())continue;if(m===o.enumPolygon){let e=new f;if(i.queryEnvelope(e),e.width()<=g)continue}h===o.enumEnvelope&&(S.setShiftCoords(-a*v,0),i===e&&(i=i.clone()),i.applyTransformation(S)),b===null?b=i===e?i.clone():i:b.add(i,!1)}x++}while(d.xmin+ ++a*v<p.xmax);if(s)return null;b===null&&(b=e.createInstance()),m===o.enumPolygon&&x>1&&_-p.width()<=10*g&&(b=new w().execute(b,t,!0,u))}else{let a=q(e,n,i,v);if(b=e.clone(),a!==0){let e=new y;e.setShiftCoords(-a*v,0),b.applyTransformation(e)}do{if(s){if(l[0]=K(b,n,t,r,u),!l[0])return null}else if(b=new k().execute(b,n,t,u),b===n&&(b=n.clone()),b.isEmpty())break;let e=new y;e.setShiftCoords(-v,0),b.applyTransformation(e)}while(d.xmin+ ++a*v<p.xmax);if(s)return null;if(!b.isEmpty()&&a!==0){let e=new y;e.setShiftCoords(a*v,0),b.applyTransformation(e)}}return b}function ce(e,t,n,r,i,a,o){let s=[!1];return G(e,n,t,r,i,a,!0,NaN,s,o),s[0]}function K(e,t,n,r,i){let a;if(t.getGeometryType()===o.enumPolygon)a=r?A(t,e,n,64,i):A(t,e,n,4,i);else if(r){let n=new f,r=new f;t.queryEnvelope(n),e.queryEnvelope(r),a=n.containsEnvelope(r)}else a=A(t,e,n,4,i);return a}function le(e,t,n,r){let i;if(!t)return e;let a=n.getCenter().x,o=n.width(),s=.5*o,c=new f;e.queryEnvelope(c);let l=c.getCenter().x,u=0;if(l-a>s?u=-Math.ceil((l-a-s)/o)*o:a-l>s&&(u=Math.ceil((a-l-s)/o)*o),u!==0){i=r?e:e.clone();let t=new y;t.setShiftCoords(u,0),i.applyTransformation(t)}else i=e;return i}function q(e,t,n,r){if(!n)return 0;let i=0,a=new f;t.queryEnvelope(a);let o=new f;e.queryEnvelope(o);let s=a.xmin+r;for(;s+r+i*r>o.xmin;)i--;for(;s+i*r<o.xmin;)i++;return i}function J(e,t,n,r,i){t.x-e.x>n?i.setCoords(t.x-r,t.y):e.x-t.x>n?i.setCoords(t.x+r,t.y):i.setCoordsPoint2D(t)}function Y(e,t,n,r,i,a,o){Math.abs(e.y)===n?(a.setCoords(t.x,e.y),o.setCoordsPoint2D(t)):Math.abs(t.y)===n?(a.setCoordsPoint2D(e),o.setCoords(e.x,t.y)):(a.setCoordsPoint2D(e),J(a,t,r,i,o))}function X(e){return e.getUnit().getUnitToBaseFactor()}function Z(e){return e.getUnit().getUnitToBaseFactor()}function Q(e){return e.getPECoordSys().getDatum().getSpheroid().getAxis()}function $(e,t,n){return n<=.5?e+(t-e)*n:t-(t-e)*(1-n)}class ue{leftFromDensifiedPoint=new _;rightFromDensifiedPoint=new _;cutFromDensifiedPoint=new _;midFromDensifiedPoint=new _;leftToDensifiedPoint=new _;rightToDensifiedPoint=new _;cutToDensifiedPoint=new _;midToDensifiedPoint=new _;line=new h;leftGcsToDensifiedPoint=new _;rightGcsToDensifiedPoint=new _;cutGcsToDensifiedPoint=new _;midGcsToDensifiedPoint=new _;bSrToIsGcs=!1;bIsCurve=!1;leftFactor=0;rightFactor=0;bIsFirstInPath=!1;rectifiedSegment=null;transform=null;bIsPannableFrom=!1;pannableExtentFrom=new f;bIsPannableTo=!1;bNeedPostFiltering=!1;pannableExtentTo=new f;transform2=null;pHorizon2Info=null;pSplitLines2Info=null;minLengthInSrFrom=0;maxDeviationInSrToSq=0;cutFactor=0;midFactor=0;pDensifiedFactors=null;pDensifiedPoints=[];progressTracker;rightFromDensifiedPointsStack=[];rightToDensifiedPointsStack=[];rightGcsToDensifiedPointsStack=[];rightFactorsStack=[];projCurveSegment=new m;n=0;bCheckIfNoDensificationNeededForCurve=!1;scalars=v(7,NaN);checkSegment(){for(let e=0;e<this.n;e++){if(this.pSplitLines2Info!==null&&this.pSplitLines2Info.hasSplitLines()&&!this.bCheckIfNoDensificationNeededForCurve){let e=this.pSplitLines2Info.getSplitLineFactorEx(this.rectifiedSegment,this.leftFactor,this.rightFactor,this.leftGcsToDensifiedPoint,this.rightGcsToDensifiedPoint,this.progressTracker);if(Number.isNaN(e))return-1;if(e!==-1&&this.leftFactor<e&&e<this.rightFactor)return this.cutFactor=e,this.cutFromDensifiedPoint.assign(this.rectifiedSegment.getCoord2D(this.cutFactor)),this.cutToDensifiedPoint.assign(V(this.cutFromDensifiedPoint,this.transform)),this.cutGcsToDensifiedPoint.setCoordsPoint2D(this.cutToDensifiedPoint),this.cutToDensifiedPoint.assign(V(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=$(this.leftFactor,this.rightFactor,this.scalars[e]),this.cutFromDensifiedPoint.assign(this.rectifiedSegment.getCoord2D(this.cutFactor)),this.cutToDensifiedPoint.assign(V(this.cutFromDensifiedPoint,this.transform)),this.transform2!==null&&(this.cutGcsToDensifiedPoint.setCoordsPoint2D(this.cutToDensifiedPoint),this.cutToDensifiedPoint.assign(V(this.cutGcsToDensifiedPoint,this.transform2))),e===0&&(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 t;if(this.bCheckIfNoDensificationNeededForCurve){let e=this.projCurveSegment.get().getClosestCoordinate(this.cutToDensifiedPoint,!1),n=this.projCurveSegment.get().getCoord2D(e);t=_.sqrDistance(this.cutToDensifiedPoint,n)}else{let n=new _,r=new _,i=oe(this.leftToDensifiedPoint,this.cutToDensifiedPoint,this.rightToDensifiedPoint,this.bSrToIsGcs,this.bIsPannableTo,this.pannableExtentTo,n,r);this.line.setStartXY(n),this.line.setEndXY(r);let a=this.line.getClosestCoordinate(this.cutToDensifiedPoint,!0);if(i||e>0||Math.abs(a-this.scalars[e])<.3){let e=this.line.getCoord2D(a);t=_.sqrDistance(this.cutToDensifiedPoint,e)}else t=this.maxDeviationInSrToSq*2,this.bNeedPostFiltering=!0}if(t>this.maxDeviationInSrToSq)return this.bCheckIfNoDensificationNeededForCurve=!1,1}return 0}constructor(e,t,n,r,i,a,o,s,c,l,u,d,f){this.progressTracker=f,this.transform=e,this.bIsPannableFrom=t,this.pannableExtentFrom.assign(n),this.bIsPannableTo=r,this.pannableExtentTo.assign(i),this.transform2=a,this.pHorizon2Info=o,this.pSplitLines2Info=s,this.minLengthInSrFrom=c,this.maxDeviationInSrToSq=l,this.pDensifiedFactors=u,this.pDensifiedPoints=d,this.progressTracker=f,this.bNeedPostFiltering=!1}needsPostFiltering(){return this.bNeedPostFiltering}densifySegment(e,t){if(this.bIsFirstInPath=e,this.rectifiedSegment=t,this.leftGcsToDensifiedPoint.setNAN(),this.rightGcsToDensifiedPoint.setNAN(),this.cutGcsToDensifiedPoint.setNAN(),this.midGcsToDensifiedPoint.setNAN(),this.bSrToIsGcs=this.transform2==null?this.transform.getOutputSR().getCoordinateSystemType()===1:this.transform2.getOutputSR().getCoordinateSystemType()===1,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(V(this.leftFromDensifiedPoint,this.transform)),this.rightToDensifiedPoint.assign(V(this.rightFromDensifiedPoint,this.transform)),this.transform2!==null&&(this.leftGcsToDensifiedPoint.setCoordsPoint2D(this.leftToDensifiedPoint),this.rightGcsToDensifiedPoint.setCoordsPoint2D(this.rightToDensifiedPoint),this.leftToDensifiedPoint.assign(V(this.leftGcsToDensifiedPoint,this.transform2)),this.rightToDensifiedPoint.assign(V(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),this.transform2!=null&&this.rightGcsToDensifiedPointsStack.push(this.rightGcsToDensifiedPoint.clone()),this.pDensifiedPoints!==null&&this.pDensifiedPoints.push(this.leftFromDensifiedPoint.clone()),this.pDensifiedFactors!==null&&this.pDensifiedFactors.push(this.leftFactor),this.n=this.bIsCurve?this.rectifiedSegment.getGeometryType()===o.enumBezier?7:5:3,I(this.n,this.scalars);let n=this.rectifiedSegment.calculateLength2D();if(this.bCheckIfNoDensificationNeededForCurve=!1,this.bIsCurve){let e=new p({vd:this.rectifiedSegment.getDescription()}),t=new b().execute(e,this.transform,this.progressTracker);if(this.transform2!==null){let e=new f;if(t.queryEnvelope(e),!this.pHorizon2Info.isEnvelopeInHorizon(e,this.progressTracker))return!1;t=new b().execute(t,this.transform2,this.progressTracker)}t.getSegmentBuffer(0,this.projCurveSegment,!1),this.bCheckIfNoDensificationNeededForCurve=!0}for(;this.rightFromDensifiedPointsStack.length>0;){let e=!1;if(this.cutFactor=NaN,this.midFactor=NaN,this.midFromDensifiedPoint.setNAN(),this.midToDensifiedPoint.setNAN(),(this.rightFactor-this.leftFactor)*n>this.minLengthInSrFrom){let t=this.checkSegment();if(t===-1)return!1;e=t!==0}if(e)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),this.transform2!==null&&(this.rightGcsToDensifiedPoint.setCoordsPoint2D(this.midGcsToDensifiedPoint),this.rightGcsToDensifiedPointsStack.push(this.rightGcsToDensifiedPoint.clone()));else{if(this.transform2!==null&&!this.pHorizon2Info.isAdjoiningLineInHorizon(this.leftGcsToDensifiedPoint,this.rightGcsToDensifiedPoint,this.progressTracker))return!1;if(this.rightFromDensifiedPointsStack.pop(),this.rightToDensifiedPointsStack.pop(),this.rightFactorsStack.pop(),this.transform2!==null&&this.rightGcsToDensifiedPointsStack.pop(),this.pDensifiedPoints!==null&&this.pDensifiedPoints.push(this.rightFromDensifiedPoint.clone()),this.pDensifiedFactors!==null&&this.pDensifiedFactors.push(this.rightFactor),this.rightFromDensifiedPointsStack.length>0){this.leftFromDensifiedPoint.setCoordsPoint2D(this.rightFromDensifiedPoint),this.leftToDensifiedPoint.setCoordsPoint2D(this.rightToDensifiedPoint),this.leftFactor=this.rightFactor;let e=this.rightFromDensifiedPointsStack.at(-1),t=this.rightToDensifiedPointsStack.at(-1);if(this.rightFromDensifiedPoint.setCoordsPoint2D(e),this.rightToDensifiedPoint.setCoordsPoint2D(t),this.rightFactor=this.rightFactorsStack.at(-1),this.transform2!==null){this.leftGcsToDensifiedPoint.setCoordsPoint2D(this.rightGcsToDensifiedPoint);let e=this.rightGcsToDensifiedPointsStack.at(-1);this.rightGcsToDensifiedPoint.setCoordsPoint2D(e)}}}}return!0}}class de{getOperatorType(){return 10315}supportsCurves(){return!1}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}executeMany(e,t,n,r,i,a){return M(n)?new fe(e,t,n,r,i,a):new b().executeMany(e,n,a)}execute(e,t,n,r,i){if(!M(t))return new b().execute(e,t,i);let a=new N;return a.prepare(t,null,i),a.execute(e,n,r,i)}}class fe extends e{m_geometries;m_geometriesExtent;m_transform;m_spp=null;m_minSegmentLengthInDegrees;m_maxDeviationInSrTo;m_progressTracker;m_index=-1;constructor(e,n,r,i,a,o){super(),e||t(``),this.m_progressTracker=o,this.m_geometries=e,this.m_geometriesExtent=n?n.clone():null,this.m_transform=r,this.m_minSegmentLengthInDegrees=i,this.m_maxDeviationInSrTo=a}tock(){return!0}getRank(){return 1}next(){this.m_spp||(this.m_spp=new N,this.m_spp.prepare(this.m_transform,this.m_geometriesExtent,this.m_progressTracker));let e=this.m_geometries.next();return n(e),r(e),e==null?null:(this.m_index=this.m_geometries.getGeometryID(),this.m_spp.execute(e,this.m_minSegmentLengthInDegrees,this.m_maxDeviationInSrTo,this.m_progressTracker))}getGeometryID(){return this.m_index}}export{de as OperatorShapePreservingProject};
|
|
2
|
+
import{G as e}from"./GeometryCursor.js";import{b as t,t as n,p as r,q as i,g as a,G as o,h as s,j as c,a as l}from"./Geometry.js";import{E as u,P as d}from"./Envelope.js";import{Envelope2D as f}from"./Envelope2D.js";import{a as p,S as m,L as h}from"./MultiPathImpl.js";import{n as g,P as _,c as v}from"./Point2D.js";import{T as y}from"./Transformation2D.js";import{O as b,F as x,ag as S,aO as C,J as w,I as T,H as E,K as D,a4 as O,a3 as k,_ as A,ax as ee,aP as te,aw as ne}from"./UnitFactory.js";import{c as j}from"./OperatorClip.js";function M(e){let t=e.getInputSR(),n=e.getOutputSR(),r=!1;do{if(t.equals(n)){r=!1;break}if(!L(t)||!L(n)){r=!1;break}if(t.getCoordinateSystemType()===2){r=!0;break}if(n.getCoordinateSystemType()===2){r=!0;break}let i=e.getGeographicTransformations();if(i!==null&&i.count()>0){r=!0;break}}while(0);return r}class re{m_horizon2;m_sr;m_bInclusive2;m_pannableExtent;m_horizon2Env=new f;m_gcs360;m_gcs180;m_gcs90;m_pannableFactor;m_period;m_gcsTolerance;m_qtIter;m_segIter;constructor(e,t,n,r){this.m_horizon2=e,this.m_sr=t,this.m_bInclusive2=n,this.m_pannableExtent=r.clone(),this.m_segIter=null,this.m_qtIter=null,e===null?(this.m_horizon2Env.setEmpty(),this.m_gcs360=NaN,this.m_gcs180=NaN,this.m_gcs90=NaN,this.m_pannableFactor=NaN,this.m_period=NaN):(e.queryEnvelope(this.m_horizon2Env),this.m_gcs360=r.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_gcsTolerance=t==null?NaN:t.getTolerance(0)}isPointStartInHorizon(e,t){if(!this.m_horizon2)return!0;let n=q(new d(e),this.m_horizon2,!0,this.m_period);do{let t=e.clone();if(t.x-=n*this.m_period,this.m_horizon2.getGeometryType()===o.enumPolygon){let e;if(e=this.m_horizon2Env.contains(t)?D(this.m_horizon2,t,0):0,this.m_bInclusive2){if(e===0)return!1}else if(e===1)return!1}else{let e=this.m_horizon2Env.contains(t);if(this.m_bInclusive2){if(!e)return!1}else if(e)return!1}}while(this.m_horizon2Env.xmin+ ++n*this.m_period<e.x);return!0}isAdjoiningLineInHorizon(e,t,n){if(!this.m_horizon2)return!0;let r=new _,i=new _;Y(e,t,this.m_gcs90,this.m_gcs180,this.m_gcs360,r,i);let s=Math.max(r.x,i.x),c=new h;c.setStart2D(r),c.setEnd2D(i);let l=q(c,this.m_horizon2,!0,this.m_period);do{let e=r.clone(),t=i.clone();if(e.x-=l*this.m_period,t.x-=l*this.m_period,this.m_horizon2.getGeometryType()===o.enumPolygon){let n=new h;n.setStartXY(e),n.setEndXY(t);let r=new f,i=new f;if(n.queryEnvelope(r),i.setCoords({env2D:r}),i.inflateCoords(this.m_gcsTolerance,this.m_gcsTolerance),this.m_horizon2Env.isIntersecting(i)){let e=this.m_horizon2.getImpl(),t=e.getAccelerators();t!==null&&t.getRasterizedGeometry()!==null&&a(0);{let r=null;if(t!==null&&(r=t.getQuadTree()),r!==null){this.m_qtIter||=r.getIteratorForQT(),this.m_qtIter.resetIterator(n,this.m_gcsTolerance),this.m_segIter||=e.querySegmentIterator();for(let e=this.m_qtIter.next();e!==-1;e=this.m_qtIter.next()){let t=r.getElement(e);if(this.m_segIter.resetToVertex(t,-1),this.m_segIter.nextSegment().isIntersecting(n,this.m_gcsTolerance))return!1}}else for(this.m_segIter||=e.querySegmentIterator(),this.m_segIter.resetToFirstPath();this.m_segIter.nextPath();)for(;this.m_segIter.hasNextSegment();){let e=this.m_segIter.nextSegment(),t=new f;if(e.queryEnvelope(t),t.isIntersecting(i)&&e.isIntersecting(n,this.m_gcsTolerance))return!1}}}}else if(this.m_bInclusive2){let n=this.m_horizon2Env.contains(e),r=this.m_horizon2Env.contains(t);if(n&&r)return!0}else{let n=this.m_horizon2Env.clone();if(n.inflateCoords(this.m_gcsTolerance,this.m_gcsTolerance),n.clipLine(e,t)!==0)return!1}}while(this.m_horizon2Env.xmin+ ++l*this.m_period<s);return!this.m_bInclusive2}isEnvelopeInHorizon(e,t){if(!this.m_horizon2)return!0;let n=new u({env2D:e}),r=q(n,this.m_horizon2,!0,this.m_period);do{let i=e.clone();if(i.move(-r*this.m_period,0),n.setCoords(i.xmin,i.ymin,i.xmax,i.ymax),!K(n,this.m_horizon2,this.m_sr,this.m_bInclusive2,t))return!1}while(this.m_horizon2Env.xmin+ ++r*this.m_period<e.xmax);return!0}}class ie{m_splitLines2=null;m_transform1;m_pannableExtent;m_gcs360;m_gcs180;m_gcs90;m_gcsTolerance;m_halfGcsTolerance;m_gcsToleranceSq;m_scalars=[];m_splitIter=null;constructor(e,t,n){this.m_splitLines2=e,this.m_transform1=t,this.m_pannableExtent=n.clone(),this.m_gcs360=n.width(),this.m_gcs180=.5*this.m_gcs360,this.m_gcs90=.25*this.m_gcs360,t===null?(this.m_gcsTolerance=NaN,this.m_halfGcsTolerance=NaN,this.m_gcsToleranceSq=NaN):(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)}hasSplitLines(){return this.m_splitLines2!=null}getSplitLineFactorEx(e,t,n,r,i,a){let o=new _,s=new _;Y(r,i,this.m_gcs90,this.m_gcs180,this.m_gcs360,o,s);let c=new h;for(c.setStartXY(o),c.setEndXY(s),this.m_splitIter?this.m_splitIter.resetToFirstPath():this.m_splitIter=this.m_splitLines2.getImpl().querySegmentIterator();this.m_splitIter.nextPath();)for(;this.m_splitIter.hasNextSegment();){let r=this.m_splitIter.nextSegment(),i=.5*(r.getStartX()+r.getEndX());U(this.m_gcs180,this.m_gcs360,i,c);let o=new f;c.queryEnvelope(o),o.inflateCoords(this.m_gcsTolerance,this.m_gcsTolerance);let s=new f;if(r.queryEnvelope(s),!(!o.isIntersecting(s)||(this.m_scalars.length<2&&(this.m_scalars.length=2),c.intersect(r,null,this.m_scalars,null,this.m_gcsTolerance)!==1))&&this.m_scalars[0]>0&&this.m_scalars[0]<1){let i=$(t,n,this.m_scalars[0]),o=V(e.getCoord2D(i),this.m_transform1);return r.isIntersectingPoint(o,this.m_halfGcsTolerance)?i:this.getSplitLineFactor(e,t,n,r,a)}}return-1}getSplitLineFactor(e,t,n,r,i){let a=t,o=n,s=.5*(r.getStartX()+r.getEndX()),c=new h,l=e.getCoord2D(a),u=e.getCoord2D(o),d=V(l,this.m_transform1),f=V(u,this.m_transform1);for(;a<o;){let t=new _,n=new _;Y(d,f,this.m_gcs90,this.m_gcs180,this.m_gcs360,t,n),c.setStartXY(t),c.setEndXY(n),U(this.m_gcs180,this.m_gcs360,s,c);let i=_.sqrDistance(c.getStartXY(),c.getEndXY());if(i<=this.m_gcsToleranceSq)break;if(Number.isNaN(i))return NaN;let p=$(a,o,this.m_scalars[0]);if(a<p&&p<o||(p=.5*(o+a)),a===p||p===o)return p;let m=e.getCoord2D(p),h=V(m,this.m_transform1),g=new _;Y(d,h,this.m_gcs90,this.m_gcs180,this.m_gcs360,t,g),c.setStartXY(t),c.setEndXY(g),U(this.m_gcs180,this.m_gcs360,s,c);let v=c.intersect(r,null,this.m_scalars,null,this.m_halfGcsTolerance);if(v!==0){if(this.m_scalars[0]===1)return p;o=p,u.setCoordsPoint2D(m),f.setCoordsPoint2D(h)}else{if(Y(h,f,this.m_gcs90,this.m_gcs180,this.m_gcs360,g,n),c.setStartXY(g),c.setEndXY(n),U(this.m_gcs180,this.m_gcs360,s,c),v=c.intersect(r,null,this.m_scalars,null,this.m_halfGcsTolerance),v===0||this.m_scalars[0]===0)return p;a=p,l.setCoordsPoint2D(m),d.setCoordsPoint2D(h)}}return .5*(o+a)}}class N{m_bPrepared=!1;m_bNeedsShapePreservingProject=!1;m_inputTransform=null;m_transform1=null;m_transform2=null;m_extentFrom=null;m_horizon1=null;m_horizon2=null;m_pannableExtentFrom=new f;m_pannableExtentTo=new f;m_pannableExtentGcsTo=new f;m_bClipTopBottomFrom=!1;m_bNeedsGeoTransform=!1;m_bIsPannableFrom=!1;m_bIsPannableTo=!1;m_bInclusive1=!1;m_bInclusive2=!1;m_bSrFromIsPcs=!1;m_bSrToIsPcs=!1;m_fromTolerance=NaN;m_toTolerance=NaN;m_gcsToTolerance=NaN;m_aFrom=NaN;m_mpuFrom=NaN;m_rpuFrom=NaN;m_rpuGcsTo=NaN;m_aTo=NaN;m_mpuTo=NaN;m_stages=0;constructor(){}prepare(e,n,r){this.m_bPrepared&&i(``),e||t(``);let o=e.getInputSR(),s=e.getOutputSR();(!L(o)||!L(s))&&t(`shape preserving project requires PCS or GCS`);let c=o.getCoordinateSystemType(),l=s.getCoordinateSystemType();this.m_bSrFromIsPcs=c===2,this.m_bSrToIsPcs=l===2;let u=null,d=null,f=null,p=null;this.m_bSrFromIsPcs?(u=o,f=o.getGCS(),this.m_aFrom=Q(f),this.m_mpuFrom=Z(u),this.m_rpuFrom=NaN):(f=o,this.m_rpuFrom=X(f),this.m_aFrom=NaN),this.m_bSrToIsPcs?(d=s,p=s.getGCS(),this.m_aTo=Q(p),this.m_mpuTo=Z(d)):(p=s,this.m_aTo=NaN,this.m_mpuTo=NaN),this.m_rpuGcsTo=X(p);let m=e.getGeographicTransformations();this.m_bNeedsGeoTransform=m!==null&&m.count()>0;let h=o.equals(s);if(this.m_bNeedsShapePreservingProject=!h&&(this.m_bSrFromIsPcs||this.m_bSrToIsPcs||this.m_bNeedsGeoTransform),!this.m_bNeedsShapePreservingProject){this.m_inputTransform=e,this.m_extentFrom=n?n.clone():null,this.m_bPrepared=!0;return}if(this.m_bIsPannableFrom=o.isPannable(),this.m_bIsPannableTo=s.isPannable(),this.m_bIsPannableFrom&&(this.m_pannableExtentFrom=o.getPannableExtent()),this.m_bIsPannableTo&&(this.m_pannableExtentTo=s.getPannableExtent()),!this.m_bSrToIsPcs)this.m_pannableExtentGcsTo=this.m_pannableExtentTo.clone();else{this.m_pannableExtentGcsTo=p.getPannableExtent();let e=d.getCentralMeridian(),t=this.m_pannableExtentGcsTo.getCenter();t.x=e,this.m_pannableExtentGcsTo.centerAt(t)}this.m_fromTolerance=o.getTolerance(0),this.m_toTolerance=s.getTolerance(0),this.m_gcsToTolerance=p.getTolerance(0);{let t=e.getExtendedParams(),i=t.clipWithInputHorizon,a=t.clipWithOutputHorizon;i&&this.setHorizon1(e,n,r),a&&this.setHorizon2(e,r),this.checkAndSetStages(e,r)}let g=T();g.setFlag(1073741824,!0),g.setFlag(536870912,!0);let _=E();if(_.clipWithInputHorizon=!1,_.clipWithOutputHorizon=!1,this.m_stages===1)this.m_transform1=x(!1,o,s,m,_,g);else if(this.m_stages===2){g.setFlag(2147483648,!0),this.m_transform1=x(!1,o,p,m,_,g);let e=T();this.m_transform2=x(!1,p,s,null,_,e)}else{a(d!=null),_.centralMeridianOfOutputGCS=d.getCentralMeridian(),this.m_transform1=x(!1,o,p,m,_,g);let e=T();e.setFlag(2147483648,!0),this.m_transform2=x(!1,p,s,null,_,e)}this.m_inputTransform=e,this.m_extentFrom=n?n.clone():null,this.m_bPrepared=!0}execute(e,t,n,r){return this.m_bPrepared||i(``),a(!e.hasAttribute(10)),this.execute_(e,t,n,r)}checkIfNeedsReset(e,t){return a(0),!1}setHorizon1(e,t,n){let r=e.getInputSR(),i=null,a,o=new f;if(this.m_bSrFromIsPcs){a=!0,i=r.getPCSHorizon(),i.queryEnvelope(o),this.m_bIsPannableFrom&&(i=new u({xmin:this.m_pannableExtentFrom.xmin,ymin:o.ymin,xmax:this.m_pannableExtentFrom.xmax,ymax:o.ymax}));let e=!1;t!=null&&(e=ce(t,i,r,a,this.m_bIsPannableFrom,this.m_pannableExtentFrom,n)),e||(this.m_horizon1=i,this.m_bInclusive1=a)}else this.m_bClipTopBottomFrom=!0,this.m_bInclusive1=!0}setHorizon2(e,t){let n=e.getOutputSR();if(n.getCoordinateSystemType()===1){this.m_horizon2=null,this.m_bInclusive2=!1;return}let r=null,i=new f,a=n.getGCSHorisonIsInclusive();r=n.getGCSHorizon(),r.queryEnvelope(i);let o=n.getCentralMeridian();if(this.m_bIsPannableTo){let e=new u({xmin:this.m_pannableExtentGcsTo.xmin,ymin:i.ymin,xmax:this.m_pannableExtentGcsTo.xmax,ymax:i.ymax});e.centerAt(o,0),r=e}this.m_horizon2=r,this.m_bInclusive2=a}checkAndSetStages(e,t){let n=e.getOutputSR().getGCSSplitLines();if(!this.m_horizon2&&!n){this.m_stages=1;return}if(this.m_horizon2.getGeometryType()===o.enumEnvelope){let e=new f;this.m_horizon2.queryEnvelope(e);let t=e.width(),n=e.height();t>=g/this.m_rpuGcsTo&&n>=Math.PI/this.m_rpuGcsTo&&(this.m_horizon2=null)}if(!this.m_horizon2&&!n){this.m_stages=1;return}if(this.m_horizon2!==null&&!this.m_bNeedsGeoTransform&&!this.m_bSrFromIsPcs){let t=e.getOutputSR().getGCS();if(e.getInputSR().equals(t)){this.m_horizon1=this.m_horizon2,this.m_bInclusive1=this.m_bInclusive2,this.m_bClipTopBottomFrom=!1,this.m_horizon2=null,this.m_bInclusive2=!1,this.m_stages=1;return}this.m_stages=2;return}this.m_stages=3}execute_(e,t,i,a){if(!this.m_bNeedsShapePreservingProject)return new b().execute(e,this.m_inputTransform,a);if(!e)return null;n(e),r(e);let l=e.getGeometryType(),u;return s(l)?(u=ae(e),l=o.enumPolyline):u=e,u.isEmpty()?u:c(l)?this.executeEx(e,t,i,a):new b().execute(e,this.m_inputTransform,a)}executeEx(e,t,n,r){e.hasNonLinearSegments()&&l(``);let i;i=this.m_bIsPannableFrom?new b().foldInto360Range(e,this.m_transform1.getInputSR()):e;let a=n;a>0||(a=100*this.m_toTolerance);let o;return o=this.m_stages===1?this.executeGood(i,t,a,r):this.m_stages===2?this.executeBad(i,t,a,r):this.executeUgly(i,t,a,r),this.filterOverDensification(o,this.m_inputTransform.getOutputSR(),a,r)}executeGood(e,t,n,r){let i=n*n,a;a=t>0?this.getMinLengthInSrFrom(t):this.getMinLengthInSrFrom(1e-5);let o;return o=this.m_bClipTopBottomFrom?S(e,this.m_transform1.getInputSR()):W(e,this.m_transform1.getInputSR(),this.m_horizon1,this.m_bInclusive1,this.m_bIsPannableFrom,this.m_pannableExtentFrom,!0,NaN,r),o=C(o,this.m_transform1.getOutputSR(),r),o=R(o,this.m_transform1,this.m_bIsPannableFrom,this.m_pannableExtentFrom,this.m_bIsPannableTo,this.m_pannableExtentTo,null,null,null,null,a,i,r),o=new b().execute(o,this.m_transform1,r),o}executeBad(e,t,n,r){let i;i=t>0?t*(Math.PI/180/this.m_rpuGcsTo):1e-5*(Math.PI/180/this.m_rpuGcsTo);let a=n*n,o;return o=this.m_bClipTopBottomFrom?S(e,this.m_transform1.getInputSR()):e,o=new b().execute(o,this.m_transform1,r),o=W(o,this.m_transform2.getInputSR(),this.m_horizon2,this.m_bInclusive2,!0,this.m_pannableExtentGcsTo,!0,NaN,r),o=C(o,this.m_transform2.getOutputSR(),r),o=R(o,this.m_transform2,!0,this.m_pannableExtentGcsTo,this.m_bIsPannableTo,this.m_pannableExtentTo,null,null,null,null,i,a,r),o=new b().execute(o,this.m_transform2,r),o}executeUgly(e,t,n,r){let i=n*n,a;a=t>0?this.getMinLengthInSrFrom(t):this.getMinLengthInSrFrom(1e-5);let o=null;o=this.m_bClipTopBottomFrom?S(e,this.m_transform1.getInputSR()):W(e,this.m_transform1.getInputSR(),this.m_horizon1,this.m_bInclusive1,this.m_bIsPannableFrom,this.m_pannableExtentFrom,!0,NaN,r);let s=o,c=new re(this.m_horizon2,this.m_transform2.getInputSR(),this.m_bInclusive2,this.m_pannableExtentGcsTo),l=this.m_transform2.getOutputSR().getGCSSplitLines(),u=new ie(l,this.m_transform1,this.m_pannableExtentGcsTo);if(o=R(o,this.m_transform1,this.m_bIsPannableFrom,this.m_pannableExtentFrom,this.m_bIsPannableTo,this.m_pannableExtentTo,this.m_transform2,c,this.m_pannableExtentGcsTo,u,a,i,r),o!==null){s=null,o=new b().execute(o,this.m_transform1,r);let e=2*(Math.PI/180/this.m_rpuGcsTo);return o=W(o,this.m_transform2.getInputSR(),this.m_horizon2,this.m_bInclusive2,!0,this.m_pannableExtentGcsTo,!1,e,r),o=new b().execute(o,this.m_transform2,r),o}let d=NaN;d=n>0?n:100*this.m_toTolerance,d/=this.m_rpuGcsTo*this.m_aTo/this.m_mpuTo;let f=d*d;o=R(s,this.m_transform1,this.m_bIsPannableFrom,this.m_pannableExtentFrom,!0,this.m_pannableExtentGcsTo,null,null,null,null,a,f,r),s=null,o=new b().execute(o,this.m_transform1,r);let p;return p=t>0?t*(Math.PI/180/this.m_rpuGcsTo):1e-5*(Math.PI/180/this.m_rpuGcsTo),o=W(o,this.m_transform2.getInputSR(),this.m_horizon2,this.m_bInclusive2,!0,this.m_pannableExtentGcsTo,!1,NaN,r),o=C(o,this.m_transform2.getOutputSR(),r),o=R(o,this.m_transform2,!0,this.m_pannableExtentGcsTo,this.m_bIsPannableTo,this.m_pannableExtentTo,null,null,null,null,p,i,r),o=new b().execute(o,this.m_transform2,r),o}getMinLengthInSrFrom(e){let t;return t=this.m_bSrFromIsPcs?this.m_aFrom*(e*Math.PI/180)/this.m_mpuFrom:e*Math.PI/180*(1/this.m_rpuFrom),t}filterOverDensification(e,t,n,r){let i=P(e,n);return i.dropAttribute(10),i!==e&&i.getGeometryType()===o.enumPolygon&&(i=new w().execute(i,t,!1,r)),i}}function P(e,t){if(e.isEmpty()||!e.hasAttribute(10))return e;let n=t*t,r=e.getAttributeStreamRef(10),i=!1,a=new h,o=[],s=!1;for(let t=0,c=e.getPathCount();t<c;t++){let c=e.getPathStart(t),l=e.getPathEnd(t),u=e.isClosedPath(t);if(l>c){let e=u?c:l-1;(r.read(c)!==0||r.read(e)!==0)&&(i||=(r=r.clone(),!0),r.write(c,0),r.write(e,0))}else continue;let d=u?l+1:l,f=c;for(let t=c;t<d;t++){let u=t===l?c:t;if(r.read(u)===0){if(t-f>1){o.push({from:f,to:t});let u=new _;for(;o.length>0;){let t=o.at(-1);o.pop(),a.setStartXY(e.getXY(t.from));let d=t.to===l?c:t.to;a.setEndXY(e.getXY(d));let f=n,p=-1;for(let n=t.from+1,r=t.to;n<r;n++){let t=e.getXY(n),r=a.getClosestCoordinate(t,!1);a.queryCoord2D(r,u);let i=_.sqrDistance(u,t);f<i&&(f=i,p=n)}p>=0?(i||=(r=r.clone(),!0),r.write(p,0),p-t.from>1&&o.push({from:t.from,to:p}),t.to-p>1&&o.push({from:p,to:t.to})):s=!0}}f=u}}}if(!s)return e;let c=F(e,r,1);return c.dropAttribute(10),c}function F(e,t,n){let r=e.createInstance(),i=new d;for(let a=0,o=e.getPathCount();a<o;a++){let o=!0,s=0,c=0,l=e.getPathStart(a),u=e.getPathEnd(a),d=!0;for(let f=l;f<u;f++)t.read(f)===n?(!d&&c>0&&(r.addSegmentsFromPath(e,a,s-l,c,o),c=0),d=!0):d?(d=!1,e.getPointByVal(f,i),o?(r.startPathPoint(i),o=!1):r.lineToPoint(i),s=f):c++;c>0&&r.addSegmentsFromPath(e,a,s-l,c,o)}return r}function I(e,t){for(let n=0;n<e;n++){let r=Math.ceil(n/2)/(e+1);n%2!=0&&(r=-r);let i=.5+r;t[n]=i}}function L(e){if(!e)return!1;let t=e.getCoordinateSystemType();return t===2||t===1}function R(e,t,n,r,i,a,o,s,c,l,u,d,f){let p=e.createInstance();p.addAttribute(10);let h=e.querySegmentIterator(),g=[],_=[],v=new m,y=e.getDescription().getAttributeCount()>1,b=new ue(t,n,r,i,a,o,s,l,u,d,y?_:null,g,f);for(;h.nextPath();)for(;h.hasNextSegment();){let e=h.nextSegment(),t=e.getStartXY(),n=e.getEndXY(),r=t.compare(n)>0,i=H(r,e,v);if(g.length=0,_.length=0,!b.densifySegment(h.isFirstSegmentInPath(),i))return null;r&&se(y?_:null,g),g.at(-1).setCoordsPoint2D(e.getEndXY());let a=p.getPointCount();if(!y)z(h.isFirstSegmentInPath(),h.isLastSegmentInPath()&&!h.isPathClosed(),g,p);else{let t=H(r,e,v);B(h.isFirstSegmentInPath(),h.isLastSegmentInPath()&&!h.isPathClosed(),e,t,_,g,p)}if(b.needsPostFiltering()){p.addAttribute(10);let e=p.getAttributeStreamRef(10);for(let t=1,n=g.length-1;t<n;t++)e.write(t+a,1)}}return p}function z(e,t,n,r){e&&r.insertPath2D(-1,null,0,0,!0);let i=r.getPathCount()-1;t?r.insertPointsFromPoints(i,-1,n,0,n.length,!0):r.insertPointsFromPoints(i,-1,n,0,n.length-1,!0)}function B(e,t,n,r,i,a,o){o.reserve(o.getPointCount()+a.length-1);let s=new d;if(n.queryStart(s),e?o.startPathPoint(s):o.lineToPoint(s),a.length>2){let e=r.calculateLength2D();for(let t=1;t<a.length-1;t++){let n=r.lengthToT(i[t]*e);r.queryCoord(n,s),s.setXY(a[t]),o.lineToPoint(s)}}t&&(n.queryEnd(s),o.lineToPoint(s))}function ae(e){let t=new p({vd:e.getDescription()});return t.addSegment(e,!0),t}function V(e,t){let n=t.getInputSR(),r=t.getOutputSR(),i=new _;n.getCoordinateSystemType()===2?(i.setCoordsPoint2D(e),ee(n,0,[i],1)):i.setCoordsPoint2D(e);let a=new _;a.setCoordsPoint2D(i),te(t,[a],null,1,!1);let o=new _;return r.getCoordinateSystemType()===2?(o.setCoordsPoint2D(a),ne(r,[o],1,!1)):o.setCoordsPoint2D(a),o}function oe(e,t,n,r,i,a,o,s){if(i){let i=a.width(),c=.5*i;if(r){let r=.25*i,a=!1,l=new _,u=new _;if(Math.abs(e.y)===r?(l.setCoords(n.x,e.y),u.setCoordsPoint2D(n),a=!0):Math.abs(n.y)===r&&(u.setCoords(e.x,n.y),l.setCoordsPoint2D(e),a=!0),Math.abs(t.y)===r&&(a||=(l.setCoordsPoint2D(e),u.setCoordsPoint2D(n),!0),l.x=t.x),a)return J(t,l,c,i,o),J(t,u,c,i,s),!0}let l=0;e.x-t.x>c&&n.x-t.x>c?l-=i:t.x-e.x>c&&t.x-n.x>c&&(l+=i),Math.abs(t.x-(e.x+l))<c?(o.setCoordsPoint2D(e),J(o,n,c,i,s),o.x+=l,s.x+=l):(o.setCoordsPoint2D(n),J(o,e,c,i,s),o.x+=l,s.x+=l)}else o.setCoordsPoint2D(e),s.setCoordsPoint2D(n);return!1}function H(e,t,n){return e?(n.create(t.getGeometryType()),t.copyTo(n.get()),n.get().reverse(),n.get()):t}function se(e,t){t.reverse(),e!==null&&e.reverse()}function U(e,t,n,r){let i=.5*(r.getStartX()+r.getEndX());if(i-n>e){let e=new y;e.setShiftCoords(-t,0),r.applyTransformation(e)}else if(n-i>e){let e=new y;e.setShiftCoords(t,0),r.applyTransformation(e)}}function W(e,t,n,r,i,a,o,s,c){let l=[!1];o&&G(e,t,n,r,i,a,!0,s,l,c);let u=e;return l[0]||(u=G(u,t,n,r,i,a,!1,s,null,c)),u=le(u,i,a,u!==e),u}function G(e,t,n,r,i,a,s,c,l,u){if(s&&(l[0]=!1),n==null)return e;let d=new f,p=new f;n.queryEnvelope(d),e.queryEnvelope(p);let m=e.getGeometryType(),h=n.getGeometryType(),g=t.getTolerance(0);if(!i){if(s)return l[0]=K(e,n,t,r,u),null;let i;return i=r?h===o.enumEnvelope?j(e,d,g,c,u):new O().execute(e,n,t,u):new k().execute(e,n,t,u),i===n&&(i=n.clone()),i}let _=a.width(),v=_*Math.ceil(d.width()/_),b=null;if(r){let a=q(e,n,i,v),x=0,S=new y;do{let i=null;if(h===o.enumEnvelope){let o=n.clone();if(S.setShiftCoords(a*v,0),o.applyTransformation(S),s){if(l[0]=K(e,o,t,r,u),!l[0])return null}else{let t=new f;o.queryEnvelope(t),i=j(e,t,g,c,u)}}else{let o=e.clone();if(S.setShiftCoords(-a*v,0),o.applyTransformation(S),s){if(l[0]=K(o,n,t,r,u),!l[0])return null}else i=new O().execute(o,n,t,u),i===n&&(i=n.clone())}if(!s){if(i.isEmpty())continue;if(m===o.enumPolygon){let e=new f;if(i.queryEnvelope(e),e.width()<=g)continue}h===o.enumEnvelope&&(S.setShiftCoords(-a*v,0),i===e&&(i=i.clone()),i.applyTransformation(S)),b===null?b=i===e?i.clone():i:b.add(i,!1)}x++}while(d.xmin+ ++a*v<p.xmax);if(s)return null;b===null&&(b=e.createInstance()),m===o.enumPolygon&&x>1&&_-p.width()<=10*g&&(b=new w().execute(b,t,!0,u))}else{let a=q(e,n,i,v);if(b=e.clone(),a!==0){let e=new y;e.setShiftCoords(-a*v,0),b.applyTransformation(e)}do{if(s){if(l[0]=K(b,n,t,r,u),!l[0])return null}else if(b=new k().execute(b,n,t,u),b===n&&(b=n.clone()),b.isEmpty())break;let e=new y;e.setShiftCoords(-v,0),b.applyTransformation(e)}while(d.xmin+ ++a*v<p.xmax);if(s)return null;if(!b.isEmpty()&&a!==0){let e=new y;e.setShiftCoords(a*v,0),b.applyTransformation(e)}}return b}function ce(e,t,n,r,i,a,o){let s=[!1];return G(e,n,t,r,i,a,!0,NaN,s,o),s[0]}function K(e,t,n,r,i){let a;if(t.getGeometryType()===o.enumPolygon)a=r?A(t,e,n,64,i):A(t,e,n,4,i);else if(r){let n=new f,r=new f;t.queryEnvelope(n),e.queryEnvelope(r),a=n.containsEnvelope(r)}else a=A(t,e,n,4,i);return a}function le(e,t,n,r){let i;if(!t)return e;let a=n.getCenter().x,o=n.width(),s=.5*o,c=new f;e.queryEnvelope(c);let l=c.getCenter().x,u=0;if(l-a>s?u=-Math.ceil((l-a-s)/o)*o:a-l>s&&(u=Math.ceil((a-l-s)/o)*o),u!==0){i=r?e:e.clone();let t=new y;t.setShiftCoords(u,0),i.applyTransformation(t)}else i=e;return i}function q(e,t,n,r){if(!n)return 0;let i=0,a=new f;t.queryEnvelope(a);let o=new f;e.queryEnvelope(o);let s=a.xmin+r;for(;s+r+i*r>o.xmin;)i--;for(;s+i*r<o.xmin;)i++;return i}function J(e,t,n,r,i){t.x-e.x>n?i.setCoords(t.x-r,t.y):e.x-t.x>n?i.setCoords(t.x+r,t.y):i.setCoordsPoint2D(t)}function Y(e,t,n,r,i,a,o){Math.abs(e.y)===n?(a.setCoords(t.x,e.y),o.setCoordsPoint2D(t)):Math.abs(t.y)===n?(a.setCoordsPoint2D(e),o.setCoords(e.x,t.y)):(a.setCoordsPoint2D(e),J(a,t,r,i,o))}function X(e){return e.getUnit().getUnitToBaseFactor()}function Z(e){return e.getUnit().getUnitToBaseFactor()}function Q(e){return e.getPECoordSys().getDatum().getSpheroid().getAxis()}function $(e,t,n){return n<=.5?e+(t-e)*n:t-(t-e)*(1-n)}class ue{leftFromDensifiedPoint=new _;rightFromDensifiedPoint=new _;cutFromDensifiedPoint=new _;midFromDensifiedPoint=new _;leftToDensifiedPoint=new _;rightToDensifiedPoint=new _;cutToDensifiedPoint=new _;midToDensifiedPoint=new _;line=new h;leftGcsToDensifiedPoint=new _;rightGcsToDensifiedPoint=new _;cutGcsToDensifiedPoint=new _;midGcsToDensifiedPoint=new _;bSrToIsGcs=!1;bIsCurve=!1;leftFactor=0;rightFactor=0;bIsFirstInPath=!1;rectifiedSegment=null;transform=null;bIsPannableFrom=!1;pannableExtentFrom=new f;bIsPannableTo=!1;bNeedPostFiltering=!1;pannableExtentTo=new f;transform2=null;pHorizon2Info=null;pSplitLines2Info=null;minLengthInSrFrom=0;maxDeviationInSrToSq=0;cutFactor=0;midFactor=0;pDensifiedFactors=null;pDensifiedPoints=[];progressTracker;rightFromDensifiedPointsStack=[];rightToDensifiedPointsStack=[];rightGcsToDensifiedPointsStack=[];rightFactorsStack=[];projCurveSegment=new m;n=0;bCheckIfNoDensificationNeededForCurve=!1;scalars=v(7,NaN);checkSegment(){for(let e=0;e<this.n;e++){if(this.pSplitLines2Info!==null&&this.pSplitLines2Info.hasSplitLines()&&!this.bCheckIfNoDensificationNeededForCurve){let e=this.pSplitLines2Info.getSplitLineFactorEx(this.rectifiedSegment,this.leftFactor,this.rightFactor,this.leftGcsToDensifiedPoint,this.rightGcsToDensifiedPoint,this.progressTracker);if(Number.isNaN(e))return-1;if(e!==-1&&this.leftFactor<e&&e<this.rightFactor)return this.cutFactor=e,this.cutFromDensifiedPoint.assign(this.rectifiedSegment.getCoord2D(this.cutFactor)),this.cutToDensifiedPoint.assign(V(this.cutFromDensifiedPoint,this.transform)),this.cutGcsToDensifiedPoint.setCoordsPoint2D(this.cutToDensifiedPoint),this.cutToDensifiedPoint.assign(V(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=$(this.leftFactor,this.rightFactor,this.scalars[e]),this.cutFromDensifiedPoint.assign(this.rectifiedSegment.getCoord2D(this.cutFactor)),this.cutToDensifiedPoint.assign(V(this.cutFromDensifiedPoint,this.transform)),this.transform2!==null&&(this.cutGcsToDensifiedPoint.setCoordsPoint2D(this.cutToDensifiedPoint),this.cutToDensifiedPoint.assign(V(this.cutGcsToDensifiedPoint,this.transform2))),e===0&&(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 t;if(this.bCheckIfNoDensificationNeededForCurve){let e=this.projCurveSegment.get().getClosestCoordinate(this.cutToDensifiedPoint,!1),n=this.projCurveSegment.get().getCoord2D(e);t=_.sqrDistance(this.cutToDensifiedPoint,n)}else{let n=new _,r=new _,i=oe(this.leftToDensifiedPoint,this.cutToDensifiedPoint,this.rightToDensifiedPoint,this.bSrToIsGcs,this.bIsPannableTo,this.pannableExtentTo,n,r);this.line.setStartXY(n),this.line.setEndXY(r);let a=this.line.getClosestCoordinate(this.cutToDensifiedPoint,!0);if(i||e>0||Math.abs(a-this.scalars[e])<.3){let e=this.line.getCoord2D(a);t=_.sqrDistance(this.cutToDensifiedPoint,e)}else t=this.maxDeviationInSrToSq*2,this.bNeedPostFiltering=!0}if(t>this.maxDeviationInSrToSq)return this.bCheckIfNoDensificationNeededForCurve=!1,1}return 0}constructor(e,t,n,r,i,a,o,s,c,l,u,d,f){this.progressTracker=f,this.transform=e,this.bIsPannableFrom=t,this.pannableExtentFrom.assign(n),this.bIsPannableTo=r,this.pannableExtentTo.assign(i),this.transform2=a,this.pHorizon2Info=o,this.pSplitLines2Info=s,this.minLengthInSrFrom=c,this.maxDeviationInSrToSq=l,this.pDensifiedFactors=u,this.pDensifiedPoints=d,this.progressTracker=f,this.bNeedPostFiltering=!1}needsPostFiltering(){return this.bNeedPostFiltering}densifySegment(e,t){if(this.bIsFirstInPath=e,this.rectifiedSegment=t,this.leftGcsToDensifiedPoint.setNAN(),this.rightGcsToDensifiedPoint.setNAN(),this.cutGcsToDensifiedPoint.setNAN(),this.midGcsToDensifiedPoint.setNAN(),this.bSrToIsGcs=this.transform2==null?this.transform.getOutputSR().getCoordinateSystemType()===1:this.transform2.getOutputSR().getCoordinateSystemType()===1,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(V(this.leftFromDensifiedPoint,this.transform)),this.rightToDensifiedPoint.assign(V(this.rightFromDensifiedPoint,this.transform)),this.transform2!==null&&(this.leftGcsToDensifiedPoint.setCoordsPoint2D(this.leftToDensifiedPoint),this.rightGcsToDensifiedPoint.setCoordsPoint2D(this.rightToDensifiedPoint),this.leftToDensifiedPoint.assign(V(this.leftGcsToDensifiedPoint,this.transform2)),this.rightToDensifiedPoint.assign(V(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),this.transform2!=null&&this.rightGcsToDensifiedPointsStack.push(this.rightGcsToDensifiedPoint.clone()),this.pDensifiedPoints!==null&&this.pDensifiedPoints.push(this.leftFromDensifiedPoint.clone()),this.pDensifiedFactors!==null&&this.pDensifiedFactors.push(this.leftFactor),this.n=this.bIsCurve?this.rectifiedSegment.getGeometryType()===o.enumBezier?7:5:3,I(this.n,this.scalars);let n=this.rectifiedSegment.calculateLength2D();if(this.bCheckIfNoDensificationNeededForCurve=!1,this.bIsCurve){let e=new p({vd:this.rectifiedSegment.getDescription()}),t=new b().execute(e,this.transform,this.progressTracker);if(this.transform2!==null){let e=new f;if(t.queryEnvelope(e),!this.pHorizon2Info.isEnvelopeInHorizon(e,this.progressTracker))return!1;t=new b().execute(t,this.transform2,this.progressTracker)}t.getSegmentBuffer(0,this.projCurveSegment,!1),this.bCheckIfNoDensificationNeededForCurve=!0}for(;this.rightFromDensifiedPointsStack.length>0;){let e=!1;if(this.cutFactor=NaN,this.midFactor=NaN,this.midFromDensifiedPoint.setNAN(),this.midToDensifiedPoint.setNAN(),(this.rightFactor-this.leftFactor)*n>this.minLengthInSrFrom){let t=this.checkSegment();if(t===-1)return!1;e=t!==0}if(e)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),this.transform2!==null&&(this.rightGcsToDensifiedPoint.setCoordsPoint2D(this.midGcsToDensifiedPoint),this.rightGcsToDensifiedPointsStack.push(this.rightGcsToDensifiedPoint.clone()));else{if(this.transform2!==null&&!this.pHorizon2Info.isAdjoiningLineInHorizon(this.leftGcsToDensifiedPoint,this.rightGcsToDensifiedPoint,this.progressTracker))return!1;if(this.rightFromDensifiedPointsStack.pop(),this.rightToDensifiedPointsStack.pop(),this.rightFactorsStack.pop(),this.transform2!==null&&this.rightGcsToDensifiedPointsStack.pop(),this.pDensifiedPoints!==null&&this.pDensifiedPoints.push(this.rightFromDensifiedPoint.clone()),this.pDensifiedFactors!==null&&this.pDensifiedFactors.push(this.rightFactor),this.rightFromDensifiedPointsStack.length>0){this.leftFromDensifiedPoint.setCoordsPoint2D(this.rightFromDensifiedPoint),this.leftToDensifiedPoint.setCoordsPoint2D(this.rightToDensifiedPoint),this.leftFactor=this.rightFactor;let e=this.rightFromDensifiedPointsStack.at(-1),t=this.rightToDensifiedPointsStack.at(-1);if(this.rightFromDensifiedPoint.setCoordsPoint2D(e),this.rightToDensifiedPoint.setCoordsPoint2D(t),this.rightFactor=this.rightFactorsStack.at(-1),this.transform2!==null){this.leftGcsToDensifiedPoint.setCoordsPoint2D(this.rightGcsToDensifiedPoint);let e=this.rightGcsToDensifiedPointsStack.at(-1);this.rightGcsToDensifiedPoint.setCoordsPoint2D(e)}}}}return!0}}class de{getOperatorType(){return 10315}supportsCurves(){return!1}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}executeMany(e,t,n,r,i,a){return M(n)?new fe(e,t,n,r,i,a):new b().executeMany(e,n,a)}execute(e,t,n,r,i){if(!M(t))return new b().execute(e,t,i);let a=new N;return a.prepare(t,null,i),a.execute(e,n,r,i)}}class fe extends e{m_geometries;m_geometriesExtent;m_transform;m_spp=null;m_minSegmentLengthInDegrees;m_maxDeviationInSrTo;m_progressTracker;m_index=-1;constructor(e,n,r,i,a,o){super(),e||t(``),this.m_progressTracker=o,this.m_geometries=e,this.m_geometriesExtent=n?n.clone():null,this.m_transform=r,this.m_minSegmentLengthInDegrees=i,this.m_maxDeviationInSrTo=a}tock(){return!0}getRank(){return 1}next(){this.m_spp||(this.m_spp=new N,this.m_spp.prepare(this.m_transform,this.m_geometriesExtent,this.m_progressTracker));let e=this.m_geometries.next();return n(e),r(e),e==null?null:(this.m_index=this.m_geometries.getGeometryID(),this.m_spp.execute(e,this.m_minSegmentLengthInDegrees,this.m_maxDeviationInSrTo,this.m_progressTracker))}getGeometryID(){return this.m_index}}export{de as OperatorShapePreservingProject};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{G as e}from"./GeometryCursor.js";import{d as t,
|
|
2
|
+
import{G as e}from"./GeometryCursor.js";import{d as t,b as n,t as r}from"./Geometry.js";import{S as i}from"./SimpleGeometryCursor.js";import{X as a,Y as o}from"./UnitFactory.js";class s{getOperatorType(){return 10104}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}isSimple(e,t,n,r,i){return a(e,t,n,r,i)===5}executeMany(e,t,n,r){return new c(e,t,n,r)}execute(e,n,r,a){let o=new i([e]),s=this.executeMany(o,n,r,a).next();return s||t(`null output`),s}}class c extends e{m_inputGeometryCursor;m_spatialReference;m_progressTracker;m_index;m_bForceSimplify;constructor(e,t,r,i){super(),e||n(``),this.m_progressTracker=i,this.m_bForceSimplify=r,this.m_index=-1,this.m_inputGeometryCursor=e,this.m_spatialReference=t}next(){let e=this.m_inputGeometryCursor.next();return e?(r(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){return e||n(``),o(e,this.m_spatialReference,this.m_bForceSimplify,this.m_progressTracker)}}export{s as O};
|
package/chunks/Path.glsl.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{Offset as e}from"../views/3d/webgl-engine/core/shaderLibrary/Offset.glsl.js";import{isColor as t}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{sliceDraw as n}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{Transform as r}from"../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js";import{PathVertexPosition as i}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import{outputDepth as a}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl.js";import{OutputHighlight as o}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js";import{EvaluateAmbientOcclusion as s}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import{EvaluateSceneLighting as c,addAmbientBoostFactor as l,
|
|
2
|
+
import{Offset as e}from"../views/3d/webgl-engine/core/shaderLibrary/Offset.glsl.js";import{isColor as t}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{sliceDraw as n}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{Transform as r}from"../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js";import{PathVertexPosition as i}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import{outputDepth as a}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl.js";import{OutputHighlight as o}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js";import{EvaluateAmbientOcclusion as s}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import{EvaluateSceneLighting as c,addAmbientBoostFactor as l,lightingGlobalFactor as u}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import{mainLightIntensity as d}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import{Normals as f}from"../views/3d/webgl-engine/core/shaderLibrary/shading/Normals.glsl.js";import{NormalUtils as p}from"../views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl.js";import{PhysicallyBasedRenderingParameters as m}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{readShadowDraw as h}from"../views/3d/webgl-engine/core/shaderLibrary/shading/readShadow.glsl.js";import{viewNormal as g,nearFar as _}from"../views/3d/webgl-engine/core/shaderLibrary/util/cameraUniforms.js";import{ColorConversion as v}from"../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl.js";import{addProjViewLocalOrigin as y,addCameraPosition as b}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float3PassUniform as x}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{FloatPassUniform as S}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as C,If as w}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{SnowCover as T}from"../views/3d/webgl-engine/effects/snowcover/SnowCover.glsl.js";import{outputColorHighlightOLID as E}from"../views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js";import{ShaderBuilder as D}from"../views/webgl/ShaderBuilder.js";function O(O){let k=new D,{vertex:A,fragment:j,varyings:M}=k;y(A,O),M.add(`vpos`,`vec3`,{invariant:!0}),k.include(i,O);let{output:N,pbrMode:P,snowCover:F,offsetBackfaces:I}=O,L=t(N),R=N===11;switch((L||R)&&(R?(k.varyings.add(`objectAndLayerIdColorVarying`,`vec4`),k.vertex.code.add(C`void forwardObjectAndLayerIdColor() {
|
|
3
3
|
objectAndLayerIdColorVarying = getOlidColor();
|
|
4
4
|
}`),k.fragment.code.add(C`void outputObjectAndLayerIdColor() {
|
|
5
5
|
fragColor = objectAndLayerIdColorVarying;
|
|
@@ -13,7 +13,7 @@ fragColor = objectAndLayerIdColorVarying;
|
|
|
13
13
|
forwardObjectAndLayerIdColor();
|
|
14
14
|
vcolor = getColor();
|
|
15
15
|
forwardLinearDepthToReadShadow();
|
|
16
|
-
`)),N){case 0:case 1:case 2:k.include(m,O),j.include(c,O),j.include(s,O),k.include(f,O),j.include(p,O),j.include(n,O),k.include(E,O),b(j,O),l(j),u
|
|
16
|
+
`)),N){case 0:case 1:case 2:k.include(m,O),j.include(c,O),j.include(s,O),k.include(f,O),j.include(p,O),j.include(n,O),k.include(E,O),b(j,O),l(j),j.uniforms.add(u),j.uniforms.add(A.uniforms.get(`localOrigin`),new x(`ambient`,e=>e.ambient),new x(`diffuse`,e=>e.diffuse),new S(`opacity`,e=>e.opacity)),j.include(v),j.include(T,O),j.uniforms.add(d).main.add(C`
|
|
17
17
|
discardBySlice(vpos);
|
|
18
18
|
|
|
19
19
|
vec3 viewDirection = normalize(vpos - cameraPosition);
|
package/chunks/Point2D.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{t as e,g as t,r as n,a as r}from"./Geometry.js";class i{constructor(e){this.sum=e,this.compensation=0}assign(e){return this.compensation=e.compensation,this.sum=e.sum,this}reset(){this.sum=this.compensation=0}resetToStart(e){this.sum=e,this.compensation=0}normalize(){let e=[NaN];this.sum=P(this.sum,this.compensation,e),this.compensation=e[0]}add(e){let t=this.sum+e,n;if(Math.abs(this.sum)>=Math.abs(e)){let r=this.sum-t+e;n=this.compensation+r}else{let r=e-t+this.sum;n=this.compensation+r}this.sum=t,this.compensation=n}sub(e){this.add(-e)}addProduct(e,t){let n=[0],r=N(e,t,n);this.add(r),this.add(n[0])}mul(e){let t=new i(0);t.addProduct(this.sum,e),t.addProduct(this.compensation,e),this.assign(t)}getResult(){return this.sum+this.compensation}pe(e){return this.add(e),this}me(e){return this.add(-e),this}sum;compensation}const a=[5,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1],o=[-1,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3];function s(e){let t=0;return e&65535n||(t+=16,e>>=16n),e&255n||(t+=8,e>>=8n),e&15n||(t+=4,e>>=4n),t+a[Number(BigInt.asUintN(4,e))]}function c(e){let t=0;return e&4294901760n&&(t+=16,e>>=16n),e&65280n&&(t+=8,e>>=8n),e&240n&&(t+=4,e>>=4n),t+o[Number(BigInt.asUintN(4,e))]+1}function l(e){let t=0;return e&4294967295n||(t=32,e>>=32n),t+s(BigInt.asUintN(32,e))}function u(e){let t=0;return e&18446744069414584320n&&(t=32,e>>=32n),t+c(e)}class d{m_EnvelopeType=1;vmin;vmax;constructor(e,t){if(e===void 0){this.setEmpty();return}if(e instanceof d){this.vmin=e.vmin,this.vmax=e.vmax;return}this.vmin=e,this.vmax=t,this.normalize()}static construct(e,t){return new d(e,t)}static constructEmpty(){return new d}setCoords(e,t){this.vmin=e,this.vmax=t,this.normalize()}setCoordsFromEnvelope(e){this.vmin=e.vmin,this.vmax=e.vmax}setEmpty(){this.vmin=NaN,this.vmax=NaN}getCenter(){return .5*(this.vmin+this.vmax)}equalsRange(e,t){return U(this.vmin,e)&&U(this.vmax,t)}equals(e,t){return this.isEmpty()&&e.isEmpty()?!0:t===void 0?this.vmin===e.vmin&&this.vmax===e.vmax:Math.abs(this.vmin-e.vmin)<=t&&Math.abs(this.vmax-e.vmax)<=t}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=-1/0,this.vmax=1/0}move(e){this.isEmpty()||(this.vmin+=e,this.vmax+=e)}contains(e){return e.vmin>=this.vmin&&e.vmax<=this.vmax}containsCoordinate(e){return e>=this.vmin&&e<=this.vmax}containsRightExclusive(e){return e>=this.vmin&&e<this.vmax}containsExclusiveCoordinate(e){return e>this.vmin&&e<this.vmax}containsExclusive(e){return e.vmin>this.vmin&&e.vmax<this.vmax}isIntersecting(e){return this.vmin<=e.vmin?this.vmax>=e.vmin:e.vmax>=this.vmin}mergeCoordinate(e){if(this.isEmpty()){this.vmin=e,this.vmax=e;return}this.mergeNeCoordinate(e)}merge(e){if(e.isEmpty())return;let t=e.vmin,n=e.vmax;this.mergeCoordinate(t),this.mergeCoordinate(n)}mergeNe(e){let t=e.vmin,n=e.vmax;this.mergeNeCoordinate(t),this.mergeNeCoordinate(n)}mergeNeCoordinate(e){e<this.vmin?this.vmin=e:e>this.vmax&&(this.vmax=e)}intersect(e){if(this.isEmpty()||e.isEmpty()){this.setEmpty();return}this.vmin<e.vmin&&(this.vmin=e.vmin),this.vmax>e.vmax&&(this.vmax=e.vmax),this.vmin>this.vmax&&this.setEmpty()}inflate(e){this.isEmpty()||(this.vmin-=e,this.vmax+=e,this.vmax<this.vmin&&this.setEmpty())}normalize(){this.vmin<=this.vmax||(this.vmin>this.vmax?this.vmax=L(this.vmin,this.vmin=this.vmax):this.setEmpty())}isValid(){return this.isEmpty()||this.vmin<=this.vmax}snapClip(e){return Rt(e,this.vmin,this.vmax)}calculateToleranceFromEnvelope(){return this.isEmpty()?Y():(Math.abs(this.vmin)+Math.abs(this.vmax)+1)*Y()}static unit(){return f}normalizeNoNAN(){this.vmin>this.vmax&&(this.vmax=L(this.vmin,this.vmin=this.vmax))}setCoordsNoNAN(e,t){this.vmin=e,this.vmax=t,this.normalizeNoNAN()}clone(){return new d(this.vmin,this.vmax)}}const f=new d(0,1);class p{m_value;m_eps;static getNAN(){return new p(NaN)}constructor(e,t){this.m_value=e??0,this.m_eps=t??0}[Symbol.toPrimitive](e){return this}clone(){return new p(this.m_value,this.m_eps)}assign(e){return this.m_value=e.m_value,this.m_eps=e.m_eps,this}scaleError(e){this.m_eps*=e}setError(e){this.m_eps=e}set(e,t){return this.m_value=e,this.m_eps=t??0,this}setWithEps(e,t){return t===void 0&&(t=1),this.m_value=e,this.m_eps=p.ulp(e)*t,this}setE(e){return this.m_value=e.m_value,this.m_eps=e.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(e){return this.clone().addThis(e)}addE(e){return this.clone().addThisE(e)}addThisE(e){let t=this.m_value+e.m_value,n=this.m_eps+e.m_eps+p.ulp(t);return this.m_value=t,this.m_eps=n,this}addThis(e){let t=this.m_value+e,n=this.m_eps+p.ulp(t);return this.m_value=t,this.m_eps=n,this}subE(e){return this.clone().subThisE(e)}sub(e){return this.clone().subThis(e)}subThisE(e){let t=this.m_value-e.m_value,n=this.m_eps+e.m_eps+p.ulp(t);return this.m_value=t,this.m_eps=n,this}subThis(e){let t=this.m_value-e,n=this.m_eps+p.ulp(t);return this.m_value=t,this.m_eps=n,this}setAddE(e,t){return this.m_value=e.m_value+t.m_value,this.m_eps=e.m_eps+t.m_eps+p.ulp(this.m_value),this}setAdd(e,t){return this.m_value=e+t,this.m_eps=p.ulp(this.m_value),this}setAddEN(e,t){return this.m_value=e.m_value+t,this.m_eps=e.m_eps+p.ulp(this.m_value),this}setAddNE(e,t){return this.m_value=e+t.m_value,this.m_eps=t.m_eps+p.ulp(this.m_value),this}setSubE(e,t){return this.m_value=e.m_value-t.m_value,this.m_eps=e.m_eps+t.m_eps+p.ulp(this.m_value),this}setSub(e,t){return this.m_value=e-t,this.m_eps=p.ulp(this.m_value),this}setSubEN(e,t){return this.m_value=e.m_value-t,this.m_eps=e.m_eps+p.ulp(this.m_value),this}setSubNE(e,t){return this.m_value=e-t.m_value,this.m_eps=t.m_eps+p.ulp(this.m_value),this}mulThisE(e){let t=this.m_value*e.m_value;return this.m_eps=this.m_eps*Math.abs(e.m_value)+e.m_eps*Math.abs(this.m_value)+this.m_eps*e.m_eps+p.ulp(t),this.m_value=t,this}mulThis(e){let t=this.m_value*e;return this.m_eps=this.m_eps*Math.abs(e)+p.ulp(t),this.m_value=t,this}mul(e){return this.clone().mulThis(e)}mulE(e){return this.clone().mulThisE(e)}setMulE(e,t){let n=e.m_value*t.m_value;return this.m_eps=e.m_eps*Math.abs(t.m_value)+t.m_eps*Math.abs(e.m_value)+e.m_eps*t.m_eps+p.ulp(n),this.m_value=n,this}setMul(e,t){return this.m_value=e*t,this.m_eps=p.ulp(this.m_value),this}setMulEN(e,t){return this.setE(e),this.mulThis(t)}setMulNE(e,t){return this.setE(t),this.mulThis(e)}mulThisByPower2(e){return this.m_value*=e,this.m_eps*=Math.abs(e),this}static st_mulByPower2(e,t){return new p(e.m_value,e.m_eps).mulThisByPower2(t)}divE(e){return this.clone().divThisE(e)}divThisE(e){let t=Math.abs(e.m_value),n=this.m_value/e.m_value,r=(this.m_eps+Math.abs(n)*e.m_eps)/t;if(e.m_eps>.01*t){let n=e.m_eps/t;r*=1+(1+n)*n}return this.m_value=n,this.m_eps=r+p.ulp(n),this}divThis(e){let t=Math.abs(e);return this.m_value/=e,this.m_eps=this.m_eps/t+p.ulp(this.m_value),this}setDivE(e,t){return this.setE(e),this.divThisE(t)}setDiv(e,t){return this.m_value=e/t,this.m_eps=p.ulp(this.m_value),this}setDivEN(e,t){return this.setE(e),this.divThis(t)}setDivNE(e,t){return this.set(e),this.divThisE(t)}divThisByPower2(e){return this.m_value/=e,this.m_eps/=Math.abs(e),this}invThis(){return this.setE(b.clone().divThisE(this)),this}sqrt(){return this.clone().sqrtThis()}sqrtThis(){let e,t;return this.m_value>=0?(e=Math.sqrt(this.m_value),t=this.m_value>10*this.m_eps?.5*this.m_eps/e:this.m_value>this.m_eps?e-Math.sqrt(this.m_value-this.m_eps):Math.max(e,Math.sqrt(this.m_value+this.m_eps)-e),t+=p.ulp(e)):this.m_value<-this.m_eps?(e=NaN,t=NaN):(e=0,t=Math.sqrt(this.m_eps)),this.m_value=e,this.m_eps=t,this}sqr(){return this.clone().sqrThis()}sqrThis(){let e=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(e),this.m_value=e,this}setSin(e){let t=Math.sin(e.m_value),n=Math.cos(e.m_value);this.m_value=t;let r=Math.abs(t),i=Math.abs(e.value());return this.m_eps=(Math.abs(n)+r*.5*e.m_eps)*e.m_eps+p.ulp(r+i),this}static ulp(e){let t=B(e),n=((t&9218868437227405312n)>>52n)-1075n;return n>-1023n?(t=n+1023n<<52n,ft(t)):e===0?0:Number.MIN_VALUE}setCos(e){let t=Math.sin(e.m_value),n=Math.cos(e.m_value);this.m_value=n;let r=Math.abs(n),i=Math.abs(e.value());return this.m_eps=(Math.abs(t)+r*.5*e.m_eps)*e.m_eps+p.ulp(r+i),this}static st_cosAndSin(e,t,n){let r=Math.sin(e.m_value),i=Math.cos(e.m_value);n.m_value=r,t.m_value=i;let a=Math.abs(r),o=Math.abs(i),s=Math.abs(e.value());n.m_eps=(Math.abs(i)+a*.5*e.m_eps)*e.m_eps+p.ulp(a+s),t.m_eps=(Math.abs(r)+o*.5*e.m_eps)*e.m_eps+p.ulp(o+s)}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(e){return d.construct(this.m_value-this.m_eps,this.m_value+this.m_eps).isIntersecting(e)}isInIntervalExclusive(e){let t=e.vmin+this.m_eps,n=e.vmax-this.m_eps;return t<this.m_value&&n>this.m_value}eq(e){return Math.abs(this.m_value-e.m_value)<=this.m_eps+e.m_eps}ne(e){return!this.eq(e)}gt(e){return this.m_value-e.m_value>this.m_eps+e.m_eps}lt(e){return e.m_value-this.m_value>this.m_eps+e.m_eps}ge(e){return!this.lt(e)}le(e){return!this.gt(e)}tolEQ(e,t){return Math.abs(this.m_value-e.m_value)<=t||this.eq(e)}tolNE(e,t){return!this.tolEQ(e,t)}tolGT(e,t){return this.m_value-e.m_value>t&&this.gt(e)}tolLT(e,t){return e.m_value-this.m_value>t&&this.lt(e)}tolGE(e,t){return!this.tolLT(e,t)}tolLE(e,t){return!this.tolGT(e,t)}isZero(){return Math.abs(this.m_value)<=this.m_eps}isFuzzyZero(){return this.isZero()&&this.m_eps!==0}tolIsZero(e){return Math.abs(this.m_value)<=Math.max(this.m_eps,e)}setPi(){this.setE(v)}setEuler(){this.set(2.718281828459045,_())}static dimensions=1;static size(){return 1}}function m(e,t){let n=V(e),r=V(t),i=53-l(n),a=53-l(r);return(i>=0?i:0)+(a>=0?a:0)<=52}function h(e,t){let n=e,r=t,i=n+r;return i-n===r&&i-r===n}function g(e,t){let n=e,r=t,i=n-r;return n-i===r&&r+i===n}function _(){return X()}const v=new p(Math.PI,_()*.5),y=new p(0,0),b=new p(1,0),x=new p(4,0);function S(e,t,n){return e.addE(t.subE(e).mulE(n))}function ee(e,t,n){return t.subE(t.subE(e).mulE(b.subE(n)))}function te(e){return Math.atanh(e)}function ne(e){let t;if(e===0)t=1;else if(Math.abs(e)>.01)t=te(e)/e;else{let n;t=0;let r=e*e,i=Math.trunc(-36.841361487904734/Math.log(r)+2.5);for(let e=2*i-1;e>1;e-=2)n=1/e,t=(t+n)*r;t+=1}return t}function C(e){let t=Math.PI*Math.PI/6,n;if(e===1)n=t;else if(e>1)n=t;else if(e===0)n=e;else if(e<0){e=Math.abs(e);let t=1+e,r=Math.log(t);n=r*r/-2-C(e/t)}else if(e>.5){let r=1-e,i=Math.log(e)*Math.log(r);n=t-C(r)-i}else{n=0;let t=1+Math.trunc(-16*Math.log(10)/Math.log(e)+1.5),r=t;for(let i=t;i>0;i--,--r)n*=e,n+=1/(r*r);n*=e}return n}function re(e,t){let n=t*e;if(Math.abs(t)<.1){let t=0;for(let e=60;e>=1;e--)t*=n,t+=1/e/e;return t*=e,t}return C(n)/t}function w(e,t){return e<t?z(e,t):z(t,e)}function T(e,t){let n=Math.abs(e);return t>=0?n:-n}function ie(e){return Math.round(e)}function E(e,t,n,r,i){i[0]=t[0]+(n[0]-t[0])*r,i[1]=t[1]+(n[1]-t[1])*r,e===3&&(i[2]=t[2]+(n[2]-t[2])*r)}function D(e,t,n,r,i){i[0]=n[0]-(n[0]-t[0])*(1-r),i[1]=n[1]-(n[1]-t[1])*(1-r),e===3&&(i[2]=n[2]-(n[2]-t[2])*(1-r))}function O(e,t,n,r,i){r<=.5?E(e,t,n,r,i):D(e,t,n,r,i)}function ae(e,t,n,r,i){i[0]=t[0].addE(n[0].subE(t[0]).mulE(r)),i[1]=t[1].addE(n[1].subE(t[1]).mulE(r))}function oe(e,t,n,r,i){i[0]=n[0].subE(n[0].subE(t[0]).mulE(b.subE(r))),i[1]=n[1].subE(n[1].subE(t[1]).mulE(b.subE(r)))}function k(e,t,n){let r;return r=n<=.5?e+(t-e)*n:t-(t-e)*(1-n),r}function se(e,t,n){return e+(t-e)*n}function ce(e,t,n){return t-(t-e)*(1-n)}function A(e,t,n,r){n<=.5?(r.x=e.x+(t.x-e.x)*n,r.y=e.y+(t.y-e.y)*n):(r.x=t.x-(t.x-e.x)*(1-n),r.y=t.y-(t.y-e.y)*(1-n))}function le(e,t,n,r){n<=.5?(r.x=e.x+(t.x-e.x)*n,r.y=e.y+(t.y-e.y)*n,r.z=e.z+(t.z-e.z)*n):(r.x=t.x-(t.x-e.x)*(1-n),r.y=t.y-(t.y-e.y)*(1-n),r.z=t.z-(t.z-e.z)*(1-n))}function j(e){return e*e}function ue(e){return e*e*e}function de(e){return 1/Math.sqrt(e)}function fe(e){return e<0?-1:+(e>0)}function pe(e,t,n,r){let i=[0],a=N(e,n,i),o=[0],s=N(t,r,o),c=[0];return P(a,s,c)+(i[0]+o[0]+c[0])}const me=[0],he=[0];function ge(e,t,n){return Ce(N(e,t,me),n,me[0],he)}const M=[0],_e=[0],ve=[0],ye=[0];function N(e,t,n){let r=e*t;return be(e,M,_e),be(t,ve,ye),n[0]=_e[0]*ye[0]-(r-M[0]*ve[0]-_e[0]*ve[0]-M[0]*ye[0]),r}function be(e,t,n){let r=134217729*e;t[0]=r-(r-e),n[0]=e-t[0]}const xe=[0],Se=[0];function Ce(e,t,n,r){return P(P(P(e,t,xe),n,Se),xe[0]+Se[0],r)}function P(e,t,n){let r=e+t;return n[0]=Math.abs(e)>Math.abs(t)?e-r+t:t-r+e,r}function we(e,t){return e%t}function Te(e){let t=1-e;if(t===0)return 1;let n;if(t<=.01){let e=t,r=Math.log(e);n=1+e*(.4431471805599453-.25*r+e*(.05680519270997949-.09375*r+e*(.02183137044373718-.05859375*r+e*(.011544521417308362-.042724609375*r+e*(.00714200031339596-.0336456298828125*r+e*(.004854743337164948-.027757644653320312*r+e*(.003514687963781376-.023627042770385742*r)))))))}else if(e<.016){let t=e;return Z()*(1-t*(.25+t*(.046875+t*(.01953125+t*(.01068115234375+t*(.0067291259765625+t*(.004626274108886719+t*(.0033752918243408203+t*.0025710230693221092))))))))}else n=Oe(0,t,1)-e*ke(0,t,1)/3;return Rt(n,1,Z())}function Ee(e,n,r=NaN){if(t(n>=0&&n<=1),n===0)return e;let i=1,a=e;if(a<0&&(a=-a,i=-1),n===1){let e=Math.round(a/Vt()),t=a-e*Vt(),n=2*e+Math.sin(t);return i*n}let o=Z(),s=Math.floor(a/o);s&1?a=(s+1)*o-a:a-=s*o;let c=Math.sin(a),l=Number.isNaN(r)?Te(n):r,u;if(c===1)u=l+Math.sqrt(1-n)*(a-o);else{let e=a*a;if(.01424*e**4<=2*X())u=a*(1+e*n*(-1/6+e*((4-3*n)/120-(16+(-60+45*n)*n)/5040*e)));else if(n<=.01){let e=Math.sin(2*a),t=Math.sin(4*a),r=Math.sin(6*a),i=Math.sin(8*a),o=Math.sin(10*a),s=Math.sin(12*a),c=n;u=a+c*((-a*2+e)/8+c*((-3*a+2*e-t*.25)/64+c*((-20*a+15*e-3*t+r/3)/1024+c*(5*(-140*a+112*e-28*t+16/3*r-.5*i)/65536+c*7*((-63*a+52.5*e-15*t+3.75*r-.625*i+.05*o)/65536+c*(-693*a+594*e-185.625*t+1.375*r-12.375*i+1.8*o-.125*s)/1048576)))))}else{let e=c*c,t=Math.cos(a),r=t*t,i=Ae(c,t,n);u=c*(Oe(r,i,1)-n*e*ke(r,i,1)/3)}}return s&1?u=l*(s+1)-u:u+=l*s,i*u}function De(e,t,n=NaN){if(e===0)return 0;let r=1,i=e;e<0&&(i=-i,r=-1);let a=Number.isNaN(n)?Te(t):n,o=Math.floor(i/a);o&1?i=(o+1)*a-i:i-=o*a;let s=i<=0?0:i>=a?Z():je(i,t,a);return o&1?s=Z()*(o+1)-s:s+=Z()*o,r*s}function Oe(e,n,r){t((e===0?0:1)+(n===0?0:1)+1>1);let i=e,a=n,o=r;for(;;){let e=Math.sqrt(i*a),t=Math.sqrt(a*o),n=Math.sqrt(o*i),r=e+t+n;i=.25*(i+r),a=.25*(a+r),o=.25*(o+r);let s=(i+a+o)/3,c=(s-i)/s,l=(s-a)/s,u=(s-o)/s;if(Math.abs(c)<=.0024&&Math.abs(l)<=.0024&&Math.abs(u)<=.0024){let e=c*l-u*u,t=c*l*u;return(1+(-.1+1/24*e-3/44*t-5*e*e/208+e*t/16)*e+(1/14+3*t/104)*t)/Math.sqrt(s)}}}function ke(e,n,r){t(e!==0||n!==0);let a=e,o=n,s=r,c=new i(0),l=1;for(;;){let e=(a+o+3*s)*.2,t=(e-a)/e,n=(e-o)/e,r=(e-s)/e;if(Math.abs(t)<=.0015&&Math.abs(n)<=.0015&&Math.abs(r)<=.0015){let i=t*n,a=r*r,o=i-a,s=i-6*a,u=s+o+o,d=3/26,f=s*(-.21428571428571427+.10227272727272728*s-1.5*d*r*u),p=r*(.16666666666666666*u+r*(-.4090909090909091*o+r*d*i));return 3*c.getResult()+l*(1+f+p)/(e*Math.sqrt(e))}let i=Math.sqrt(a),u=Math.sqrt(o),d=Math.sqrt(s),f=i*(u+d)+u*d;c.add(l/(d*(s+f))),l*=.25,a=(a+f)*.25,o=(o+f)*.25,s=(s+f)*.25}}function Ae(e,t,n){return e<.999?1-n*j(e):1-n+n*j(t)}function je(e,t,n){if(t===0)return e;if(t===1)return Math.asin(e);let r=0,i=!0;if(e<.2){let n=e*e,a=e*(1+n*t*(1/6+n*((13*t-4)/120+(16-284*t+493*t*t)/5040*n))),o=Math.abs(t*(-64+4944*t-31224*t*t+37369*t*t*t)/362880*e**9);if(o<Math.abs(a)*X())return a;r=a,i=o>a*.1}if(i){let i=1-t,a=1-e/n,o=Math.sqrt(a*a+i*i),s=Math.atan2(i,e+X());r=Z()+Math.sqrt(o)*(s-Z())}let a=0;for(let i=0;i<7;i++){a=Ee(r,t,n);let o=Ae(Math.sin(r),Math.cos(r),t);if(r-=(a-e)/Math.sqrt(o),i>0&&Math.abs(a-e)<=4*X()*e)break}return r}class Me{values;constructor(e){for(this.values=[[1]];this.values.length<e+1;){let e=this.values.at(-1),t=R(e.length+1,1);for(let n=1;n<e.length;++n)t[n]=e[n-1]+e[n];this.values.push(t)}}get(e,t){return this.values[e][t]}}function Ne(e,n){return t(0),0}const Pe=new Me(32);function F(e,t){if(e<Pe.values.length)return Pe.get(e,t);let r=Math.exp(Ne());return r+.01>W()&&n(`The result value of n choose k is out of range`),r+.01}function Fe(e,t){if(e.isZero())return e.clone();let n=e.clone().divThis(e);if(t<0)return n.divThis(Fe(e,-t));for(e=e.clone(),t=Math.trunc(t);t&1&&n.mulThis(e),t>>=1,t;)e.mulThis(e);return n}function Ie(e,t){if(t===0)return[];let n=e[0].clone().mulDoubleThis(0),r=[];r.length=t;let i=t-1;for(let t=0;t<=i;++t){r[t]=n.clone();for(let n=0;n<=t;++n)r[t].addThis(e[n].clone().mulDoubleThis(F(t,n)/F(i,n)))}return r}function Le(t,n,r,i,a){if(t===0)return i===0?n:i===1?r:a;if(t===1)return i===0?n:i===1?r:k(n,r,i);t===2&&e(`angular interpolation`),e(``)}function Re(t,n,r,i,a,o,s,c){if(t===0)for(let e=0;e<o;++e)i[e+a]=s===0?n[e]:s===1?r[e]:c;else if(t===1){if(s===0)I(i,n,a,0,o);else if(s===1)I(i,r,a,0,o);else for(let e=0;e<o;++e)i[e+a]=k(n[e],r[e],s)}else if(t===2){if(s===0)I(i,n,a,0,o);else if(s===1)I(i,r,a,0,o);else{let e=0;for(let t=0,c=a;t<o;++t,++c)i[c]=k(n[t],r[t],s),e+=i[c]*i[c];if(e>0){e=Math.sqrt(e);for(let t=a;t<a+o;++t)i[t]/=e}else{for(let e=a;e<a+o;++e)i[e]=0;i[a]=1}}}else e(``)}function I(e,t,n,r,i){if(i===0)return;let a=0,o=n,s=r;for(;a++<i;)e[o++]=t[s++]}function ze(e,t,n){let r=0;for(let i=0;!r&&i<n;++i)r=e[i]-t[i];return r}function L(e,t){return e}function Be(e){e.sort((e,t)=>e<t?-1:+(e>t))}function Ve(e,t){let n=e.slice(0,t);Be(n),I(e,n,0,0,t)}function He(e,t,n,r){let i=e.slice(t,t+n);i.sort(r),I(e,i,t,0,n)}function Ue(e,t){return e<t?-1:+(e>t)}function We(e,t,n,r){return e<n?-1:e>n?1:t<r?-1:+(t>r)}function Ge(e,t){if(e.length<2)return e.length;let n=0;for(let r=1;r<e.length;++r)t(e[r],e[n])||(n++,e[r]=L(e[n],e[n]=e[r]));return 1+n}function Ke(e,t){e[t]=e.at(-1),e.pop()}function qe(e,t=!1){return{[Symbol.dispose](){this.bForget||e()},bForget:t}}function Je(e,t,n){e.length=t,e.fill(n)}function Ye(e,t,n){e.length=n;for(let r=0;r<n;++r)e[r]=new t}function Xe(e,t){let n=Array(t);for(let r=0;r<t;++r)n[r]=new e;return n}function Ze(e,t,n){for(let r=0;r<n;++r)e[r].assign(t[r]);return n}function Qe(e,t){let n=e.slice(0,t);for(let e=0;e<t;++e)n[e]=n[e].clone();return n}function $e(e){return Array.from({length:e},()=>null)}function et(e,t){return Array.from({length:t},()=>e())}function R(e,t){let n=Array(e);return n.fill(t),n}function tt(e,t){return t in e&&Object.getOwnPropertyNames(e).length===1}class nt{m_elts;constructor(...e){this.m_elts=e}get length(){return this.m_elts.length}at(e){return this.m_elts[e]}[Symbol.dispose](){for(let e of this.m_elts)e[Symbol.dispose]()}}function z(e,t){return{first:e,second:t}}const rt=Math.PI,it=2*Math.PI,at=.5*Math.PI;class ot{m_cr;m_cc;m_v;constructor(e,t){this.m_cr=e,this.m_cc=t,this.m_v=R(e*t,0)}get(e,t){return this.m_v[e*this.m_cc+t]}set(e,t,n){this.m_v[e*this.m_cc+t]=n}inc(e,t){return++this.m_v[e*this.m_cc+t]}}const st=new ArrayBuffer(8),ct=new Float64Array(st),lt=new BigUint64Array(st),ut=0x2386f26fc10000;function dt(){return 2**-52*Pt}function B(e){return ct[0]=e,lt[0]}function ft(e){return lt[0]=e,ct[0]}function V(e){return B(e)&4503599627370495n}function pt(e){return Number((B(e)&9218868437227405312n)>>52n)}function H(e){if(e===0n)return-1n;if(e===1n||e===-1n)return 0n;e<0n&&(e=-e);let t=0n,n=512n,r=1n<<t+n;for(;e>=r;)t+=n,n<<=1n,r<<=n;let i=t;n>>=1n;let a=i+n;for(;n>0n;)e<1n<<a||(i=a),n>>=1n,a=i+n;return i}function U(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function mt(e,t,n){return e===t||Math.abs(e-t)<=n||Number.isNaN(e)&&Number.isNaN(t)}function ht(e,t){return e<t?-1:+(e>t)}function gt(e,t){if(e<t)return-1;if(e>t)return 1;if(e===t)return 0;{let n=Number.isNaN(e),r=Number.isNaN(t);return n<r?-1:+(n>r)}}function _t(){return 2147483647}function vt(){return 32767}function W(){return 2147483647}function yt(){return-2147483648}const G=W(),bt=BigInt(G),xt=2166136261,K=16777619;function St(e){let t=xt,n=e;return t=(t^n&255)*K,n>>=8,t=(t^n&255)*K,n>>=8,t=(t^n&255)*K,n>>=8,t=(t^n&255)*K,t&G}const q=1099511628211n;function Ct(e){let t=14695981039346656037n,n=e;return t=(t^n&255n)*q,n>>=8n,t=(t^n&255n)*q,n>>=8n,t=(t^n&255n)*q,n>>=8n,t=(t^n&255n)*q,n>>=8n,t=(t^n&255n)*q,n>>=8n,t=(t^n&255n)*q,n>>=8n,t=(t^n&255n)*q,t&bt}function wt(e){return 1103515245*e+12345&2147483647}function Tt(e){let t=xt;for(let n=0,r=e.length;n<r;++n)t=(t^e.charCodeAt(n))*K;return t&G}function J(e,t){return t+2654435769+(e<<6)+(e>>2)&G}function Et(e,t){return J(e,At(t))}function Dt(e){return J(3735928559,e)}function Ot(e,t){return J(e,Dt(t))}function kt(e){return St(e)}function At(e){return Number(Ct(e))}function jt(e){return Gt(e)}function Mt(e){return At(B(jt(e)))}function Nt(e){return wt(e)}const Pt=100;function Y(){return 2**-52*100}function Ft(){return .38196601125010515}function It(){return 1.4142135623730951}function X(){return 2**-52}function Lt(e,t,n){return e===t||e===n}function Rt(e,t,n){return e>=t?e<=n?e:n:t}function zt(e,t,n){let r=e[0];if(!(r>=t))e[0]=t;else if(!(r<=n))e[0]=n;else return!1;return!0}function Bt(e,t){return e>=t?t:e<-t?-t:e}function Vt(){return rt}function Ht(){return it}function Z(){return at}const Ut=3*Z();function Wt(){return Ut}function Gt(e){return e+0}function Kt(e){return{v:e}}class Q{static s_sm=9223372036854775808n;static s_em=9218868437227405312n;static s_fm=4503599627370495n;static s_emax=2047n;m_rn=Kt(0n);m_rd=Kt(1n);m_bNaN=!1;m_bNormalized=!1;m_power=0;m_sign=0;static constructAssign(e,t){let n=e.clone();return t!==void 0&&n.limitPrecisionThis(t),n}static constructDouble(e){return new Q().setDouble(e)}static constructInt64(e){return new Q().setInt64(e)}static constructRational(e,t){return new Q().setRational(e,t)}static constructInt32(e){return this.constructInt64(BigInt(Math.trunc(e)))}[Symbol.toPrimitive](e){return this}compare(e){return this.lt(e)?-1:+!!this.gt(e)}assignCopy(e){return this.setThis(e)}abs(){return this.clone().absThis()}absThis(){return this.isNAN()||(this.m_sign*=this.m_sign),this}clone(){return new Q().setThis(this)}setThis(e){return this.m_bNaN=e.m_bNaN,this.m_bNormalized=e.m_bNormalized,this.m_rn.v=e.m_rn.v,this.m_rd.v=e.m_rd.v,this.m_power=e.m_power,this.m_sign=e.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(t){if(this.setZero(),t===0)return this;if(Number.isInteger(t)&&Math.abs(t)<W())return this.setInt32(t);let n=B(t),r=(n&Q.s_em)>>52n,i=!!(n&Q.s_sm),a=n&Q.s_fm;if(r===Q.s_emax)return a?(this.m_rn.v=this.m_rd.v=0n,this.m_bNaN=!0,this):(this.m_rn.v=i?-1n:1n,this.m_rd.v=0n,this);r===0n&&e(`denormalized numbers not yet implemented`);let o=r-1023n,s=o>=0n?o:0n,c=o<0n?-o:0n;return this.m_rn.v=(1n<<52n|a)<<s,this.m_rd.v=1n<<52n+c,this.m_sign=i?-1:1,this.m_bNormalized=!1,this.normalizeThis()}setInt64(e){return e===0n?this.setZero():(this.m_bNaN=!1,this.m_sign=e>0n?1:-1,this.m_rn.v=e>0n?e:-e,this.m_rd.v=1n,this.m_power=0,this.m_bNormalized=!1,this.normalizeThis())}setRational(e,t){return e===0n?t===0n?this.setNAN():this.setZero():t===0n?e>0n?this.setPositiveInf():this.setNegativeInf():(this.m_sign=(e>0n?1:-1)*(t>0n?1:-1),this.m_rn.v=e>0n?e:-e,this.m_rd.v=t>0n?t:-t,this.m_power=0,this.m_bNormalized=!1,this.normalizeThis())}setInt32(e){return this.setInt64(BigInt(Math.trunc(e)))}getDouble(){return this.convertToDouble()}toDouble(){return this.convertToDouble()}value(){return this.convertToDouble()}isNAN(){return this.m_bNaN}isPositiveInf(){return!this.isNAN()&&this.m_rd.v===0n&&this.m_sign===1}isNegativeInf(){return!this.isNAN()&&this.m_rd.v===0n&&this.m_sign===-1}isFinite(){return!this.isNAN()&&this.m_rd.v!==0n}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(e){if(e.isNAN()&&this.setNAN(),this.isPositiveInf()&&e.isPositiveInf())this.setNAN();else if(this.isPositiveInf()&&e.isNegativeInf())return this.setPositiveInf(),this;else if(this.isNegativeInf()&&e.isNegativeInf())this.setNAN();else if(this.isNegativeInf()&&e.isPositiveInf())return this.setNegativeInf(),this;return this.isNAN()?this:this.opPlusMinus(e,!1)}thisSubAbs(e){return t(0),this}mulThis(e){return e.isNAN()&&this.setNAN(),this.isNAN()?this:(this.m_sign*=e.m_sign,this.m_sign===0?this.setZero():(this.m_rn.v*=e.m_rn.v,this.m_rd.v*=e.m_rd.v,this.m_power+=e.m_power,this.m_bNormalized=!1,this.normalizeThis(),this))}mulDoubleThis(e){return this.mulThis(Q.constructDouble(e))}thisMulInt64(e){return t(0),this}thisMulInt32(e){return t(0),this}divThis(e){return this.mulThis(e.clone().invertThis())}divDoubleThis(e){return this.divThis(Q.constructDouble(e))}addDoubleThis(e){return this.addThis(Q.constructDouble(e))}subDoubleThis(e){return this.subThis(Q.constructDouble(e))}mul(e){return this.clone().mulThis(e)}mulBigIntThis(e){return this.mulThis(Q.constructInt64(e))}mulDouble(e){return this.clone().mulThis(Q.constructDouble(e))}div(e){return this.clone().divThis(e)}divDouble(e){return this.clone().divDoubleThis(e)}add(e){return this.clone().addThis(e)}fmSubThis(e,t){return this.subThis(e.clone().mulThis(t))}fmAddThis(e,t){return this.addThis(e.clone().mulThis(t))}addThis(e){if(e.isNAN()&&this.setNAN(),this.isPositiveInf()&&e.isPositiveInf())return this.setPositiveInf(),this;if(this.isPositiveInf()&&e.isNegativeInf())this.setNAN();else if(this.isNegativeInf()&&e.isNegativeInf())return this.setNegativeInf(),this;else this.isNegativeInf()&&e.isPositiveInf()&&this.setNAN();return this.isNAN()?this:this.opPlusMinus(e,!0)}addDouble(e){return this.clone().addThis(Q.constructDouble(e))}sub(e){return this.clone().subThis(e)}subDouble(e){return this.clone().subThis(Q.constructDouble(e))}isZero(){return this.m_sign===0}equals(e){return this.clone().subThis(e).isZero()}lt(e){return this.isNAN()||e.isNAN()||this.isPositiveInf()&&e.isPositiveInf()||this.isNegativeInf()&&e.isNegativeInf()||this.isPositiveInf()?!1:e.isPositiveInf()?!0:this.clone().sub(e).LZ()}absLessAbs(e){return this.abs().lt(e.abs())}gt(e){return this.clone().sub(e).GZ()}lte(e){return this.sub(e).LEZ()}gte(e){return this.sub(e).GEZ()}normalizeThis(){if(this.m_bNormalized)return this;if(this.m_rn.v===0n)return this.setZero();let e=0,t=4294967295n;for(;(this.m_rn.v&t)===0n&&t<=this.m_rn.v;)t<<=32n,e+=32;t&=this.m_rn.v,t>>=BigInt(e),e+=s(BigInt.asUintN(32,t))-1;let n=0;for(t=4294967295n;(this.m_rd.v&t)===0n&&t<=this.m_rd.v;)t<<=32n,n+=32;return t&=this.m_rd.v,t>>=BigInt(n),n+=s(BigInt.asUintN(32,t))-1,this.m_rn.v>>=BigInt(e),this.m_rd.v>>=BigInt(n),this.m_power+=e-n,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):this.m_rn.v===0n?(this.setPositiveInf(),this):(this.m_rd=L(this.m_rn,this.m_rn=this.m_rd),this.m_power=-this.m_power,this)}limitPrecisionThis(e){if(e===0)return this;if(this.isZero())return this.setZero();if(!this.isFinite())return this;this.normalizeThis();let t=Number(H(this.m_rn.v));if(t>e){let n=t-e;this.m_rn.v>>=BigInt(t-e),this.m_power+=n}if(t=Number(H(this.m_rd.v)),t>e){let n=t-e;this.m_rd.v>>=BigInt(t-e),this.m_power-=n}return this}hiBitIndex(){return Math.max(Number(H(this.m_rn.v)),Number(H(this.m_rd.v)))}ldexp(e){return this.clone().ldexpThis(e)}ldexpThis(e){return e&&(this.m_bNormalized=!1,this.m_power+=e,this.normalizeThis()),this}static lerp(e,t,n){return Q.lerpLo(t,t,n)}static lerpLo(e,t,n){return t.sub(e).mulThis(n).addThis(e)}static lerpHi(e,t,n){return t.sub(e).mulThis(qt.sub(n)).addThis(e)}LZ(){return!this.isNAN()&&this.m_sign===-1}GZ(){return!this.isNAN()&&this.m_sign===1}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(e,r){if(e.m_sign<0n&&n(`MP_value: sqrt(-1)`),e.isZero())return e.clone();let i=52,a=2220446049250313e-31;for(;i<r;)2*i<=r?(a*=a,i*=2):(a*=2220446049250313e-31,i+=52);i+=52;let o=H(e.m_rn.v),s=H(e.m_rd.v),c=e.m_power+Number(o-s),l,u=new Q;Math.abs(c)>200?(Math.abs(c)&1&&(c+=1),l=Q.constructAssign(e,53).ldexpThis(-c).value(),u.setThis(e).ldexpThis(-c),t(Number.isFinite(l))):(u.setThis(e),l=u.value(),t(Number.isFinite(l)),c=0),l=Math.sqrt(l);let d=Q.constructDouble(l),f=Q.constructDouble(a);f.mulThis(d).ldexpThis(1);let p=a*l*2,m=d.clone(),h=new Q,g;for(let e=0;e<10;++e){m.mulThis(d),h.setThis(u).subThis(m).absThis();let e=h.value();if(g=1,e<.9)for(;e>p;)e*=e,++g;else g=4;if(h.lte(f))break;for(let e=0;e<g;e++)m.setThis(d).divThis(u).invertThis().addThis(d).ldexpThis(-1).limitPrecisionThis(i),d.setThis(m)}return d.ldexpThis(c/2)}static cubicRoot(e,t){if(e.isZero())return e.clone();let n=52,r=2220446049250313e-31;for(;n<t;)2*n<=t?(r*=r,n*=2):(r*=2220446049250313e-31,n+=52);n+=52;let i=Math.abs(e.value())**(1/3),a=Q.constructDouble(i),o=a.clone();o.sqrThis().mulDoubleThis(3).mulDoubleThis(r),o.limitPrecisionThis(32),e.LZ()&&a.negateThis();for(let t=0;t<10;++t){let t=a.clone();t.sqrThis().mulThis(a);let r=t.clone();if(r.subThis(e),r.absThis().limitPrecisionThis(32),r.lte(o))break;r.setThis(e),r.ldexpThis(1),r.addThis(t);let i=t.clone();i.ldexpThis(1),i.addThis(e),r.divThis(i),a.mulThis(r),a.limitPrecisionThis(n)}return a}isInTheRangeOfDouble(){return t(0),!1}sign(){return this.m_sign}cosAndSin(e,n){t(0)}pow(e){return Fe(this,e)}static nan(){return t(0),new Q}convertToDouble(){if(this.m_bNaN)return NaN;if(this.isZero())return 0;if(this.m_rd.v===0n)return this.m_sign===1?1/0:-1/0;let e=this.m_sign===-1,t=this.m_rn.v<<(this.m_power>=0?BigInt(this.m_power):0n),n=this.m_rd.v<<(this.m_power<0?BigInt(-this.m_power):0n),r=t/n,i=Number(r);if(BigInt(i)!==r)return e?-i:i;let a=t-r*n;if(a){let e=H(n)-(1023n-0n);e>0n&&(n>>=e,a<<=52n,a>>=e);let t=Number(a);Number.isFinite(t)||(a>>=52n,t=Number(a),e=0n),e>0n&&(t/=2**52);let r=t/Number(n);i+=r}return e?-i:i}signVal(){return this.m_sign===1?1n:this.m_sign===-1?-1n:0n}opPlusMinus(e,t){let n=Math.min(this.m_power,e.m_power),r,i;this.m_power>n?(r=BigInt(this.m_power-n),i=0n):(r=0n,i=BigInt(e.m_power-n));let a=this.signVal()*this.m_rn.v*e.m_rd.v<<r,o=e.signVal()*e.m_rn.v*this.m_rd.v<<i;return this.m_rn.v=t?a+o:a-o,this.m_rd.v*=e.m_rd.v,this.m_power=n,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}}const qt=Q.constructInt32(1),Jt=Q.constructInt32(0),Yt=Q.constructDouble(.5);function Xt(e,t){return u(e^t)}function Zt(e,t){let n=pt(e),r=pt(t);if(n===r){let r=53-Xt(V(e),V(t));return n-=r,n}return n>r?n:r}function Qt(e,t){for(let n=0,r=0,i=e.length;n<i;n+=2,r++)t[r].x=e[n],t[r].y=e[n+1]}function $t(e){let t=new Float64Array(e.length*2);for(let n=0,r=e.length;n<r;++n){let r=n<<1;t[r]=e[n].x,t[r+1]=e[n].y}return t}function en(e){let t=Xe($,e.length);for(let n=0,r=e.length;n<r;++n)t[n].setCoords(e[n][0],e[n][1]);return t}class ${static dimensions=2;x;y;static d=[[0,1,0,-1],[-1,0,1,0],[0,-1,0,1],[1,0,-1,0]];static construct(e,t){return new $(e,t)}constructor(e,t){if(e===void 0){this.x=this.y=NaN;return}this.x=e,this.y=t}clone(){return new $(this.x,this.y)}assign(e){this.setCoordsPoint2D(e)}setCoords(e,t){return this.x=e,this.y=t,this}setCoordsPoint2D(e){this.x=e.x,this.y=e.y}isEqualPoint2D(e,t){return t===void 0?this.x===e.x&&this.y===e.y:Math.abs(this.x-e.x)<=t&&Math.abs(this.y-e.y)<=t}isEqual(e,t,n){return n===void 0?this.x===e&&this.y===t:Math.abs(this.x-e)<=n&&Math.abs(this.y-t)<=n}equalsPoint2D(e,t){return this.isEqualPoint2D(e,t)}setSub(e,t){this.x=e.x-t.x,this.y=e.y-t.y}addThis(e){return this.x+=e.x,this.y+=e.y,this}setAdd(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}absoluteOther(e){}absolute(){return t(0),this}setNegate(){this.x=-this.x,this.y=-this.y}setNegateOther(e){this.x=-e.x,this.y=-e.y}interpolateThis(e,t){}interpolate(e,n,r){t(0)}scaleAddThis(e,t){this.x=this.x*e+t.x,this.y=this.y*e+t.y}setScaleAdd(e,t,n){this.x=t.x*e+n.x,this.y=t.y*e+n.y}scaleOther(e,n){t(0)}scale(e){this.x*=e,this.y*=e}compare(e){return this.y<e.y?-1:this.y>e.y?1:this.x<e.x?-1:+(this.x>e.x)}compareX(e){return this.x<e.x?-1:this.x>e.x?1:this.y<e.y?-1:+(this.y>e.y)}normalizeOther(e){t(0)}normalize(){let e=this.length();return e?(this.x/=e,this.y/=e):(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(e,n){return t(0),{}}static average(e,t){let n=new $;if(t===0)return n.setNAN(),n;if(t===1)return n.assign(e[0]),n;let r=new i(e[0].x),a=new i(e[0].y);for(let n=1;n<t;n++)r.add(e[n].x),a.add(e[n].y),n&255||(r.normalize(),a.normalize());return n.x=r.getResult()/t,n.y=a.getResult()/t,n}static calculateLength(e,t){let n=new i(0);for(let r=1;r<t;r++)n.add($.distance(e[r],e[r-1]));return n.getResult()}offset(e,t){let n=$.distance(e,t),r=$.construct(this.x,this.y);if(n===0)return $.distance(r,e);let i=t.clone();return i.subThis(e),r.subThis(e),r.crossProduct(i)/n}side(e,t){return e.equals(t)?+!this.equals(e):$.orientationRobust(t,e,this)}static sqrDistance(e,t){let n=e.x-t.x,r=e.y-t.y;return n*n+r*r}static sqrDistanceCoords(e,t,n,r){let i=n-e,a=r-t;return i*i+a*a}static distance(e,t){return Math.sqrt($.sqrDistance(e,t))}dotProduct(e){return this.x*e.x+this.y*e.y}dotProductAbs(e){return Math.abs(this.x*e.x)+Math.abs(this.y*e.y)}crossProduct(e){return this.x*e.y-this.y*e.x}crossProductAbs(e){return t(0),0}rotateDirect(e,t){let n=this.x*e-this.y*t,r=this.x*t+this.y*e;this.x=n,this.y=r}rotateReverse(e,t){let n=this.x*e+this.y*t,r=-this.x*t+this.y*e;this.x=n,this.y=r}leftPerpendicularThis(){let e=this.x;this.x=-this.y,this.y=e}leftPerpendicularOther(e){let t=e.x;this.x=-e.y,this.y=t}rightPerpendicularThis(){let e=this.x;this.x=this.y,this.y=-e}rightPerpendicularOther(e){let t=e.x;this.x=e.y,this.y=-t}equals(e){return this.x===e.x&&this.y===e.y}notequals(e){return this.x!==e.x||this.y!==e.y}not(){return!this.x&&!this.y}gt(e){return this.y>e.y||this.y===e.y&&this.x>e.x}gte(e){return!this.lt(e)}lt(e){return this.y<e.y||this.y===e.y&&this.x<e.x}lte(e){return!this.gt(e)}subThis(e){return this.x-=e.x,this.y-=e.y,this}divThis(e){return this.x/=e,this.y/=e,this}add(e){return new $(this.x+e.x,this.y+e.y)}sub(e){return new $(this.x-e.x,this.y-e.y)}negateThis(){return this.x=-this.x,this.y=-this.y,this}negate(){return new $(-this.x,-this.y)}mul(e){return new $(this.x*e,this.y*e)}mulThis(e){return this.x*=e,this.y*=e,this}divide(e){return new $(this.x/e,this.y/e)}setNAN(){this.x=this.y=NaN}isNAN(){return Number.isNaN(this.x)||Number.isNaN(this.y)}static getNAN(){return new $(NaN,NaN)}isFinite(){return Number.isFinite(this.x)&&Number.isFinite(this.y)}isZero(){return this.x===0&&this.y===0}norm(e){switch(e){case 0:{let e=Math.abs(this.x),t=Math.abs(this.y),n=e-t;return n>=0?e:n<=0?t: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:r(`norm`)}}getQuarter(){return $.getQuarterCoords(this.x,this.y)}static getQuarterCoords(e,t){return e>0?t>=0?1:4:t>0?2:e===0?4:3}static compareVectors(e,t){let n=e.getQuarter(),r=t.getQuarter();return r===n?$.orientationRobustImpl($.construct(0,0),t,e,!0):n<r?-1:1}static compareVectorsOrigin(e,t,n){let r=t.sub(e),i=n.sub(e),a=r.getQuarter(),o=i.getQuarter();return o===a?$.orientationRobustImpl(e,n,t,!0):a<o?-1:1}static orientationRobust(e,t,n){return $.orientationRobustImpl(e,t,n,!1)}static orientationRobustEx(e,t,n,r){if(e.equals(t)||n.equals(r))return 0;let i=t.x-e.x,a=t.y-e.y,o=r.x-n.x,s=r.y-n.y;{let e=$.getQuarterCoords(i,a)-1,t=$.getQuarterCoords(o,s)-1,n=$.d[e][t];if(n!==0)return n}let c=i*s,l=a*o,u=4*X()*(Math.abs(c)+Math.abs(l)),d=c-l;return Math.abs(d)>=u?d<0?-1:+(d>0):$.orientationRobustExMp(e,t,n,r)}static orientationRobustExMp(e,t,n,r){let i=Q.constructDouble(t.x),a=Q.constructDouble(r.x);i.subThis(Q.constructDouble(e.x)),a.subThis(Q.constructDouble(n.x));let o=Q.constructDouble(t.y),s=Q.constructDouble(r.y);return o.subThis(Q.constructDouble(e.y)),s.subThis(Q.constructDouble(n.y)),i.mulThis(s),o.mulThis(a),i.subThis(o),i.LZ()?-1:+!!i.GZ()}static orientationNonRobust(e,t,n){let r=t.sub(e).crossProduct(n.sub(e));return r<0?-1:+(r>0)}static orientationRobustImpl(e,t,n,r){if(t.isEqualPoint2D(e)||n.isEqualPoint2D(e)||t.isEqualPoint2D(n))return 0;let i=t.x-e.x,a=t.y-e.y,o=n.x-e.x,s=n.y-e.y;if(!r){let e=$.getQuarterCoords(i,a)-1,t=$.getQuarterCoords(o,s)-1,n=$.d[e][t];if(n!==0)return n}let c=Math.abs(i),l=Math.abs(a),u=Math.abs(o),d=Math.abs(s),f=Math.abs(t.x),p=Math.abs(t.y),h=Math.abs(n.x),v=Math.abs(n.y),y=(c+l+u+d)*(f+p+h+v)*8*_(),b=i*s-a*o;if(Math.abs(b)>y)return b<0?-1:1;if(g(t.x,e.x)&&g(n.y,e.y)&&g(t.y,e.y)&&g(n.x,e.x)&&m(i,s)&&m(a,o)){let e=i*s,t=a*o;if(g(e,t)){let n=e-t;return n<0?-1:+(n>0)}}return $.orientationRobustMp(e,t,n)}static orientationRobustMp(e,t,n){let r=Q.constructDouble(t.x),i=Q.constructDouble(n.x);{let t=Q.constructDouble(e.x);r.subThis(t),i.subThis(t)}let a=Q.constructDouble(n.y),o=Q.constructDouble(t.y);{let t=Q.constructDouble(e.y);a.subThis(t),o.subThis(t)}return r.mulThis(a),o.mulThis(i),r.subThis(o),r.LZ()?-1:+!!r.GZ()}static inCircleRobust(e,t,n,r){let i=new p,a=new p;i.set(e.x),i.subThis(r.x),a.set(e.y),a.subThis(r.y);let o=new p,s=new p;o.set(t.x),o.subThis(r.x),s.set(t.y),s.subThis(r.y);let c=new p,l=new p;c.set(n.x),c.subThis(r.x),l.set(n.y),l.subThis(r.y);let u=i.mulE(s).subE(a.mulE(o)),d=o.mulE(l).subE(s.mulE(c)),f=i.mulE(l).subE(a.mulE(c)),m=i.mulE(i).addE(a.mulE(a)),h=o.mulE(o).addE(s.mulE(s)),g=c.mulE(c).addE(l.mulE(l)),_=m.mulE(d).subE(h.mulE(f)).addE(g.mulE(u));if(!_.isFuzzyZero()){let e=_.value();return e<0?-1:+(e>0)}return $.inCircleRobustMp(e,t,n,r)}static inCircleRobustMp(e,t,n,r){do{if(!(g(e.x,r.x)&&g(e.y,r.y))||!(g(t.x,r.x)&&g(t.y,r.y))||!(g(n.x,r.x)&&g(n.y,r.y)))break;let i=e.x-r.x,a=e.y-r.y,o=t.x-r.x,s=t.y-r.y,c=n.x-r.x,l=n.y-r.y;if(!(m(i,s)&&m(a,o))||!(m(o,l)&&m(s,c))||!(m(i,l)&&m(a,c))||!(m(i,i)&&m(a,a))||!(m(o,o)&&m(s,s))||!(m(c,c)&&m(l,l)))break;let u=i*s,d=a*o,f=o*l,p=s*c,_=i*l,v=a*c,y=i*i,b=a*a,x=o*o,S=s*s,ee=c*c,te=l*l;if(!g(u,d)||!g(f,p)||!g(_,v)||!h(y,b)||!h(x,S)||!h(ee,te))break;let ne=u-d,C=f-p,re=_-v,w=y+b,T=x+S,ie=ee+te;if(!m(w,C)||!m(T,re)||!m(ie,ne))break;let E=w*C,D=T*re,O=ie*ne;if(!g(E,D))break;let ae=E-D;if(!h(ae,O))break;let oe=ae+O;return oe<0?-1:+(oe>0)}while(0);let i=Q.constructDouble(r.x),a=Q.constructDouble(r.y),o=Q.constructDouble(e.x),s=Q.constructDouble(e.y);o.subThis(i),s.subThis(a);let c=Q.constructDouble(t.x),l=Q.constructDouble(t.y);c.subThis(i),l.subThis(a);let u=Q.constructDouble(n.x),d=Q.constructDouble(n.y);u.subThis(i),d.subThis(a);let f=o.mul(l).sub(s.mul(c)),p=c.mul(d).sub(l.mul(u)),_=o.mul(d).sub(s.mul(u)),v=o.mul(o).add(s.mul(s)),y=c.mul(c).add(l.mul(l)),b=u.mul(u).add(d.mul(d)),x=v.mul(p).sub(y.mul(_)).add(b.mul(f));return x.LZ()?-1:+!!x.GZ()}static inCircleRobustMp3Point(e,t,n){let r=Q.constructDouble(e.x),i=Q.constructDouble(e.y),a=Q.constructDouble(t.x),o=Q.constructDouble(t.y),s=Q.constructDouble(n.x),c=Q.constructDouble(n.y),l=s.mul(s).add(c.mul(c)).sub(s.mul(r).add(c.mul(i)).add(s.mul(a)).add(c.mul(o))).add(r.mul(a).add(i.mul(o)));return l.LZ()?-1:+!!l.GZ()}static inCircleRobust3Point(e,t,n){let r=new p(e.x),i=new p(e.y),a=new p(t.x),o=new p(t.y),s=new p(n.x),c=new p(n.y),l=s.mulE(s).addE(c.mulE(c)).subE(s.mulE(r).addE(c.mulE(i)).addE(s.mulE(a)).addE(c.mulE(o))).addE(r.mulE(a).addE(i.mulE(o)));if(!l.isFuzzyZero()){let e=l.value();return e<0?-1:+(e>0)}return $.inCircleRobustMp3Point(e,t,n)}static calculateCircleCenterFromThreePoints(e,t,n){if(e.equals(n)||e.equals(t)||n.equals(t))return $.getNAN();let r=tn(e,t,n);return r.isNAN()?nn(e,t,n):r}static calculateAngle(e,t){return Math.atan2(e.crossProduct(t),e.dotProduct(t))}static isBisectorRobust(e,n,r){return t(0),!1}static size(){return 2}get 0(){return this.x}get 1(){return this.y}set 0(e){this.x=e}set 1(e){this.y=e}static c_compare_zorder_xx=[2,0];static c_compare_zorder_yy=[1,0];static compareZorder(e,t){let n=$.c_compare_zorder_xx[+(e.x<0)]|$.c_compare_zorder_yy[+(e.y<0)],r=$.c_compare_zorder_xx[+(t.x<0)]|$.c_compare_zorder_yy[+(t.y<0)];if(n===r){let n=0,r=0;for(let i=0;i<2;++i){let a=e[i],o=t[i],s=Zt(a,o);s>n&&(n=s,r=i)}return e[r]<t[r]}return n<r}static lerp(e,t,n){let r=new $;return A(e,t,n,r),r}static getClosestCoordinate(e,t,n,r=!1){let i=$.getNAN();i.setSub(t,e);let a=i.sqrLength();if(a===0)return .5;if(t.isEqualPoint2D(n))return 1;let o=$.getNAN();o.setSub(n,e);let s=o.dotProduct(i)/a;return r||(s<0?s=0:s>1&&(s=1)),s}static intersectLinesAtOnePoint(e,t,n,r){if(e.equals(t)||n.equals(r))return $.getNAN();let i=t.x-e.x,a=n.x-r.x,o=t.y-e.y,s=n.y-r.y,c=i*s-a*o;if(!c)return $.getNAN();let l=c;if(l===0)return $.getNAN();let u=(n.x-e.x)*s-(n.y-e.y)*a;u/=l;let d=new $;return A(e,t,u,d),d.isFinite()?d:$.getNAN()}toString(){return`[${this.x},${this.y}]`}}function tn(e,t,n){let r=new p(t.x);r.subThis(e.x);let i=new p(t.y);i.subThis(e.y);let a=new p(n.x);a.subThis(e.x);let o=new p(n.y);o.subThis(e.y);let s=r.clone();s.mulThisE(o);let c=i.clone();if(c.mulThisE(a),s.subThisE(c),s.value()===0)return $.getNAN();s.mulThis(2);let l=r.clone();l.mulThisE(r);let u=i.clone();u.mulThisE(i);let d=l.clone();d.addThisE(u);let f=a.clone();f.mulThisE(a);let m=o.clone();m.mulThisE(o);let h=f.clone();h.addThisE(m);let g=i.clone();g.mulThisE(h),c=o.clone(),c.mulThisE(d),g.subThisE(c),g.divThisE(s);let _=r.clone();_.mulThisE(h),c=a.clone(),c.mulThisE(d),_.subThisE(c),_.divThisE(s);let v=$.construct(e.x-g.value(),e.y+_.value()),y=e.sub(v).length(),b=t.sub(v).length(),x=n.sub(v).length(),S=1e-15*(y+Math.abs(e.x)+Math.abs(t.x)+Math.abs(n.x)+Math.abs(e.y)+Math.abs(t.y)+Math.abs(n.y));return Math.abs(y-b)<=S&&Math.abs(y-x)<=S&&g.eps()<S&&_.eps()<S?v:$.getNAN()}function nn(e,t,n){let r=Q.constructDouble(t.x);r.subDoubleThis(e.x);let i=Q.constructDouble(t.y);i.subDoubleThis(e.y);let a=Q.constructDouble(n.x);a.subDoubleThis(e.x);let o=Q.constructDouble(n.y);o.subDoubleThis(e.y);let s=r.clone();s.mulThis(o);let c=i.clone();if(c.mulThis(a),s.subThis(c),s.isZero())return $.getNAN();s.mulDoubleThis(2);let l=r.clone();l.mulThis(r);let u=i.clone();u.mulThis(i);let d=l.clone();d.addThis(u);let f=a.clone();f.mulThis(a);let p=o.clone();p.mulThis(o);let m=f.clone();m.addThis(p);let h=i.clone();h.mulThis(m),c=o.clone(),c.mulThis(d),h.subThis(c),h.divThis(s);let g=r.clone();return g.mulThis(m),c=a.clone(),c.mulThis(d),g.subThis(c),g.divThis(s),$.construct(e.x-h.value(),e.y+g.value())}export{w as $,re as A,J as B,kt as C,$e as D,d as E,Ze as F,U as G,ie as H,X as I,A as J,i as K,Tt as L,Q as M,Ke as N,Et as O,$ as P,Nt as Q,en as R,nt as S,y as T,$t as U,Qt as V,Mt as W,Ue as X,vt as Y,p as Z,zt as _,j as a,Ot as a0,dt as a1,Ft as a2,Dt as a3,Re as a4,He as a5,It as a6,ht as a7,mt as a8,b as a9,ee as aA,Te as aB,rt as aC,Jt as aD,Ie as aE,Gt as aF,We as aG,ge as aH,ue as aI,F as aJ,de as aK,yt as aL,ze as aM,Qe as aa,Lt as ab,Le as ac,f as ad,qt as ae,tt as af,se as ag,ce as ah,Ve as ai,O as aj,Vt as ak,Wt as al,ot as am,Z as an,ae as ao,oe as ap,x as aq,Yt as ar,E as as,D as at,Bt as au,Ht as av,Ee as aw,De as ax,Ye as ay,S as az,I as b,L as c,R as d,fe as e,T as f,Y as g,qe as h,W as i,_t as j,ut as k,at as l,Xe as m,it as n,z as o,we as p,et as q,k as r,Rt as s,gt as t,pe as u,Ge as v,Be as w,Je as x,le as y,ne as z};
|
|
2
|
+
import{a as e,g as t,r as n,b as r}from"./Geometry.js";class i{constructor(e){this.sum=e,this.compensation=0}assign(e){return this.compensation=e.compensation,this.sum=e.sum,this}reset(){this.sum=this.compensation=0}resetToStart(e){this.sum=e,this.compensation=0}normalize(){let e=[NaN];this.sum=P(this.sum,this.compensation,e),this.compensation=e[0]}add(e){let t=this.sum+e,n;if(Math.abs(this.sum)>=Math.abs(e)){let r=this.sum-t+e;n=this.compensation+r}else{let r=e-t+this.sum;n=this.compensation+r}this.sum=t,this.compensation=n}sub(e){this.add(-e)}addProduct(e,t){let n=[0],r=N(e,t,n);this.add(r),this.add(n[0])}mul(e){let t=new i(0);t.addProduct(this.sum,e),t.addProduct(this.compensation,e),this.assign(t)}getResult(){return this.sum+this.compensation}pe(e){return this.add(e),this}me(e){return this.add(-e),this}sum;compensation}const a=[5,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1],o=[-1,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3];function s(e){let t=0;return e&65535n||(t+=16,e>>=16n),e&255n||(t+=8,e>>=8n),e&15n||(t+=4,e>>=4n),t+a[Number(BigInt.asUintN(4,e))]}function c(e){let t=0;return e&4294901760n&&(t+=16,e>>=16n),e&65280n&&(t+=8,e>>=8n),e&240n&&(t+=4,e>>=4n),t+o[Number(BigInt.asUintN(4,e))]+1}function l(e){let t=0;return e&4294967295n||(t=32,e>>=32n),t+s(BigInt.asUintN(32,e))}function u(e){let t=0;return e&18446744069414584320n&&(t=32,e>>=32n),t+c(e)}class d{m_EnvelopeType=1;vmin;vmax;constructor(e,t){if(e===void 0){this.setEmpty();return}if(e instanceof d){this.vmin=e.vmin,this.vmax=e.vmax;return}this.vmin=e,this.vmax=t,this.normalize()}static construct(e,t){return new d(e,t)}static constructEmpty(){return new d}setCoords(e,t){this.vmin=e,this.vmax=t,this.normalize()}setCoordsFromEnvelope(e){this.vmin=e.vmin,this.vmax=e.vmax}setEmpty(){this.vmin=NaN,this.vmax=NaN}getCenter(){return .5*(this.vmin+this.vmax)}equalsRange(e,t){return U(this.vmin,e)&&U(this.vmax,t)}equals(e,t){return this.isEmpty()&&e.isEmpty()?!0:t===void 0?this.vmin===e.vmin&&this.vmax===e.vmax:Math.abs(this.vmin-e.vmin)<=t&&Math.abs(this.vmax-e.vmax)<=t}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=-1/0,this.vmax=1/0}move(e){this.isEmpty()||(this.vmin+=e,this.vmax+=e)}contains(e){return e.vmin>=this.vmin&&e.vmax<=this.vmax}containsCoordinate(e){return e>=this.vmin&&e<=this.vmax}containsRightExclusive(e){return e>=this.vmin&&e<this.vmax}containsExclusiveCoordinate(e){return e>this.vmin&&e<this.vmax}containsExclusive(e){return e.vmin>this.vmin&&e.vmax<this.vmax}isIntersecting(e){return this.vmin<=e.vmin?this.vmax>=e.vmin:e.vmax>=this.vmin}mergeCoordinate(e){if(this.isEmpty()){this.vmin=e,this.vmax=e;return}this.mergeNeCoordinate(e)}merge(e){if(e.isEmpty())return;let t=e.vmin,n=e.vmax;this.mergeCoordinate(t),this.mergeCoordinate(n)}mergeNe(e){let t=e.vmin,n=e.vmax;this.mergeNeCoordinate(t),this.mergeNeCoordinate(n)}mergeNeCoordinate(e){e<this.vmin?this.vmin=e:e>this.vmax&&(this.vmax=e)}intersect(e){if(this.isEmpty()||e.isEmpty()){this.setEmpty();return}this.vmin<e.vmin&&(this.vmin=e.vmin),this.vmax>e.vmax&&(this.vmax=e.vmax),this.vmin>this.vmax&&this.setEmpty()}inflate(e){this.isEmpty()||(this.vmin-=e,this.vmax+=e,this.vmax<this.vmin&&this.setEmpty())}normalize(){this.vmin<=this.vmax||(this.vmin>this.vmax?this.vmax=L(this.vmin,this.vmin=this.vmax):this.setEmpty())}isValid(){return this.isEmpty()||this.vmin<=this.vmax}snapClip(e){return Rt(e,this.vmin,this.vmax)}calculateToleranceFromEnvelope(){return this.isEmpty()?Y():(Math.abs(this.vmin)+Math.abs(this.vmax)+1)*Y()}static unit(){return f}normalizeNoNAN(){this.vmin>this.vmax&&(this.vmax=L(this.vmin,this.vmin=this.vmax))}setCoordsNoNAN(e,t){this.vmin=e,this.vmax=t,this.normalizeNoNAN()}clone(){return new d(this.vmin,this.vmax)}}const f=new d(0,1);class p{m_value;m_eps;static getNAN(){return new p(NaN)}constructor(e,t){this.m_value=e??0,this.m_eps=t??0}[Symbol.toPrimitive](e){return this}clone(){return new p(this.m_value,this.m_eps)}assign(e){return this.m_value=e.m_value,this.m_eps=e.m_eps,this}scaleError(e){this.m_eps*=e}setError(e){this.m_eps=e}set(e,t){return this.m_value=e,this.m_eps=t??0,this}setWithEps(e,t){return t===void 0&&(t=1),this.m_value=e,this.m_eps=p.ulp(e)*t,this}setE(e){return this.m_value=e.m_value,this.m_eps=e.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(e){return this.clone().addThis(e)}addE(e){return this.clone().addThisE(e)}addThisE(e){let t=this.m_value+e.m_value,n=this.m_eps+e.m_eps+p.ulp(t);return this.m_value=t,this.m_eps=n,this}addThis(e){let t=this.m_value+e,n=this.m_eps+p.ulp(t);return this.m_value=t,this.m_eps=n,this}subE(e){return this.clone().subThisE(e)}sub(e){return this.clone().subThis(e)}subThisE(e){let t=this.m_value-e.m_value,n=this.m_eps+e.m_eps+p.ulp(t);return this.m_value=t,this.m_eps=n,this}subThis(e){let t=this.m_value-e,n=this.m_eps+p.ulp(t);return this.m_value=t,this.m_eps=n,this}setAddE(e,t){return this.m_value=e.m_value+t.m_value,this.m_eps=e.m_eps+t.m_eps+p.ulp(this.m_value),this}setAdd(e,t){return this.m_value=e+t,this.m_eps=p.ulp(this.m_value),this}setAddEN(e,t){return this.m_value=e.m_value+t,this.m_eps=e.m_eps+p.ulp(this.m_value),this}setAddNE(e,t){return this.m_value=e+t.m_value,this.m_eps=t.m_eps+p.ulp(this.m_value),this}setSubE(e,t){return this.m_value=e.m_value-t.m_value,this.m_eps=e.m_eps+t.m_eps+p.ulp(this.m_value),this}setSub(e,t){return this.m_value=e-t,this.m_eps=p.ulp(this.m_value),this}setSubEN(e,t){return this.m_value=e.m_value-t,this.m_eps=e.m_eps+p.ulp(this.m_value),this}setSubNE(e,t){return this.m_value=e-t.m_value,this.m_eps=t.m_eps+p.ulp(this.m_value),this}mulThisE(e){let t=this.m_value*e.m_value;return this.m_eps=this.m_eps*Math.abs(e.m_value)+e.m_eps*Math.abs(this.m_value)+this.m_eps*e.m_eps+p.ulp(t),this.m_value=t,this}mulThis(e){let t=this.m_value*e;return this.m_eps=this.m_eps*Math.abs(e)+p.ulp(t),this.m_value=t,this}mul(e){return this.clone().mulThis(e)}mulE(e){return this.clone().mulThisE(e)}setMulE(e,t){let n=e.m_value*t.m_value;return this.m_eps=e.m_eps*Math.abs(t.m_value)+t.m_eps*Math.abs(e.m_value)+e.m_eps*t.m_eps+p.ulp(n),this.m_value=n,this}setMul(e,t){return this.m_value=e*t,this.m_eps=p.ulp(this.m_value),this}setMulEN(e,t){return this.setE(e),this.mulThis(t)}setMulNE(e,t){return this.setE(t),this.mulThis(e)}mulThisByPower2(e){return this.m_value*=e,this.m_eps*=Math.abs(e),this}static st_mulByPower2(e,t){return new p(e.m_value,e.m_eps).mulThisByPower2(t)}divE(e){return this.clone().divThisE(e)}divThisE(e){let t=Math.abs(e.m_value),n=this.m_value/e.m_value,r=(this.m_eps+Math.abs(n)*e.m_eps)/t;if(e.m_eps>.01*t){let n=e.m_eps/t;r*=1+(1+n)*n}return this.m_value=n,this.m_eps=r+p.ulp(n),this}divThis(e){let t=Math.abs(e);return this.m_value/=e,this.m_eps=this.m_eps/t+p.ulp(this.m_value),this}setDivE(e,t){return this.setE(e),this.divThisE(t)}setDiv(e,t){return this.m_value=e/t,this.m_eps=p.ulp(this.m_value),this}setDivEN(e,t){return this.setE(e),this.divThis(t)}setDivNE(e,t){return this.set(e),this.divThisE(t)}divThisByPower2(e){return this.m_value/=e,this.m_eps/=Math.abs(e),this}invThis(){return this.setE(b.clone().divThisE(this)),this}sqrt(){return this.clone().sqrtThis()}sqrtThis(){let e,t;return this.m_value>=0?(e=Math.sqrt(this.m_value),t=this.m_value>10*this.m_eps?.5*this.m_eps/e:this.m_value>this.m_eps?e-Math.sqrt(this.m_value-this.m_eps):Math.max(e,Math.sqrt(this.m_value+this.m_eps)-e),t+=p.ulp(e)):this.m_value<-this.m_eps?(e=NaN,t=NaN):(e=0,t=Math.sqrt(this.m_eps)),this.m_value=e,this.m_eps=t,this}sqr(){return this.clone().sqrThis()}sqrThis(){let e=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(e),this.m_value=e,this}setSin(e){let t=Math.sin(e.m_value),n=Math.cos(e.m_value);this.m_value=t;let r=Math.abs(t),i=Math.abs(e.value());return this.m_eps=(Math.abs(n)+r*.5*e.m_eps)*e.m_eps+p.ulp(r+i),this}static ulp(e){let t=B(e),n=((t&9218868437227405312n)>>52n)-1075n;return n>-1023n?(t=n+1023n<<52n,ft(t)):e===0?0:Number.MIN_VALUE}setCos(e){let t=Math.sin(e.m_value),n=Math.cos(e.m_value);this.m_value=n;let r=Math.abs(n),i=Math.abs(e.value());return this.m_eps=(Math.abs(t)+r*.5*e.m_eps)*e.m_eps+p.ulp(r+i),this}static st_cosAndSin(e,t,n){let r=Math.sin(e.m_value),i=Math.cos(e.m_value);n.m_value=r,t.m_value=i;let a=Math.abs(r),o=Math.abs(i),s=Math.abs(e.value());n.m_eps=(Math.abs(i)+a*.5*e.m_eps)*e.m_eps+p.ulp(a+s),t.m_eps=(Math.abs(r)+o*.5*e.m_eps)*e.m_eps+p.ulp(o+s)}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(e){return d.construct(this.m_value-this.m_eps,this.m_value+this.m_eps).isIntersecting(e)}isInIntervalExclusive(e){let t=e.vmin+this.m_eps,n=e.vmax-this.m_eps;return t<this.m_value&&n>this.m_value}eq(e){return Math.abs(this.m_value-e.m_value)<=this.m_eps+e.m_eps}ne(e){return!this.eq(e)}gt(e){return this.m_value-e.m_value>this.m_eps+e.m_eps}lt(e){return e.m_value-this.m_value>this.m_eps+e.m_eps}ge(e){return!this.lt(e)}le(e){return!this.gt(e)}tolEQ(e,t){return Math.abs(this.m_value-e.m_value)<=t||this.eq(e)}tolNE(e,t){return!this.tolEQ(e,t)}tolGT(e,t){return this.m_value-e.m_value>t&&this.gt(e)}tolLT(e,t){return e.m_value-this.m_value>t&&this.lt(e)}tolGE(e,t){return!this.tolLT(e,t)}tolLE(e,t){return!this.tolGT(e,t)}isZero(){return Math.abs(this.m_value)<=this.m_eps}isFuzzyZero(){return this.isZero()&&this.m_eps!==0}tolIsZero(e){return Math.abs(this.m_value)<=Math.max(this.m_eps,e)}setPi(){this.setE(v)}setEuler(){this.set(2.718281828459045,_())}static dimensions=1;static size(){return 1}}function m(e,t){let n=V(e),r=V(t),i=53-l(n),a=53-l(r);return(i>=0?i:0)+(a>=0?a:0)<=52}function h(e,t){let n=e,r=t,i=n+r;return i-n===r&&i-r===n}function g(e,t){let n=e,r=t,i=n-r;return n-i===r&&r+i===n}function _(){return X()}const v=new p(Math.PI,_()*.5),y=new p(0,0),b=new p(1,0),x=new p(4,0);function S(e,t,n){return e.addE(t.subE(e).mulE(n))}function ee(e,t,n){return t.subE(t.subE(e).mulE(b.subE(n)))}function te(e){return Math.atanh(e)}function ne(e){let t;if(e===0)t=1;else if(Math.abs(e)>.01)t=te(e)/e;else{let n;t=0;let r=e*e,i=Math.trunc(-36.841361487904734/Math.log(r)+2.5);for(let e=2*i-1;e>1;e-=2)n=1/e,t=(t+n)*r;t+=1}return t}function C(e){let t=Math.PI*Math.PI/6,n;if(e===1)n=t;else if(e>1)n=t;else if(e===0)n=e;else if(e<0){e=Math.abs(e);let t=1+e,r=Math.log(t);n=r*r/-2-C(e/t)}else if(e>.5){let r=1-e,i=Math.log(e)*Math.log(r);n=t-C(r)-i}else{n=0;let t=1+Math.trunc(-16*Math.log(10)/Math.log(e)+1.5),r=t;for(let i=t;i>0;i--,--r)n*=e,n+=1/(r*r);n*=e}return n}function re(e,t){let n=t*e;if(Math.abs(t)<.1){let t=0;for(let e=60;e>=1;e--)t*=n,t+=1/e/e;return t*=e,t}return C(n)/t}function w(e,t){return e<t?z(e,t):z(t,e)}function T(e,t){let n=Math.abs(e);return t>=0?n:-n}function ie(e){return Math.round(e)}function E(e,t,n,r,i){i[0]=t[0]+(n[0]-t[0])*r,i[1]=t[1]+(n[1]-t[1])*r,e===3&&(i[2]=t[2]+(n[2]-t[2])*r)}function D(e,t,n,r,i){i[0]=n[0]-(n[0]-t[0])*(1-r),i[1]=n[1]-(n[1]-t[1])*(1-r),e===3&&(i[2]=n[2]-(n[2]-t[2])*(1-r))}function O(e,t,n,r,i){r<=.5?E(e,t,n,r,i):D(e,t,n,r,i)}function ae(e,t,n,r,i){i[0]=t[0].addE(n[0].subE(t[0]).mulE(r)),i[1]=t[1].addE(n[1].subE(t[1]).mulE(r))}function oe(e,t,n,r,i){i[0]=n[0].subE(n[0].subE(t[0]).mulE(b.subE(r))),i[1]=n[1].subE(n[1].subE(t[1]).mulE(b.subE(r)))}function k(e,t,n){let r;return r=n<=.5?e+(t-e)*n:t-(t-e)*(1-n),r}function se(e,t,n){return e+(t-e)*n}function ce(e,t,n){return t-(t-e)*(1-n)}function A(e,t,n,r){n<=.5?(r.x=e.x+(t.x-e.x)*n,r.y=e.y+(t.y-e.y)*n):(r.x=t.x-(t.x-e.x)*(1-n),r.y=t.y-(t.y-e.y)*(1-n))}function le(e,t,n,r){n<=.5?(r.x=e.x+(t.x-e.x)*n,r.y=e.y+(t.y-e.y)*n,r.z=e.z+(t.z-e.z)*n):(r.x=t.x-(t.x-e.x)*(1-n),r.y=t.y-(t.y-e.y)*(1-n),r.z=t.z-(t.z-e.z)*(1-n))}function j(e){return e*e}function ue(e){return e*e*e}function de(e){return 1/Math.sqrt(e)}function fe(e){return e<0?-1:+(e>0)}function pe(e,t,n,r){let i=[0],a=N(e,n,i),o=[0],s=N(t,r,o),c=[0];return P(a,s,c)+(i[0]+o[0]+c[0])}const me=[0],he=[0];function ge(e,t,n){return Ce(N(e,t,me),n,me[0],he)}const M=[0],_e=[0],ve=[0],ye=[0];function N(e,t,n){let r=e*t;return be(e,M,_e),be(t,ve,ye),n[0]=_e[0]*ye[0]-(r-M[0]*ve[0]-_e[0]*ve[0]-M[0]*ye[0]),r}function be(e,t,n){let r=134217729*e;t[0]=r-(r-e),n[0]=e-t[0]}const xe=[0],Se=[0];function Ce(e,t,n,r){return P(P(P(e,t,xe),n,Se),xe[0]+Se[0],r)}function P(e,t,n){let r=e+t;return n[0]=Math.abs(e)>Math.abs(t)?e-r+t:t-r+e,r}function we(e,t){return e%t}function Te(e){let t=1-e;if(t===0)return 1;let n;if(t<=.01){let e=t,r=Math.log(e);n=1+e*(.4431471805599453-.25*r+e*(.05680519270997949-.09375*r+e*(.02183137044373718-.05859375*r+e*(.011544521417308362-.042724609375*r+e*(.00714200031339596-.0336456298828125*r+e*(.004854743337164948-.027757644653320312*r+e*(.003514687963781376-.023627042770385742*r)))))))}else if(e<.016){let t=e;return Z()*(1-t*(.25+t*(.046875+t*(.01953125+t*(.01068115234375+t*(.0067291259765625+t*(.004626274108886719+t*(.0033752918243408203+t*.0025710230693221092))))))))}else n=Oe(0,t,1)-e*ke(0,t,1)/3;return Rt(n,1,Z())}function Ee(e,n,r=NaN){if(t(n>=0&&n<=1),n===0)return e;let i=1,a=e;if(a<0&&(a=-a,i=-1),n===1){let e=Math.round(a/Vt()),t=a-e*Vt(),n=2*e+Math.sin(t);return i*n}let o=Z(),s=Math.floor(a/o);s&1?a=(s+1)*o-a:a-=s*o;let c=Math.sin(a),l=Number.isNaN(r)?Te(n):r,u;if(c===1)u=l+Math.sqrt(1-n)*(a-o);else{let e=a*a;if(.01424*e**4<=2*X())u=a*(1+e*n*(-1/6+e*((4-3*n)/120-(16+(-60+45*n)*n)/5040*e)));else if(n<=.01){let e=Math.sin(2*a),t=Math.sin(4*a),r=Math.sin(6*a),i=Math.sin(8*a),o=Math.sin(10*a),s=Math.sin(12*a),c=n;u=a+c*((-a*2+e)/8+c*((-3*a+2*e-t*.25)/64+c*((-20*a+15*e-3*t+r/3)/1024+c*(5*(-140*a+112*e-28*t+16/3*r-.5*i)/65536+c*7*((-63*a+52.5*e-15*t+3.75*r-.625*i+.05*o)/65536+c*(-693*a+594*e-185.625*t+1.375*r-12.375*i+1.8*o-.125*s)/1048576)))))}else{let e=c*c,t=Math.cos(a),r=t*t,i=Ae(c,t,n);u=c*(Oe(r,i,1)-n*e*ke(r,i,1)/3)}}return s&1?u=l*(s+1)-u:u+=l*s,i*u}function De(e,t,n=NaN){if(e===0)return 0;let r=1,i=e;e<0&&(i=-i,r=-1);let a=Number.isNaN(n)?Te(t):n,o=Math.floor(i/a);o&1?i=(o+1)*a-i:i-=o*a;let s=i<=0?0:i>=a?Z():je(i,t,a);return o&1?s=Z()*(o+1)-s:s+=Z()*o,r*s}function Oe(e,n,r){t((e===0?0:1)+(n===0?0:1)+1>1);let i=e,a=n,o=r;for(;;){let e=Math.sqrt(i*a),t=Math.sqrt(a*o),n=Math.sqrt(o*i),r=e+t+n;i=.25*(i+r),a=.25*(a+r),o=.25*(o+r);let s=(i+a+o)/3,c=(s-i)/s,l=(s-a)/s,u=(s-o)/s;if(Math.abs(c)<=.0024&&Math.abs(l)<=.0024&&Math.abs(u)<=.0024){let e=c*l-u*u,t=c*l*u;return(1+(-.1+1/24*e-3/44*t-5*e*e/208+e*t/16)*e+(1/14+3*t/104)*t)/Math.sqrt(s)}}}function ke(e,n,r){t(e!==0||n!==0);let a=e,o=n,s=r,c=new i(0),l=1;for(;;){let e=(a+o+3*s)*.2,t=(e-a)/e,n=(e-o)/e,r=(e-s)/e;if(Math.abs(t)<=.0015&&Math.abs(n)<=.0015&&Math.abs(r)<=.0015){let i=t*n,a=r*r,o=i-a,s=i-6*a,u=s+o+o,d=3/26,f=s*(-.21428571428571427+.10227272727272728*s-1.5*d*r*u),p=r*(.16666666666666666*u+r*(-.4090909090909091*o+r*d*i));return 3*c.getResult()+l*(1+f+p)/(e*Math.sqrt(e))}let i=Math.sqrt(a),u=Math.sqrt(o),d=Math.sqrt(s),f=i*(u+d)+u*d;c.add(l/(d*(s+f))),l*=.25,a=(a+f)*.25,o=(o+f)*.25,s=(s+f)*.25}}function Ae(e,t,n){return e<.999?1-n*j(e):1-n+n*j(t)}function je(e,t,n){if(t===0)return e;if(t===1)return Math.asin(e);let r=0,i=!0;if(e<.2){let n=e*e,a=e*(1+n*t*(1/6+n*((13*t-4)/120+(16-284*t+493*t*t)/5040*n))),o=Math.abs(t*(-64+4944*t-31224*t*t+37369*t*t*t)/362880*e**9);if(o<Math.abs(a)*X())return a;r=a,i=o>a*.1}if(i){let i=1-t,a=1-e/n,o=Math.sqrt(a*a+i*i),s=Math.atan2(i,e+X());r=Z()+Math.sqrt(o)*(s-Z())}let a=0;for(let i=0;i<7;i++){a=Ee(r,t,n);let o=Ae(Math.sin(r),Math.cos(r),t);if(r-=(a-e)/Math.sqrt(o),i>0&&Math.abs(a-e)<=4*X()*e)break}return r}class Me{values;constructor(e){for(this.values=[[1]];this.values.length<e+1;){let e=this.values.at(-1),t=R(e.length+1,1);for(let n=1;n<e.length;++n)t[n]=e[n-1]+e[n];this.values.push(t)}}get(e,t){return this.values[e][t]}}function Ne(e,n){return t(0),0}const Pe=new Me(32);function F(e,t){if(e<Pe.values.length)return Pe.get(e,t);let r=Math.exp(Ne());return r+.01>W()&&n(`The result value of n choose k is out of range`),r+.01}function Fe(e,t){if(e.isZero())return e.clone();let n=e.clone().divThis(e);if(t<0)return n.divThis(Fe(e,-t));for(e=e.clone(),t=Math.trunc(t);t&1&&n.mulThis(e),t>>=1,t;)e.mulThis(e);return n}function Ie(e,t){if(t===0)return[];let n=e[0].clone().mulDoubleThis(0),r=[];r.length=t;let i=t-1;for(let t=0;t<=i;++t){r[t]=n.clone();for(let n=0;n<=t;++n)r[t].addThis(e[n].clone().mulDoubleThis(F(t,n)/F(i,n)))}return r}function Le(t,n,r,i,a){if(t===0)return i===0?n:i===1?r:a;if(t===1)return i===0?n:i===1?r:k(n,r,i);t===2&&e(`angular interpolation`),e(``)}function Re(t,n,r,i,a,o,s,c){if(t===0)for(let e=0;e<o;++e)i[e+a]=s===0?n[e]:s===1?r[e]:c;else if(t===1){if(s===0)I(i,n,a,0,o);else if(s===1)I(i,r,a,0,o);else for(let e=0;e<o;++e)i[e+a]=k(n[e],r[e],s)}else if(t===2){if(s===0)I(i,n,a,0,o);else if(s===1)I(i,r,a,0,o);else{let e=0;for(let t=0,c=a;t<o;++t,++c)i[c]=k(n[t],r[t],s),e+=i[c]*i[c];if(e>0){e=Math.sqrt(e);for(let t=a;t<a+o;++t)i[t]/=e}else{for(let e=a;e<a+o;++e)i[e]=0;i[a]=1}}}else e(``)}function I(e,t,n,r,i){if(i===0)return;let a=0,o=n,s=r;for(;a++<i;)e[o++]=t[s++]}function ze(e,t,n){let r=0;for(let i=0;!r&&i<n;++i)r=e[i]-t[i];return r}function L(e,t){return e}function Be(e){e.sort((e,t)=>e<t?-1:+(e>t))}function Ve(e,t){let n=e.slice(0,t);Be(n),I(e,n,0,0,t)}function He(e,t,n,r){let i=e.slice(t,t+n);i.sort(r),I(e,i,t,0,n)}function Ue(e,t){return e<t?-1:+(e>t)}function We(e,t,n,r){return e<n?-1:e>n?1:t<r?-1:+(t>r)}function Ge(e,t){if(e.length<2)return e.length;let n=0;for(let r=1;r<e.length;++r)t(e[r],e[n])||(n++,e[r]=L(e[n],e[n]=e[r]));return 1+n}function Ke(e,t){e[t]=e.at(-1),e.pop()}function qe(e,t=!1){return{[Symbol.dispose](){this.bForget||e()},bForget:t}}function Je(e,t,n){e.length=t,e.fill(n)}function Ye(e,t,n){e.length=n;for(let r=0;r<n;++r)e[r]=new t}function Xe(e,t){let n=Array(t);for(let r=0;r<t;++r)n[r]=new e;return n}function Ze(e,t,n){for(let r=0;r<n;++r)e[r].assign(t[r]);return n}function Qe(e,t){let n=e.slice(0,t);for(let e=0;e<t;++e)n[e]=n[e].clone();return n}function $e(e){return Array.from({length:e},()=>null)}function et(e,t){return Array.from({length:t},()=>e())}function R(e,t){let n=Array(e);return n.fill(t),n}function tt(e,t){return t in e&&Object.getOwnPropertyNames(e).length===1}class nt{m_elts;constructor(...e){this.m_elts=e}get length(){return this.m_elts.length}at(e){return this.m_elts[e]}[Symbol.dispose](){for(let e of this.m_elts)e[Symbol.dispose]()}}function z(e,t){return{first:e,second:t}}const rt=Math.PI,it=2*Math.PI,at=.5*Math.PI;class ot{m_cr;m_cc;m_v;constructor(e,t){this.m_cr=e,this.m_cc=t,this.m_v=R(e*t,0)}get(e,t){return this.m_v[e*this.m_cc+t]}set(e,t,n){this.m_v[e*this.m_cc+t]=n}inc(e,t){return++this.m_v[e*this.m_cc+t]}}const st=new ArrayBuffer(8),ct=new Float64Array(st),lt=new BigUint64Array(st),ut=0x2386f26fc10000;function dt(){return 2**-52*Pt}function B(e){return ct[0]=e,lt[0]}function ft(e){return lt[0]=e,ct[0]}function V(e){return B(e)&4503599627370495n}function pt(e){return Number((B(e)&9218868437227405312n)>>52n)}function H(e){if(e===0n)return-1n;if(e===1n||e===-1n)return 0n;e<0n&&(e=-e);let t=0n,n=512n,r=1n<<t+n;for(;e>=r;)t+=n,n<<=1n,r<<=n;let i=t;n>>=1n;let a=i+n;for(;n>0n;)e<1n<<a||(i=a),n>>=1n,a=i+n;return i}function U(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function mt(e,t,n){return e===t||Math.abs(e-t)<=n||Number.isNaN(e)&&Number.isNaN(t)}function ht(e,t){return e<t?-1:+(e>t)}function gt(e,t){if(e<t)return-1;if(e>t)return 1;if(e===t)return 0;{let n=Number.isNaN(e),r=Number.isNaN(t);return n<r?-1:+(n>r)}}function _t(){return 2147483647}function vt(){return 32767}function W(){return 2147483647}function yt(){return-2147483648}const G=W(),bt=BigInt(G),xt=2166136261,K=16777619;function St(e){let t=xt,n=e;return t=(t^n&255)*K,n>>=8,t=(t^n&255)*K,n>>=8,t=(t^n&255)*K,n>>=8,t=(t^n&255)*K,t&G}const q=1099511628211n;function Ct(e){let t=14695981039346656037n,n=e;return t=(t^n&255n)*q,n>>=8n,t=(t^n&255n)*q,n>>=8n,t=(t^n&255n)*q,n>>=8n,t=(t^n&255n)*q,n>>=8n,t=(t^n&255n)*q,n>>=8n,t=(t^n&255n)*q,n>>=8n,t=(t^n&255n)*q,t&bt}function wt(e){return 1103515245*e+12345&2147483647}function Tt(e){let t=xt;for(let n=0,r=e.length;n<r;++n)t=(t^e.charCodeAt(n))*K;return t&G}function J(e,t){return t+2654435769+(e<<6)+(e>>2)&G}function Et(e,t){return J(e,At(t))}function Dt(e){return J(3735928559,e)}function Ot(e,t){return J(e,Dt(t))}function kt(e){return St(e)}function At(e){return Number(Ct(e))}function jt(e){return Gt(e)}function Mt(e){return At(B(jt(e)))}function Nt(e){return wt(e)}const Pt=100;function Y(){return 2**-52*100}function Ft(){return .38196601125010515}function It(){return 1.4142135623730951}function X(){return 2**-52}function Lt(e,t,n){return e===t||e===n}function Rt(e,t,n){return e>=t?e<=n?e:n:t}function zt(e,t,n){let r=e[0];if(!(r>=t))e[0]=t;else if(!(r<=n))e[0]=n;else return!1;return!0}function Bt(e,t){return e>=t?t:e<-t?-t:e}function Vt(){return rt}function Ht(){return it}function Z(){return at}const Ut=3*Z();function Wt(){return Ut}function Gt(e){return e+0}function Kt(e){return{v:e}}class Q{static s_sm=9223372036854775808n;static s_em=9218868437227405312n;static s_fm=4503599627370495n;static s_emax=2047n;m_rn=Kt(0n);m_rd=Kt(1n);m_bNaN=!1;m_bNormalized=!1;m_power=0;m_sign=0;static constructAssign(e,t){let n=e.clone();return t!==void 0&&n.limitPrecisionThis(t),n}static constructDouble(e){return new Q().setDouble(e)}static constructInt64(e){return new Q().setInt64(e)}static constructRational(e,t){return new Q().setRational(e,t)}static constructInt32(e){return this.constructInt64(BigInt(Math.trunc(e)))}[Symbol.toPrimitive](e){return this}compare(e){return this.lt(e)?-1:+!!this.gt(e)}assignCopy(e){return this.setThis(e)}abs(){return this.clone().absThis()}absThis(){return this.isNAN()||(this.m_sign*=this.m_sign),this}clone(){return new Q().setThis(this)}setThis(e){return this.m_bNaN=e.m_bNaN,this.m_bNormalized=e.m_bNormalized,this.m_rn.v=e.m_rn.v,this.m_rd.v=e.m_rd.v,this.m_power=e.m_power,this.m_sign=e.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(t){if(this.setZero(),t===0)return this;if(Number.isInteger(t)&&Math.abs(t)<W())return this.setInt32(t);let n=B(t),r=(n&Q.s_em)>>52n,i=!!(n&Q.s_sm),a=n&Q.s_fm;if(r===Q.s_emax)return a?(this.m_rn.v=this.m_rd.v=0n,this.m_bNaN=!0,this):(this.m_rn.v=i?-1n:1n,this.m_rd.v=0n,this);r===0n&&e(`denormalized numbers not yet implemented`);let o=r-1023n,s=o>=0n?o:0n,c=o<0n?-o:0n;return this.m_rn.v=(1n<<52n|a)<<s,this.m_rd.v=1n<<52n+c,this.m_sign=i?-1:1,this.m_bNormalized=!1,this.normalizeThis()}setInt64(e){return e===0n?this.setZero():(this.m_bNaN=!1,this.m_sign=e>0n?1:-1,this.m_rn.v=e>0n?e:-e,this.m_rd.v=1n,this.m_power=0,this.m_bNormalized=!1,this.normalizeThis())}setRational(e,t){return e===0n?t===0n?this.setNAN():this.setZero():t===0n?e>0n?this.setPositiveInf():this.setNegativeInf():(this.m_sign=(e>0n?1:-1)*(t>0n?1:-1),this.m_rn.v=e>0n?e:-e,this.m_rd.v=t>0n?t:-t,this.m_power=0,this.m_bNormalized=!1,this.normalizeThis())}setInt32(e){return this.setInt64(BigInt(Math.trunc(e)))}getDouble(){return this.convertToDouble()}toDouble(){return this.convertToDouble()}value(){return this.convertToDouble()}isNAN(){return this.m_bNaN}isPositiveInf(){return!this.isNAN()&&this.m_rd.v===0n&&this.m_sign===1}isNegativeInf(){return!this.isNAN()&&this.m_rd.v===0n&&this.m_sign===-1}isFinite(){return!this.isNAN()&&this.m_rd.v!==0n}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(e){if(e.isNAN()&&this.setNAN(),this.isPositiveInf()&&e.isPositiveInf())this.setNAN();else if(this.isPositiveInf()&&e.isNegativeInf())return this.setPositiveInf(),this;else if(this.isNegativeInf()&&e.isNegativeInf())this.setNAN();else if(this.isNegativeInf()&&e.isPositiveInf())return this.setNegativeInf(),this;return this.isNAN()?this:this.opPlusMinus(e,!1)}thisSubAbs(e){return t(0),this}mulThis(e){return e.isNAN()&&this.setNAN(),this.isNAN()?this:(this.m_sign*=e.m_sign,this.m_sign===0?this.setZero():(this.m_rn.v*=e.m_rn.v,this.m_rd.v*=e.m_rd.v,this.m_power+=e.m_power,this.m_bNormalized=!1,this.normalizeThis(),this))}mulDoubleThis(e){return this.mulThis(Q.constructDouble(e))}thisMulInt64(e){return t(0),this}thisMulInt32(e){return t(0),this}divThis(e){return this.mulThis(e.clone().invertThis())}divDoubleThis(e){return this.divThis(Q.constructDouble(e))}addDoubleThis(e){return this.addThis(Q.constructDouble(e))}subDoubleThis(e){return this.subThis(Q.constructDouble(e))}mul(e){return this.clone().mulThis(e)}mulBigIntThis(e){return this.mulThis(Q.constructInt64(e))}mulDouble(e){return this.clone().mulThis(Q.constructDouble(e))}div(e){return this.clone().divThis(e)}divDouble(e){return this.clone().divDoubleThis(e)}add(e){return this.clone().addThis(e)}fmSubThis(e,t){return this.subThis(e.clone().mulThis(t))}fmAddThis(e,t){return this.addThis(e.clone().mulThis(t))}addThis(e){if(e.isNAN()&&this.setNAN(),this.isPositiveInf()&&e.isPositiveInf())return this.setPositiveInf(),this;if(this.isPositiveInf()&&e.isNegativeInf())this.setNAN();else if(this.isNegativeInf()&&e.isNegativeInf())return this.setNegativeInf(),this;else this.isNegativeInf()&&e.isPositiveInf()&&this.setNAN();return this.isNAN()?this:this.opPlusMinus(e,!0)}addDouble(e){return this.clone().addThis(Q.constructDouble(e))}sub(e){return this.clone().subThis(e)}subDouble(e){return this.clone().subThis(Q.constructDouble(e))}isZero(){return this.m_sign===0}equals(e){return this.clone().subThis(e).isZero()}lt(e){return this.isNAN()||e.isNAN()||this.isPositiveInf()&&e.isPositiveInf()||this.isNegativeInf()&&e.isNegativeInf()||this.isPositiveInf()?!1:e.isPositiveInf()?!0:this.clone().sub(e).LZ()}absLessAbs(e){return this.abs().lt(e.abs())}gt(e){return this.clone().sub(e).GZ()}lte(e){return this.sub(e).LEZ()}gte(e){return this.sub(e).GEZ()}normalizeThis(){if(this.m_bNormalized)return this;if(this.m_rn.v===0n)return this.setZero();let e=0,t=4294967295n;for(;(this.m_rn.v&t)===0n&&t<=this.m_rn.v;)t<<=32n,e+=32;t&=this.m_rn.v,t>>=BigInt(e),e+=s(BigInt.asUintN(32,t))-1;let n=0;for(t=4294967295n;(this.m_rd.v&t)===0n&&t<=this.m_rd.v;)t<<=32n,n+=32;return t&=this.m_rd.v,t>>=BigInt(n),n+=s(BigInt.asUintN(32,t))-1,this.m_rn.v>>=BigInt(e),this.m_rd.v>>=BigInt(n),this.m_power+=e-n,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):this.m_rn.v===0n?(this.setPositiveInf(),this):(this.m_rd=L(this.m_rn,this.m_rn=this.m_rd),this.m_power=-this.m_power,this)}limitPrecisionThis(e){if(e===0)return this;if(this.isZero())return this.setZero();if(!this.isFinite())return this;this.normalizeThis();let t=Number(H(this.m_rn.v));if(t>e){let n=t-e;this.m_rn.v>>=BigInt(t-e),this.m_power+=n}if(t=Number(H(this.m_rd.v)),t>e){let n=t-e;this.m_rd.v>>=BigInt(t-e),this.m_power-=n}return this}hiBitIndex(){return Math.max(Number(H(this.m_rn.v)),Number(H(this.m_rd.v)))}ldexp(e){return this.clone().ldexpThis(e)}ldexpThis(e){return e&&(this.m_bNormalized=!1,this.m_power+=e,this.normalizeThis()),this}static lerp(e,t,n){return Q.lerpLo(t,t,n)}static lerpLo(e,t,n){return t.sub(e).mulThis(n).addThis(e)}static lerpHi(e,t,n){return t.sub(e).mulThis(qt.sub(n)).addThis(e)}LZ(){return!this.isNAN()&&this.m_sign===-1}GZ(){return!this.isNAN()&&this.m_sign===1}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(e,r){if(e.m_sign<0n&&n(`MP_value: sqrt(-1)`),e.isZero())return e.clone();let i=52,a=2220446049250313e-31;for(;i<r;)2*i<=r?(a*=a,i*=2):(a*=2220446049250313e-31,i+=52);i+=52;let o=H(e.m_rn.v),s=H(e.m_rd.v),c=e.m_power+Number(o-s),l,u=new Q;Math.abs(c)>200?(Math.abs(c)&1&&(c+=1),l=Q.constructAssign(e,53).ldexpThis(-c).value(),u.setThis(e).ldexpThis(-c),t(Number.isFinite(l))):(u.setThis(e),l=u.value(),t(Number.isFinite(l)),c=0),l=Math.sqrt(l);let d=Q.constructDouble(l),f=Q.constructDouble(a);f.mulThis(d).ldexpThis(1);let p=a*l*2,m=d.clone(),h=new Q,g;for(let e=0;e<10;++e){m.mulThis(d),h.setThis(u).subThis(m).absThis();let e=h.value();if(g=1,e<.9)for(;e>p;)e*=e,++g;else g=4;if(h.lte(f))break;for(let e=0;e<g;e++)m.setThis(d).divThis(u).invertThis().addThis(d).ldexpThis(-1).limitPrecisionThis(i),d.setThis(m)}return d.ldexpThis(c/2)}static cubicRoot(e,t){if(e.isZero())return e.clone();let n=52,r=2220446049250313e-31;for(;n<t;)2*n<=t?(r*=r,n*=2):(r*=2220446049250313e-31,n+=52);n+=52;let i=Math.abs(e.value())**(1/3),a=Q.constructDouble(i),o=a.clone();o.sqrThis().mulDoubleThis(3).mulDoubleThis(r),o.limitPrecisionThis(32),e.LZ()&&a.negateThis();for(let t=0;t<10;++t){let t=a.clone();t.sqrThis().mulThis(a);let r=t.clone();if(r.subThis(e),r.absThis().limitPrecisionThis(32),r.lte(o))break;r.setThis(e),r.ldexpThis(1),r.addThis(t);let i=t.clone();i.ldexpThis(1),i.addThis(e),r.divThis(i),a.mulThis(r),a.limitPrecisionThis(n)}return a}isInTheRangeOfDouble(){return t(0),!1}sign(){return this.m_sign}cosAndSin(e,n){t(0)}pow(e){return Fe(this,e)}static nan(){return t(0),new Q}convertToDouble(){if(this.m_bNaN)return NaN;if(this.isZero())return 0;if(this.m_rd.v===0n)return this.m_sign===1?1/0:-1/0;let e=this.m_sign===-1,t=this.m_rn.v<<(this.m_power>=0?BigInt(this.m_power):0n),n=this.m_rd.v<<(this.m_power<0?BigInt(-this.m_power):0n),r=t/n,i=Number(r);if(BigInt(i)!==r)return e?-i:i;let a=t-r*n;if(a){let e=H(n)-(1023n-0n);e>0n&&(n>>=e,a<<=52n,a>>=e);let t=Number(a);Number.isFinite(t)||(a>>=52n,t=Number(a),e=0n),e>0n&&(t/=2**52);let r=t/Number(n);i+=r}return e?-i:i}signVal(){return this.m_sign===1?1n:this.m_sign===-1?-1n:0n}opPlusMinus(e,t){let n=Math.min(this.m_power,e.m_power),r,i;this.m_power>n?(r=BigInt(this.m_power-n),i=0n):(r=0n,i=BigInt(e.m_power-n));let a=this.signVal()*this.m_rn.v*e.m_rd.v<<r,o=e.signVal()*e.m_rn.v*this.m_rd.v<<i;return this.m_rn.v=t?a+o:a-o,this.m_rd.v*=e.m_rd.v,this.m_power=n,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}}const qt=Q.constructInt32(1),Jt=Q.constructInt32(0),Yt=Q.constructDouble(.5);function Xt(e,t){return u(e^t)}function Zt(e,t){let n=pt(e),r=pt(t);if(n===r){let r=53-Xt(V(e),V(t));return n-=r,n}return n>r?n:r}function Qt(e,t){for(let n=0,r=0,i=e.length;n<i;n+=2,r++)t[r].x=e[n],t[r].y=e[n+1]}function $t(e){let t=new Float64Array(e.length*2);for(let n=0,r=e.length;n<r;++n){let r=n<<1;t[r]=e[n].x,t[r+1]=e[n].y}return t}function en(e){let t=Xe($,e.length);for(let n=0,r=e.length;n<r;++n)t[n].setCoords(e[n][0],e[n][1]);return t}class ${static dimensions=2;x;y;static d=[[0,1,0,-1],[-1,0,1,0],[0,-1,0,1],[1,0,-1,0]];static construct(e,t){return new $(e,t)}constructor(e,t){if(e===void 0){this.x=this.y=NaN;return}this.x=e,this.y=t}clone(){return new $(this.x,this.y)}assign(e){this.setCoordsPoint2D(e)}setCoords(e,t){return this.x=e,this.y=t,this}setCoordsPoint2D(e){this.x=e.x,this.y=e.y}isEqualPoint2D(e,t){return t===void 0?this.x===e.x&&this.y===e.y:Math.abs(this.x-e.x)<=t&&Math.abs(this.y-e.y)<=t}isEqual(e,t,n){return n===void 0?this.x===e&&this.y===t:Math.abs(this.x-e)<=n&&Math.abs(this.y-t)<=n}equalsPoint2D(e,t){return this.isEqualPoint2D(e,t)}setSub(e,t){this.x=e.x-t.x,this.y=e.y-t.y}addThis(e){return this.x+=e.x,this.y+=e.y,this}setAdd(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}absoluteOther(e){}absolute(){return t(0),this}setNegate(){this.x=-this.x,this.y=-this.y}setNegateOther(e){this.x=-e.x,this.y=-e.y}interpolateThis(e,t){}interpolate(e,n,r){t(0)}scaleAddThis(e,t){this.x=this.x*e+t.x,this.y=this.y*e+t.y}setScaleAdd(e,t,n){this.x=t.x*e+n.x,this.y=t.y*e+n.y}scaleOther(e,n){t(0)}scale(e){this.x*=e,this.y*=e}compare(e){return this.y<e.y?-1:this.y>e.y?1:this.x<e.x?-1:+(this.x>e.x)}compareX(e){return this.x<e.x?-1:this.x>e.x?1:this.y<e.y?-1:+(this.y>e.y)}normalizeOther(e){t(0)}normalize(){let e=this.length();return e?(this.x/=e,this.y/=e):(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(e,n){return t(0),{}}static average(e,t){let n=new $;if(t===0)return n.setNAN(),n;if(t===1)return n.assign(e[0]),n;let r=new i(e[0].x),a=new i(e[0].y);for(let n=1;n<t;n++)r.add(e[n].x),a.add(e[n].y),n&255||(r.normalize(),a.normalize());return n.x=r.getResult()/t,n.y=a.getResult()/t,n}static calculateLength(e,t){let n=new i(0);for(let r=1;r<t;r++)n.add($.distance(e[r],e[r-1]));return n.getResult()}offset(e,t){let n=$.distance(e,t),r=$.construct(this.x,this.y);if(n===0)return $.distance(r,e);let i=t.clone();return i.subThis(e),r.subThis(e),r.crossProduct(i)/n}side(e,t){return e.equals(t)?+!this.equals(e):$.orientationRobust(t,e,this)}static sqrDistance(e,t){let n=e.x-t.x,r=e.y-t.y;return n*n+r*r}static sqrDistanceCoords(e,t,n,r){let i=n-e,a=r-t;return i*i+a*a}static distance(e,t){return Math.sqrt($.sqrDistance(e,t))}dotProduct(e){return this.x*e.x+this.y*e.y}dotProductAbs(e){return Math.abs(this.x*e.x)+Math.abs(this.y*e.y)}crossProduct(e){return this.x*e.y-this.y*e.x}crossProductAbs(e){return t(0),0}rotateDirect(e,t){let n=this.x*e-this.y*t,r=this.x*t+this.y*e;this.x=n,this.y=r}rotateReverse(e,t){let n=this.x*e+this.y*t,r=-this.x*t+this.y*e;this.x=n,this.y=r}leftPerpendicularThis(){let e=this.x;this.x=-this.y,this.y=e}leftPerpendicularOther(e){let t=e.x;this.x=-e.y,this.y=t}rightPerpendicularThis(){let e=this.x;this.x=this.y,this.y=-e}rightPerpendicularOther(e){let t=e.x;this.x=e.y,this.y=-t}equals(e){return this.x===e.x&&this.y===e.y}notequals(e){return this.x!==e.x||this.y!==e.y}not(){return!this.x&&!this.y}gt(e){return this.y>e.y||this.y===e.y&&this.x>e.x}gte(e){return!this.lt(e)}lt(e){return this.y<e.y||this.y===e.y&&this.x<e.x}lte(e){return!this.gt(e)}subThis(e){return this.x-=e.x,this.y-=e.y,this}divThis(e){return this.x/=e,this.y/=e,this}add(e){return new $(this.x+e.x,this.y+e.y)}sub(e){return new $(this.x-e.x,this.y-e.y)}negateThis(){return this.x=-this.x,this.y=-this.y,this}negate(){return new $(-this.x,-this.y)}mul(e){return new $(this.x*e,this.y*e)}mulThis(e){return this.x*=e,this.y*=e,this}divide(e){return new $(this.x/e,this.y/e)}setNAN(){this.x=this.y=NaN}isNAN(){return Number.isNaN(this.x)||Number.isNaN(this.y)}static getNAN(){return new $(NaN,NaN)}isFinite(){return Number.isFinite(this.x)&&Number.isFinite(this.y)}isZero(){return this.x===0&&this.y===0}norm(e){switch(e){case 0:{let e=Math.abs(this.x),t=Math.abs(this.y),n=e-t;return n>=0?e:n<=0?t: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:r(`norm`)}}getQuarter(){return $.getQuarterCoords(this.x,this.y)}static getQuarterCoords(e,t){return e>0?t>=0?1:4:t>0?2:e===0?4:3}static compareVectors(e,t){let n=e.getQuarter(),r=t.getQuarter();return r===n?$.orientationRobustImpl($.construct(0,0),t,e,!0):n<r?-1:1}static compareVectorsOrigin(e,t,n){let r=t.sub(e),i=n.sub(e),a=r.getQuarter(),o=i.getQuarter();return o===a?$.orientationRobustImpl(e,n,t,!0):a<o?-1:1}static orientationRobust(e,t,n){return $.orientationRobustImpl(e,t,n,!1)}static orientationRobustEx(e,t,n,r){if(e.equals(t)||n.equals(r))return 0;let i=t.x-e.x,a=t.y-e.y,o=r.x-n.x,s=r.y-n.y;{let e=$.getQuarterCoords(i,a)-1,t=$.getQuarterCoords(o,s)-1,n=$.d[e][t];if(n!==0)return n}let c=i*s,l=a*o,u=4*X()*(Math.abs(c)+Math.abs(l)),d=c-l;return Math.abs(d)>=u?d<0?-1:+(d>0):$.orientationRobustExMp(e,t,n,r)}static orientationRobustExMp(e,t,n,r){let i=Q.constructDouble(t.x),a=Q.constructDouble(r.x);i.subThis(Q.constructDouble(e.x)),a.subThis(Q.constructDouble(n.x));let o=Q.constructDouble(t.y),s=Q.constructDouble(r.y);return o.subThis(Q.constructDouble(e.y)),s.subThis(Q.constructDouble(n.y)),i.mulThis(s),o.mulThis(a),i.subThis(o),i.LZ()?-1:+!!i.GZ()}static orientationNonRobust(e,t,n){let r=t.sub(e).crossProduct(n.sub(e));return r<0?-1:+(r>0)}static orientationRobustImpl(e,t,n,r){if(t.isEqualPoint2D(e)||n.isEqualPoint2D(e)||t.isEqualPoint2D(n))return 0;let i=t.x-e.x,a=t.y-e.y,o=n.x-e.x,s=n.y-e.y;if(!r){let e=$.getQuarterCoords(i,a)-1,t=$.getQuarterCoords(o,s)-1,n=$.d[e][t];if(n!==0)return n}let c=Math.abs(i),l=Math.abs(a),u=Math.abs(o),d=Math.abs(s),f=Math.abs(t.x),p=Math.abs(t.y),h=Math.abs(n.x),v=Math.abs(n.y),y=(c+l+u+d)*(f+p+h+v)*8*_(),b=i*s-a*o;if(Math.abs(b)>y)return b<0?-1:1;if(g(t.x,e.x)&&g(n.y,e.y)&&g(t.y,e.y)&&g(n.x,e.x)&&m(i,s)&&m(a,o)){let e=i*s,t=a*o;if(g(e,t)){let n=e-t;return n<0?-1:+(n>0)}}return $.orientationRobustMp(e,t,n)}static orientationRobustMp(e,t,n){let r=Q.constructDouble(t.x),i=Q.constructDouble(n.x);{let t=Q.constructDouble(e.x);r.subThis(t),i.subThis(t)}let a=Q.constructDouble(n.y),o=Q.constructDouble(t.y);{let t=Q.constructDouble(e.y);a.subThis(t),o.subThis(t)}return r.mulThis(a),o.mulThis(i),r.subThis(o),r.LZ()?-1:+!!r.GZ()}static inCircleRobust(e,t,n,r){let i=new p,a=new p;i.set(e.x),i.subThis(r.x),a.set(e.y),a.subThis(r.y);let o=new p,s=new p;o.set(t.x),o.subThis(r.x),s.set(t.y),s.subThis(r.y);let c=new p,l=new p;c.set(n.x),c.subThis(r.x),l.set(n.y),l.subThis(r.y);let u=i.mulE(s).subE(a.mulE(o)),d=o.mulE(l).subE(s.mulE(c)),f=i.mulE(l).subE(a.mulE(c)),m=i.mulE(i).addE(a.mulE(a)),h=o.mulE(o).addE(s.mulE(s)),g=c.mulE(c).addE(l.mulE(l)),_=m.mulE(d).subE(h.mulE(f)).addE(g.mulE(u));if(!_.isFuzzyZero()){let e=_.value();return e<0?-1:+(e>0)}return $.inCircleRobustMp(e,t,n,r)}static inCircleRobustMp(e,t,n,r){do{if(!(g(e.x,r.x)&&g(e.y,r.y))||!(g(t.x,r.x)&&g(t.y,r.y))||!(g(n.x,r.x)&&g(n.y,r.y)))break;let i=e.x-r.x,a=e.y-r.y,o=t.x-r.x,s=t.y-r.y,c=n.x-r.x,l=n.y-r.y;if(!(m(i,s)&&m(a,o))||!(m(o,l)&&m(s,c))||!(m(i,l)&&m(a,c))||!(m(i,i)&&m(a,a))||!(m(o,o)&&m(s,s))||!(m(c,c)&&m(l,l)))break;let u=i*s,d=a*o,f=o*l,p=s*c,_=i*l,v=a*c,y=i*i,b=a*a,x=o*o,S=s*s,ee=c*c,te=l*l;if(!g(u,d)||!g(f,p)||!g(_,v)||!h(y,b)||!h(x,S)||!h(ee,te))break;let ne=u-d,C=f-p,re=_-v,w=y+b,T=x+S,ie=ee+te;if(!m(w,C)||!m(T,re)||!m(ie,ne))break;let E=w*C,D=T*re,O=ie*ne;if(!g(E,D))break;let ae=E-D;if(!h(ae,O))break;let oe=ae+O;return oe<0?-1:+(oe>0)}while(0);let i=Q.constructDouble(r.x),a=Q.constructDouble(r.y),o=Q.constructDouble(e.x),s=Q.constructDouble(e.y);o.subThis(i),s.subThis(a);let c=Q.constructDouble(t.x),l=Q.constructDouble(t.y);c.subThis(i),l.subThis(a);let u=Q.constructDouble(n.x),d=Q.constructDouble(n.y);u.subThis(i),d.subThis(a);let f=o.mul(l).sub(s.mul(c)),p=c.mul(d).sub(l.mul(u)),_=o.mul(d).sub(s.mul(u)),v=o.mul(o).add(s.mul(s)),y=c.mul(c).add(l.mul(l)),b=u.mul(u).add(d.mul(d)),x=v.mul(p).sub(y.mul(_)).add(b.mul(f));return x.LZ()?-1:+!!x.GZ()}static inCircleRobustMp3Point(e,t,n){let r=Q.constructDouble(e.x),i=Q.constructDouble(e.y),a=Q.constructDouble(t.x),o=Q.constructDouble(t.y),s=Q.constructDouble(n.x),c=Q.constructDouble(n.y),l=s.mul(s).add(c.mul(c)).sub(s.mul(r).add(c.mul(i)).add(s.mul(a)).add(c.mul(o))).add(r.mul(a).add(i.mul(o)));return l.LZ()?-1:+!!l.GZ()}static inCircleRobust3Point(e,t,n){let r=new p(e.x),i=new p(e.y),a=new p(t.x),o=new p(t.y),s=new p(n.x),c=new p(n.y),l=s.mulE(s).addE(c.mulE(c)).subE(s.mulE(r).addE(c.mulE(i)).addE(s.mulE(a)).addE(c.mulE(o))).addE(r.mulE(a).addE(i.mulE(o)));if(!l.isFuzzyZero()){let e=l.value();return e<0?-1:+(e>0)}return $.inCircleRobustMp3Point(e,t,n)}static calculateCircleCenterFromThreePoints(e,t,n){if(e.equals(n)||e.equals(t)||n.equals(t))return $.getNAN();let r=tn(e,t,n);return r.isNAN()?nn(e,t,n):r}static calculateAngle(e,t){return Math.atan2(e.crossProduct(t),e.dotProduct(t))}static isBisectorRobust(e,n,r){return t(0),!1}static size(){return 2}get 0(){return this.x}get 1(){return this.y}set 0(e){this.x=e}set 1(e){this.y=e}static c_compare_zorder_xx=[2,0];static c_compare_zorder_yy=[1,0];static compareZorder(e,t){let n=$.c_compare_zorder_xx[+(e.x<0)]|$.c_compare_zorder_yy[+(e.y<0)],r=$.c_compare_zorder_xx[+(t.x<0)]|$.c_compare_zorder_yy[+(t.y<0)];if(n===r){let n=0,r=0;for(let i=0;i<2;++i){let a=e[i],o=t[i],s=Zt(a,o);s>n&&(n=s,r=i)}return e[r]<t[r]}return n<r}static lerp(e,t,n){let r=new $;return A(e,t,n,r),r}static getClosestCoordinate(e,t,n,r=!1){let i=$.getNAN();i.setSub(t,e);let a=i.sqrLength();if(a===0)return .5;if(t.isEqualPoint2D(n))return 1;let o=$.getNAN();o.setSub(n,e);let s=o.dotProduct(i)/a;return r||(s<0?s=0:s>1&&(s=1)),s}static intersectLinesAtOnePoint(e,t,n,r){if(e.equals(t)||n.equals(r))return $.getNAN();let i=t.x-e.x,a=n.x-r.x,o=t.y-e.y,s=n.y-r.y,c=i*s-a*o;if(!c)return $.getNAN();let l=c;if(l===0)return $.getNAN();let u=(n.x-e.x)*s-(n.y-e.y)*a;u/=l;let d=new $;return A(e,t,u,d),d.isFinite()?d:$.getNAN()}toString(){return`[${this.x},${this.y}]`}}function tn(e,t,n){let r=new p(t.x);r.subThis(e.x);let i=new p(t.y);i.subThis(e.y);let a=new p(n.x);a.subThis(e.x);let o=new p(n.y);o.subThis(e.y);let s=r.clone();s.mulThisE(o);let c=i.clone();if(c.mulThisE(a),s.subThisE(c),s.value()===0)return $.getNAN();s.mulThis(2);let l=r.clone();l.mulThisE(r);let u=i.clone();u.mulThisE(i);let d=l.clone();d.addThisE(u);let f=a.clone();f.mulThisE(a);let m=o.clone();m.mulThisE(o);let h=f.clone();h.addThisE(m);let g=i.clone();g.mulThisE(h),c=o.clone(),c.mulThisE(d),g.subThisE(c),g.divThisE(s);let _=r.clone();_.mulThisE(h),c=a.clone(),c.mulThisE(d),_.subThisE(c),_.divThisE(s);let v=$.construct(e.x-g.value(),e.y+_.value()),y=e.sub(v).length(),b=t.sub(v).length(),x=n.sub(v).length(),S=1e-15*(y+Math.abs(e.x)+Math.abs(t.x)+Math.abs(n.x)+Math.abs(e.y)+Math.abs(t.y)+Math.abs(n.y));return Math.abs(y-b)<=S&&Math.abs(y-x)<=S&&g.eps()<S&&_.eps()<S?v:$.getNAN()}function nn(e,t,n){let r=Q.constructDouble(t.x);r.subDoubleThis(e.x);let i=Q.constructDouble(t.y);i.subDoubleThis(e.y);let a=Q.constructDouble(n.x);a.subDoubleThis(e.x);let o=Q.constructDouble(n.y);o.subDoubleThis(e.y);let s=r.clone();s.mulThis(o);let c=i.clone();if(c.mulThis(a),s.subThis(c),s.isZero())return $.getNAN();s.mulDoubleThis(2);let l=r.clone();l.mulThis(r);let u=i.clone();u.mulThis(i);let d=l.clone();d.addThis(u);let f=a.clone();f.mulThis(a);let p=o.clone();p.mulThis(o);let m=f.clone();m.addThis(p);let h=i.clone();h.mulThis(m),c=o.clone(),c.mulThis(d),h.subThis(c),h.divThis(s);let g=r.clone();return g.mulThis(m),c=a.clone(),c.mulThis(d),g.subThis(c),g.divThis(s),$.construct(e.x-h.value(),e.y+g.value())}export{w as $,re as A,J as B,kt as C,$e as D,d as E,Ze as F,U as G,ie as H,X as I,A as J,i as K,Tt as L,Q as M,Ke as N,Et as O,$ as P,Nt as Q,en as R,nt as S,y as T,$t as U,Qt as V,Mt as W,Ue as X,vt as Y,p as Z,zt as _,Rt as a,Ot as a0,dt as a1,Ft as a2,Dt as a3,It as a4,ht as a5,mt as a6,b as a7,Qe as a8,Lt as a9,ee as aA,Te as aB,rt as aC,Jt as aD,Ie as aE,Gt as aF,We as aG,ge as aH,ue as aI,F as aJ,de as aK,yt as aL,ze as aM,Re as aa,He as ab,Le as ac,f as ad,qt as ae,tt as af,se as ag,ce as ah,Ve as ai,O as aj,Vt as ak,Wt as al,ot as am,Z as an,ae as ao,oe as ap,x as aq,Yt as ar,E as as,D as at,Bt as au,Ht as av,Ee as aw,De as ax,Ye as ay,S as az,_t as b,R as c,Xe as d,j as e,I as f,Y as g,fe as h,W as i,T as j,ut as k,at as l,qe as m,it as n,z as o,we as p,et as q,k as r,L as s,gt as t,pe as u,Ge as v,Be as w,Je as x,le as y,ne as z};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{Offset as e}from"../views/3d/webgl-engine/core/shaderLibrary/Offset.glsl.js";import{isColor as t}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{sliceDraw as n}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{Transform as r}from"../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js";import{InstancedDoublePrecision as i}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js";import{NormalAttribute as a}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateAttribute as o}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VerticalOffset as s}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js";import{DefaultMaterialAuxiliaryPasses as c}from"../views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js";import{DefaultMaterialExternalColor as l}from"../views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialExternalColor.glsl.js";import{EvaluateAmbientOcclusion as u}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import{EvaluateSceneLighting as d,addAmbientBoostFactor as f,
|
|
2
|
+
import{Offset as e}from"../views/3d/webgl-engine/core/shaderLibrary/Offset.glsl.js";import{isColor as t}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{sliceDraw as n}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{Transform as r}from"../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js";import{InstancedDoublePrecision as i}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js";import{NormalAttribute as a}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateAttribute as o}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VerticalOffset as s}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js";import{DefaultMaterialAuxiliaryPasses as c}from"../views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js";import{DefaultMaterialExternalColor as l}from"../views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialExternalColor.glsl.js";import{EvaluateAmbientOcclusion as u}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import{EvaluateSceneLighting as d,addAmbientBoostFactor as f,lightingGlobalFactor as p}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import{mainLightDirection as m,mainLightIntensity as h}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import{NormalUtils as g}from"../views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl.js";import{PhysicallyBasedRendering as _}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js";import{PhysicallyBasedRenderingParameters as v}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{readShadowPass as y,readShadowDraw as b}from"../views/3d/webgl-engine/core/shaderLibrary/shading/readShadow.glsl.js";import{colorTextureUV as x,emissiveTextureUV as S}from"../views/3d/webgl-engine/core/shaderLibrary/shading/TextureTransformUV.glsl.js";import{VisualVariables as C}from"../views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js";import{DiscardOrAdjustAlphaPass as w}from"../views/3d/webgl-engine/core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js";import{addProjViewLocalOrigin as T,addCameraPosition as E}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float3PassUniform as D}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{If as O,glsl as k}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DPassUniform as A}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{SnowCover as j}from"../views/3d/webgl-engine/effects/snowcover/SnowCover.glsl.js";import{outputColorHighlightOLID as M}from"../views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js";import{ShaderBuilder as N}from"../views/webgl/ShaderBuilder.js";function P(P){let F=new N,{attributes:I,vertex:L,fragment:R,varyings:z}=F,{output:B,offsetBackfaces:V,pbrMode:H,snowCover:U}=P,W=H===1||H===2;if(T(L,P),I.add(`position`,`vec3`),L.inputs.add(`position`,()=>`position`),z.add(`vpos`,`vec3`,{invariant:!0}),F.include(C,P),F.include(i,P),F.include(s,P),F.include(x,P),!t(B))return F.include(c,P),F;F.include(S,P),E(F.vertex,P),F.include(a,P),F.include(r),V&&F.include(e),z.add(`vNormalWorld`,`vec3`),z.add(`localvpos`,`vec3`,{invariant:!0}),F.include(o,P),F.include(l,P),F.include(P.instancedDoublePrecision?y:b,P),L.main.add(k`
|
|
3
3
|
forwardDefaultMaterialExternalColor();
|
|
4
4
|
|
|
5
5
|
vpos = getVertexInLocalOriginSpace();
|
|
@@ -17,7 +17,7 @@ import{Offset as e}from"../views/3d/webgl-engine/core/shaderLibrary/Offset.glsl.
|
|
|
17
17
|
|
|
18
18
|
gl_Position = shouldCullByOpacity() ? vec4(1e38, 1e38, 1e38, 1.0) :
|
|
19
19
|
${O(V,`offsetBackfacingClipPosition(basePosition, vpos, vNormalWorld, cameraPosition);`,`basePosition;`)}
|
|
20
|
-
`);let{hasColorTexture:G,hasColorTextureTransform:K}=P;return R.include(d,P),R.include(u,P),F.include(w,P),R.include(n,P),F.include(M,P),E(R,P),f(R),
|
|
20
|
+
`);let{hasColorTexture:G,hasColorTextureTransform:K}=P;return R.include(d,P),R.include(u,P),F.include(w,P),R.include(n,P),F.include(M,P),E(R,P),f(R),R.uniforms.add(m,p,L.uniforms.get(`localOrigin`),L.uniforms.get(`view`),new D(`ambient`,e=>e.ambient),new D(`diffuse`,e=>e.diffuse)),G&&R.uniforms.add(new A(`tex`,e=>e.texture)),F.include(v,P),R.include(_,P),R.include(j,P),R.include(g,P),R.uniforms.add(h).main.add(k`
|
|
21
21
|
discardBySlice(vpos);
|
|
22
22
|
vec4 texColor = ${G?`texture(tex, ${K?`colorUV`:`vuv0`})`:` vec4(1.0)`};
|
|
23
23
|
${O(G,`${O(P.textureAlphaPremultiplied,`texColor.rgb /= texColor.a;`)}
|