@performant-software/geospatial 2.2.21-beta.9 → 2.2.21
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/build/index.js +2 -0
- package/build/index.js.map +1 -0
- package/build/main.css +127 -0
- package/dist/index.cjs100.js +1 -1
- package/dist/index.cjs100.js.map +1 -1
- package/dist/index.cjs101.js +1 -1
- package/dist/index.cjs101.js.map +1 -1
- package/dist/index.cjs102.js +1 -1
- package/dist/index.cjs102.js.map +1 -1
- package/dist/index.cjs103.js +1 -1
- package/dist/index.cjs103.js.map +1 -1
- package/dist/index.cjs104.js +1 -1
- package/dist/index.cjs104.js.map +1 -1
- package/dist/index.cjs105.js +1 -1
- package/dist/index.cjs105.js.map +1 -1
- package/dist/index.cjs106.js +1 -1
- package/dist/index.cjs106.js.map +1 -1
- package/dist/index.cjs107.js +1 -1
- package/dist/index.cjs107.js.map +1 -1
- package/dist/index.cjs108.js +1 -1
- package/dist/index.cjs108.js.map +1 -1
- package/dist/index.cjs109.js +1 -1
- package/dist/index.cjs109.js.map +1 -1
- package/dist/index.cjs110.js +1 -1
- package/dist/index.cjs110.js.map +1 -1
- package/dist/index.cjs111.js +1 -1
- package/dist/index.cjs111.js.map +1 -1
- package/dist/index.cjs112.js +1 -1
- package/dist/index.cjs112.js.map +1 -1
- package/dist/index.cjs113.js +1 -1
- package/dist/index.cjs113.js.map +1 -1
- package/dist/index.cjs114.js +1 -1
- package/dist/index.cjs114.js.map +1 -1
- package/dist/index.cjs115.js +1 -1
- package/dist/index.cjs115.js.map +1 -1
- package/dist/index.cjs116.js +1 -1
- package/dist/index.cjs116.js.map +1 -1
- package/dist/index.cjs117.js +1 -1
- package/dist/index.cjs117.js.map +1 -1
- package/dist/index.cjs118.js +1 -1
- package/dist/index.cjs118.js.map +1 -1
- package/dist/index.cjs119.js +1 -1
- package/dist/index.cjs119.js.map +1 -1
- package/dist/index.cjs12.js +1 -1
- package/dist/index.cjs120.js +1 -1
- package/dist/index.cjs120.js.map +1 -1
- package/dist/index.cjs121.js +1 -1
- package/dist/index.cjs121.js.map +1 -1
- package/dist/index.cjs122.js +1 -1
- package/dist/index.cjs122.js.map +1 -1
- package/dist/index.cjs123.js +1 -1
- package/dist/index.cjs123.js.map +1 -1
- package/dist/index.cjs124.js +1 -1
- package/dist/index.cjs124.js.map +1 -1
- package/dist/index.cjs125.js +1 -1
- package/dist/index.cjs125.js.map +1 -1
- package/dist/index.cjs126.js +1 -1
- package/dist/index.cjs126.js.map +1 -1
- package/dist/index.cjs127.js +1 -1
- package/dist/index.cjs127.js.map +1 -1
- package/dist/index.cjs128.js +1 -13
- package/dist/index.cjs128.js.map +1 -1
- package/dist/index.cjs129.js +13 -1
- package/dist/index.cjs129.js.map +1 -1
- package/dist/index.cjs130.js +1 -1
- package/dist/index.cjs130.js.map +1 -1
- package/dist/index.cjs131.js +1 -1
- package/dist/index.cjs131.js.map +1 -1
- package/dist/index.cjs132.js +1 -1
- package/dist/index.cjs132.js.map +1 -1
- package/dist/index.cjs133.js +1 -1
- package/dist/index.cjs133.js.map +1 -1
- package/dist/index.cjs134.js +1 -1
- package/dist/index.cjs134.js.map +1 -1
- package/dist/index.cjs135.js +1 -1
- package/dist/index.cjs135.js.map +1 -1
- package/dist/index.cjs136.js +1 -1
- package/dist/index.cjs136.js.map +1 -1
- package/dist/index.cjs137.js +1 -1
- package/dist/index.cjs137.js.map +1 -1
- package/dist/index.cjs138.js +1 -1
- package/dist/index.cjs138.js.map +1 -1
- package/dist/index.cjs139.js +1 -1
- package/dist/index.cjs139.js.map +1 -1
- package/dist/index.cjs14.js +1 -1
- package/dist/index.cjs140.js +1 -1
- package/dist/index.cjs140.js.map +1 -1
- package/dist/index.cjs141.js +1 -1
- package/dist/index.cjs141.js.map +1 -1
- package/dist/index.cjs142.js +1 -1
- package/dist/index.cjs142.js.map +1 -1
- package/dist/index.cjs143.js +1 -1
- package/dist/index.cjs143.js.map +1 -1
- package/dist/index.cjs144.js +1 -1
- package/dist/index.cjs144.js.map +1 -1
- package/dist/index.cjs145.js +1 -1
- package/dist/index.cjs145.js.map +1 -1
- package/dist/index.cjs146.js +1 -1
- package/dist/index.cjs146.js.map +1 -1
- package/dist/index.cjs147.js +1 -1
- package/dist/index.cjs147.js.map +1 -1
- package/dist/index.cjs148.js +1 -1
- package/dist/index.cjs148.js.map +1 -1
- package/dist/index.cjs149.js +1 -1
- package/dist/index.cjs149.js.map +1 -1
- package/dist/index.cjs15.js +1 -1
- package/dist/index.cjs150.js +1 -1
- package/dist/index.cjs150.js.map +1 -1
- package/dist/index.cjs151.js +1 -1
- package/dist/index.cjs151.js.map +1 -1
- package/dist/index.cjs152.js +1 -1
- package/dist/index.cjs152.js.map +1 -1
- package/dist/index.cjs153.js +1 -1
- package/dist/index.cjs153.js.map +1 -1
- package/dist/index.cjs154.js +1 -1
- package/dist/index.cjs154.js.map +1 -1
- package/dist/index.cjs155.js +1 -1
- package/dist/index.cjs155.js.map +1 -1
- package/dist/index.cjs156.js +1 -1
- package/dist/index.cjs156.js.map +1 -1
- package/dist/index.cjs157.js +1 -1
- package/dist/index.cjs157.js.map +1 -1
- package/dist/index.cjs158.js +1 -1
- package/dist/index.cjs158.js.map +1 -1
- package/dist/index.cjs159.js +1 -1
- package/dist/index.cjs159.js.map +1 -1
- package/dist/index.cjs16.js +1 -1
- package/dist/index.cjs160.js +1 -1
- package/dist/index.cjs160.js.map +1 -1
- package/dist/index.cjs161.js +1 -1
- package/dist/index.cjs161.js.map +1 -1
- package/dist/index.cjs162.js +1 -1
- package/dist/index.cjs162.js.map +1 -1
- package/dist/index.cjs163.js +1 -1
- package/dist/index.cjs163.js.map +1 -1
- package/dist/index.cjs164.js +1 -1
- package/dist/index.cjs164.js.map +1 -1
- package/dist/index.cjs165.js +1 -1
- package/dist/index.cjs165.js.map +1 -1
- package/dist/index.cjs166.js +1 -1
- package/dist/index.cjs166.js.map +1 -1
- package/dist/index.cjs167.js +1 -1
- package/dist/index.cjs167.js.map +1 -1
- package/dist/index.cjs168.js +1 -1
- package/dist/index.cjs168.js.map +1 -1
- package/dist/index.cjs169.js +1 -1
- package/dist/index.cjs169.js.map +1 -1
- package/dist/index.cjs17.js +1 -1
- package/dist/index.cjs170.js +1 -1
- package/dist/index.cjs170.js.map +1 -1
- package/dist/index.cjs171.js +1 -1
- package/dist/index.cjs171.js.map +1 -1
- package/dist/index.cjs172.js +1 -1
- package/dist/index.cjs172.js.map +1 -1
- package/dist/index.cjs173.js +1 -1
- package/dist/index.cjs173.js.map +1 -1
- package/dist/index.cjs174.js +1 -1
- package/dist/index.cjs174.js.map +1 -1
- package/dist/index.cjs175.js +1 -1
- package/dist/index.cjs175.js.map +1 -1
- package/dist/index.cjs176.js +1 -1
- package/dist/index.cjs176.js.map +1 -1
- package/dist/index.cjs177.js +1 -1
- package/dist/index.cjs177.js.map +1 -1
- package/dist/index.cjs178.js +1 -1
- package/dist/index.cjs178.js.map +1 -1
- package/dist/index.cjs179.js +1 -1
- package/dist/index.cjs179.js.map +1 -1
- package/dist/index.cjs18.js +3 -6
- package/dist/index.cjs18.js.map +1 -1
- package/dist/index.cjs180.js +1 -1
- package/dist/index.cjs180.js.map +1 -1
- package/dist/index.cjs181.js +1 -1
- package/dist/index.cjs181.js.map +1 -1
- package/dist/index.cjs182.js +1 -1
- package/dist/index.cjs182.js.map +1 -1
- package/dist/index.cjs183.js +1 -1
- package/dist/index.cjs183.js.map +1 -1
- package/dist/index.cjs184.js +1 -1
- package/dist/index.cjs184.js.map +1 -1
- package/dist/index.cjs185.js +1 -1
- package/dist/index.cjs185.js.map +1 -1
- package/dist/index.cjs186.js +1 -1
- package/dist/index.cjs186.js.map +1 -1
- package/dist/index.cjs187.js +1 -1
- package/dist/index.cjs187.js.map +1 -1
- package/dist/index.cjs188.js +1 -1
- package/dist/index.cjs188.js.map +1 -1
- package/dist/index.cjs189.js +1 -1
- package/dist/index.cjs189.js.map +1 -1
- package/dist/index.cjs19.js +2 -2
- package/dist/index.cjs190.js +1 -1
- package/dist/index.cjs193.js +1 -1
- package/dist/index.cjs194.js +1 -1
- package/dist/index.cjs195.js +1 -1
- package/dist/index.cjs196.js +1 -1
- package/dist/index.cjs197.js +1 -1
- package/dist/index.cjs198.js +1 -1
- package/dist/index.cjs199.js +1 -1
- package/dist/index.cjs20.js +1 -1
- package/dist/index.cjs20.js.map +1 -1
- package/dist/index.cjs200.js +1 -1
- package/dist/index.cjs202.js +1 -1
- package/dist/index.cjs203.js +1 -1
- package/dist/index.cjs205.js +1 -1
- package/dist/index.cjs205.js.map +1 -1
- package/dist/index.cjs206.js +1 -1
- package/dist/index.cjs206.js.map +1 -1
- package/dist/index.cjs207.js +1 -1
- package/dist/index.cjs207.js.map +1 -1
- package/dist/index.cjs208.js +1 -1
- package/dist/index.cjs208.js.map +1 -1
- package/dist/index.cjs209.js +1 -1
- package/dist/index.cjs209.js.map +1 -1
- package/dist/index.cjs21.js +1 -1
- package/dist/index.cjs21.js.map +1 -1
- package/dist/index.cjs210.js +1 -1
- package/dist/index.cjs210.js.map +1 -1
- package/dist/index.cjs211.js +1 -1
- package/dist/index.cjs211.js.map +1 -1
- package/dist/index.cjs212.js +1 -1
- package/dist/index.cjs212.js.map +1 -1
- package/dist/index.cjs213.js +1 -1
- package/dist/index.cjs213.js.map +1 -1
- package/dist/index.cjs214.js +1 -1
- package/dist/index.cjs214.js.map +1 -1
- package/dist/index.cjs215.js +1 -1
- package/dist/index.cjs215.js.map +1 -1
- package/dist/index.cjs216.js +1 -1
- package/dist/index.cjs216.js.map +1 -1
- package/dist/index.cjs217.js +1 -1
- package/dist/index.cjs217.js.map +1 -1
- package/dist/index.cjs218.js +1 -1
- package/dist/index.cjs218.js.map +1 -1
- package/dist/index.cjs219.js +1 -1
- package/dist/index.cjs219.js.map +1 -1
- package/dist/index.cjs22.js +1 -1
- package/dist/index.cjs22.js.map +1 -1
- package/dist/index.cjs220.js +1 -1
- package/dist/index.cjs220.js.map +1 -1
- package/dist/index.cjs221.js +1 -1
- package/dist/index.cjs221.js.map +1 -1
- package/dist/index.cjs222.js +1 -1
- package/dist/index.cjs222.js.map +1 -1
- package/dist/index.cjs223.js +1 -1
- package/dist/index.cjs223.js.map +1 -1
- package/dist/index.cjs224.js +1 -1
- package/dist/index.cjs224.js.map +1 -1
- package/dist/index.cjs225.js +1 -1
- package/dist/index.cjs225.js.map +1 -1
- package/dist/index.cjs226.js +1 -1
- package/dist/index.cjs226.js.map +1 -1
- package/dist/index.cjs227.js +1 -1
- package/dist/index.cjs227.js.map +1 -1
- package/dist/index.cjs228.js +1 -1
- package/dist/index.cjs228.js.map +1 -1
- package/dist/index.cjs229.js +1 -1
- package/dist/index.cjs229.js.map +1 -1
- package/dist/index.cjs23.js +1 -1
- package/dist/index.cjs23.js.map +1 -1
- package/dist/index.cjs230.js +1 -1
- package/dist/index.cjs230.js.map +1 -1
- package/dist/index.cjs231.js +1 -1
- package/dist/index.cjs231.js.map +1 -1
- package/dist/index.cjs232.js +1 -1
- package/dist/index.cjs232.js.map +1 -1
- package/dist/index.cjs233.js +1 -1
- package/dist/index.cjs233.js.map +1 -1
- package/dist/index.cjs234.js +1 -1
- package/dist/index.cjs234.js.map +1 -1
- package/dist/index.cjs235.js +1 -1
- package/dist/index.cjs235.js.map +1 -1
- package/dist/index.cjs236.js +1 -1
- package/dist/index.cjs237.js +1 -1
- package/dist/index.cjs237.js.map +1 -1
- package/dist/index.cjs238.js +1 -1
- package/dist/index.cjs238.js.map +1 -1
- package/dist/index.cjs239.js +1 -1
- package/dist/index.cjs239.js.map +1 -1
- package/dist/index.cjs24.js +1 -1
- package/dist/index.cjs24.js.map +1 -1
- package/dist/index.cjs240.js +1 -1
- package/dist/index.cjs240.js.map +1 -1
- package/dist/index.cjs241.js +1 -1
- package/dist/index.cjs241.js.map +1 -1
- package/dist/index.cjs242.js +1 -1
- package/dist/index.cjs242.js.map +1 -1
- package/dist/index.cjs243.js +1 -1
- package/dist/index.cjs243.js.map +1 -1
- package/dist/index.cjs244.js +1 -1
- package/dist/index.cjs244.js.map +1 -1
- package/dist/index.cjs245.js +1 -1
- package/dist/index.cjs245.js.map +1 -1
- package/dist/index.cjs246.js +1 -1
- package/dist/index.cjs246.js.map +1 -1
- package/dist/index.cjs247.js +1 -1
- package/dist/index.cjs247.js.map +1 -1
- package/dist/index.cjs248.js +1 -1
- package/dist/index.cjs248.js.map +1 -1
- package/dist/index.cjs249.js +1 -1
- package/dist/index.cjs249.js.map +1 -1
- package/dist/index.cjs25.js +1 -1
- package/dist/index.cjs25.js.map +1 -1
- package/dist/index.cjs250.js +1 -1
- package/dist/index.cjs250.js.map +1 -1
- package/dist/index.cjs251.js +1 -1
- package/dist/index.cjs251.js.map +1 -1
- package/dist/index.cjs252.js +1 -1
- package/dist/index.cjs252.js.map +1 -1
- package/dist/index.cjs253.js +1 -1
- package/dist/index.cjs253.js.map +1 -1
- package/dist/index.cjs254.js +1 -1
- package/dist/index.cjs254.js.map +1 -1
- package/dist/index.cjs255.js +1 -1
- package/dist/index.cjs255.js.map +1 -1
- package/dist/index.cjs256.js +1 -1
- package/dist/index.cjs256.js.map +1 -1
- package/dist/index.cjs257.js +1 -1
- package/dist/index.cjs258.js +1 -1
- package/dist/index.cjs258.js.map +1 -1
- package/dist/index.cjs259.js +1 -1
- package/dist/index.cjs259.js.map +1 -1
- package/dist/index.cjs26.js +1 -1
- package/dist/index.cjs26.js.map +1 -1
- package/dist/index.cjs260.js +1 -1
- package/dist/index.cjs260.js.map +1 -1
- package/dist/index.cjs261.js +2 -0
- package/dist/index.cjs261.js.map +1 -0
- package/dist/index.cjs27.js +1 -1
- package/dist/index.cjs27.js.map +1 -1
- package/dist/index.cjs28.js +1 -1
- package/dist/index.cjs28.js.map +1 -1
- package/dist/index.cjs29.js +1 -1
- package/dist/index.cjs29.js.map +1 -1
- package/dist/index.cjs30.js +1 -1
- package/dist/index.cjs30.js.map +1 -1
- package/dist/index.cjs31.js +1 -1
- package/dist/index.cjs31.js.map +1 -1
- package/dist/index.cjs32.js +1 -1
- package/dist/index.cjs32.js.map +1 -1
- package/dist/index.cjs33.js +1 -1
- package/dist/index.cjs33.js.map +1 -1
- package/dist/index.cjs34.js +1 -1
- package/dist/index.cjs34.js.map +1 -1
- package/dist/index.cjs35.js +1 -1
- package/dist/index.cjs35.js.map +1 -1
- package/dist/index.cjs36.js +1 -1
- package/dist/index.cjs36.js.map +1 -1
- package/dist/index.cjs37.js +1 -1
- package/dist/index.cjs37.js.map +1 -1
- package/dist/index.cjs38.js +1 -1
- package/dist/index.cjs38.js.map +1 -1
- package/dist/index.cjs39.js +1 -1
- package/dist/index.cjs39.js.map +1 -1
- package/dist/index.cjs4.js +1 -1
- package/dist/index.cjs4.js.map +1 -1
- package/dist/index.cjs40.js +1 -1
- package/dist/index.cjs40.js.map +1 -1
- package/dist/index.cjs41.js +1 -1
- package/dist/index.cjs41.js.map +1 -1
- package/dist/index.cjs42.js +1 -1
- package/dist/index.cjs42.js.map +1 -1
- package/dist/index.cjs43.js +1 -1
- package/dist/index.cjs43.js.map +1 -1
- package/dist/index.cjs44.js +1 -1
- package/dist/index.cjs44.js.map +1 -1
- package/dist/index.cjs45.js +1 -1
- package/dist/index.cjs45.js.map +1 -1
- package/dist/index.cjs46.js +1 -1
- package/dist/index.cjs46.js.map +1 -1
- package/dist/index.cjs47.js +1 -1
- package/dist/index.cjs47.js.map +1 -1
- package/dist/index.cjs48.js +1 -1
- package/dist/index.cjs48.js.map +1 -1
- package/dist/index.cjs49.js +1 -1
- package/dist/index.cjs49.js.map +1 -1
- package/dist/index.cjs5.js +1 -1
- package/dist/index.cjs50.js +1 -1
- package/dist/index.cjs50.js.map +1 -1
- package/dist/index.cjs51.js +1 -1
- package/dist/index.cjs51.js.map +1 -1
- package/dist/index.cjs52.js +1 -1
- package/dist/index.cjs52.js.map +1 -1
- package/dist/index.cjs53.js +1 -1
- package/dist/index.cjs53.js.map +1 -1
- package/dist/index.cjs54.js +1 -440
- package/dist/index.cjs54.js.map +1 -1
- package/dist/index.cjs55.js +440 -1
- package/dist/index.cjs55.js.map +1 -1
- package/dist/index.cjs56.js +1 -1
- package/dist/index.cjs56.js.map +1 -1
- package/dist/index.cjs57.js +1 -1
- package/dist/index.cjs57.js.map +1 -1
- package/dist/index.cjs58.js +1 -1
- package/dist/index.cjs58.js.map +1 -1
- package/dist/index.cjs59.js +1 -1
- package/dist/index.cjs6.js +1 -1
- package/dist/index.cjs61.js +1 -9
- package/dist/index.cjs61.js.map +1 -1
- package/dist/index.cjs62.js +1 -19
- package/dist/index.cjs62.js.map +1 -1
- package/dist/index.cjs63.js +9 -1
- package/dist/index.cjs63.js.map +1 -1
- package/dist/index.cjs64.js +19 -1
- package/dist/index.cjs64.js.map +1 -1
- package/dist/index.cjs65.js +1 -1
- package/dist/index.cjs65.js.map +1 -1
- package/dist/index.cjs66.js +1 -1
- package/dist/index.cjs66.js.map +1 -1
- package/dist/index.cjs67.js +1 -1
- package/dist/index.cjs67.js.map +1 -1
- package/dist/index.cjs68.js +1 -1
- package/dist/index.cjs68.js.map +1 -1
- package/dist/index.cjs69.js +1 -1
- package/dist/index.cjs69.js.map +1 -1
- package/dist/index.cjs7.js +1 -1
- package/dist/index.cjs70.js +1 -1
- package/dist/index.cjs70.js.map +1 -1
- package/dist/index.cjs71.js +1 -1
- package/dist/index.cjs71.js.map +1 -1
- package/dist/index.cjs72.js +1 -1
- package/dist/index.cjs72.js.map +1 -1
- package/dist/index.cjs73.js +1 -1
- package/dist/index.cjs73.js.map +1 -1
- package/dist/index.cjs74.js +1 -1
- package/dist/index.cjs74.js.map +1 -1
- package/dist/index.cjs75.js +1 -1
- package/dist/index.cjs75.js.map +1 -1
- package/dist/index.cjs76.js +1 -1
- package/dist/index.cjs76.js.map +1 -1
- package/dist/index.cjs77.js +1 -1
- package/dist/index.cjs77.js.map +1 -1
- package/dist/index.cjs78.js +1 -1
- package/dist/index.cjs78.js.map +1 -1
- package/dist/index.cjs79.js +1 -1
- package/dist/index.cjs79.js.map +1 -1
- package/dist/index.cjs8.js +1 -1
- package/dist/index.cjs8.js.map +1 -1
- package/dist/index.cjs80.js +1 -1
- package/dist/index.cjs80.js.map +1 -1
- package/dist/index.cjs81.js +1 -1
- package/dist/index.cjs81.js.map +1 -1
- package/dist/index.cjs82.js +1 -1
- package/dist/index.cjs82.js.map +1 -1
- package/dist/index.cjs83.js +1 -1
- package/dist/index.cjs83.js.map +1 -1
- package/dist/index.cjs84.js +1 -1
- package/dist/index.cjs84.js.map +1 -1
- package/dist/index.cjs85.js +1 -1
- package/dist/index.cjs85.js.map +1 -1
- package/dist/index.cjs86.js +1 -1
- package/dist/index.cjs86.js.map +1 -1
- package/dist/index.cjs87.js +1 -1
- package/dist/index.cjs87.js.map +1 -1
- package/dist/index.cjs88.js +1 -1
- package/dist/index.cjs88.js.map +1 -1
- package/dist/index.cjs89.js +1 -1
- package/dist/index.cjs89.js.map +1 -1
- package/dist/index.cjs90.js +1 -1
- package/dist/index.cjs90.js.map +1 -1
- package/dist/index.cjs91.js +1 -1
- package/dist/index.cjs91.js.map +1 -1
- package/dist/index.cjs92.js +1 -1
- package/dist/index.cjs92.js.map +1 -1
- package/dist/index.cjs93.js +1 -1
- package/dist/index.cjs93.js.map +1 -1
- package/dist/index.cjs94.js +1 -1
- package/dist/index.cjs94.js.map +1 -1
- package/dist/index.cjs95.js +1 -1
- package/dist/index.cjs95.js.map +1 -1
- package/dist/index.cjs96.js +1 -1
- package/dist/index.cjs96.js.map +1 -1
- package/dist/index.cjs97.js +1 -1
- package/dist/index.cjs97.js.map +1 -1
- package/dist/index.cjs98.js +1 -1
- package/dist/index.cjs98.js.map +1 -1
- package/dist/index.cjs99.js +1 -1
- package/dist/index.cjs99.js.map +1 -1
- package/dist/index.es100.js +9 -11
- package/dist/index.es100.js.map +1 -1
- package/dist/index.es101.js +11 -12
- package/dist/index.es101.js.map +1 -1
- package/dist/index.es102.js +10 -83
- package/dist/index.es102.js.map +1 -1
- package/dist/index.es103.js +86 -3
- package/dist/index.es103.js.map +1 -1
- package/dist/index.es104.js +3 -15
- package/dist/index.es104.js.map +1 -1
- package/dist/index.es105.js +12 -9
- package/dist/index.es105.js.map +1 -1
- package/dist/index.es106.js +10 -5
- package/dist/index.es106.js.map +1 -1
- package/dist/index.es107.js +6 -6
- package/dist/index.es107.js.map +1 -1
- package/dist/index.es108.js +6 -6
- package/dist/index.es108.js.map +1 -1
- package/dist/index.es109.js +6 -7
- package/dist/index.es109.js.map +1 -1
- package/dist/index.es110.js +8 -4
- package/dist/index.es110.js.map +1 -1
- package/dist/index.es111.js +2 -2
- package/dist/index.es111.js.map +1 -1
- package/dist/index.es112.js +2 -2
- package/dist/index.es112.js.map +1 -1
- package/dist/index.es113.js +4 -7
- package/dist/index.es113.js.map +1 -1
- package/dist/index.es114.js +6 -6
- package/dist/index.es114.js.map +1 -1
- package/dist/index.es115.js +6 -3
- package/dist/index.es115.js.map +1 -1
- package/dist/index.es116.js +3 -7
- package/dist/index.es116.js.map +1 -1
- package/dist/index.es117.js +7 -12
- package/dist/index.es117.js.map +1 -1
- package/dist/index.es118.js +11 -9
- package/dist/index.es118.js.map +1 -1
- package/dist/index.es119.js +10 -3
- package/dist/index.es119.js.map +1 -1
- package/dist/index.es12.js +6 -6
- package/dist/index.es120.js +3 -5
- package/dist/index.es120.js.map +1 -1
- package/dist/index.es121.js +5 -2
- package/dist/index.es121.js.map +1 -1
- package/dist/index.es122.js +2 -7
- package/dist/index.es122.js.map +1 -1
- package/dist/index.es123.js +4 -4
- package/dist/index.es123.js.map +1 -1
- package/dist/index.es124.js +6 -6
- package/dist/index.es124.js.map +1 -1
- package/dist/index.es125.js +7 -8
- package/dist/index.es125.js.map +1 -1
- package/dist/index.es126.js +8 -3
- package/dist/index.es126.js.map +1 -1
- package/dist/index.es127.js +4 -4
- package/dist/index.es127.js.map +1 -1
- package/dist/index.es128.js +4 -58
- package/dist/index.es128.js.map +1 -1
- package/dist/index.es129.js +56 -12
- package/dist/index.es129.js.map +1 -1
- package/dist/index.es130.js +13 -5
- package/dist/index.es130.js.map +1 -1
- package/dist/index.es131.js +5 -5
- package/dist/index.es131.js.map +1 -1
- package/dist/index.es132.js +5 -8
- package/dist/index.es132.js.map +1 -1
- package/dist/index.es133.js +7 -15
- package/dist/index.es133.js.map +1 -1
- package/dist/index.es134.js +16 -13
- package/dist/index.es134.js.map +1 -1
- package/dist/index.es135.js +13 -4
- package/dist/index.es135.js.map +1 -1
- package/dist/index.es136.js +4 -5
- package/dist/index.es136.js.map +1 -1
- package/dist/index.es137.js +2 -5
- package/dist/index.es137.js.map +1 -1
- package/dist/index.es138.js +6 -4
- package/dist/index.es138.js.map +1 -1
- package/dist/index.es139.js +4 -4
- package/dist/index.es139.js.map +1 -1
- package/dist/index.es14.js +2 -2
- package/dist/index.es140.js +6 -8
- package/dist/index.es140.js.map +1 -1
- package/dist/index.es141.js +9 -3
- package/dist/index.es141.js.map +1 -1
- package/dist/index.es142.js +3 -3
- package/dist/index.es142.js.map +1 -1
- package/dist/index.es143.js +3 -11
- package/dist/index.es143.js.map +1 -1
- package/dist/index.es144.js +11 -5
- package/dist/index.es144.js.map +1 -1
- package/dist/index.es145.js +5 -4
- package/dist/index.es145.js.map +1 -1
- package/dist/index.es146.js +4 -9
- package/dist/index.es146.js.map +1 -1
- package/dist/index.es147.js +8 -5
- package/dist/index.es147.js.map +1 -1
- package/dist/index.es148.js +5 -16
- package/dist/index.es148.js.map +1 -1
- package/dist/index.es149.js +15 -10
- package/dist/index.es149.js.map +1 -1
- package/dist/index.es15.js +8 -8
- package/dist/index.es150.js +12 -3
- package/dist/index.es150.js.map +1 -1
- package/dist/index.es151.js +3 -3
- package/dist/index.es151.js.map +1 -1
- package/dist/index.es152.js +3 -9
- package/dist/index.es152.js.map +1 -1
- package/dist/index.es153.js +8 -6
- package/dist/index.es153.js.map +1 -1
- package/dist/index.es154.js +6 -12
- package/dist/index.es154.js.map +1 -1
- package/dist/index.es155.js +11 -11
- package/dist/index.es155.js.map +1 -1
- package/dist/index.es156.js +12 -6
- package/dist/index.es156.js.map +1 -1
- package/dist/index.es157.js +6 -5
- package/dist/index.es157.js.map +1 -1
- package/dist/index.es158.js +5 -5
- package/dist/index.es158.js.map +1 -1
- package/dist/index.es159.js +5 -16
- package/dist/index.es159.js.map +1 -1
- package/dist/index.es16.js +1 -1
- package/dist/index.es160.js +12 -12
- package/dist/index.es160.js.map +1 -1
- package/dist/index.es161.js +16 -4
- package/dist/index.es161.js.map +1 -1
- package/dist/index.es162.js +4 -16
- package/dist/index.es162.js.map +1 -1
- package/dist/index.es163.js +16 -22
- package/dist/index.es163.js.map +1 -1
- package/dist/index.es164.js +23 -6
- package/dist/index.es164.js.map +1 -1
- package/dist/index.es165.js +5 -4
- package/dist/index.es165.js.map +1 -1
- package/dist/index.es166.js +4 -5
- package/dist/index.es166.js.map +1 -1
- package/dist/index.es167.js +6 -5
- package/dist/index.es167.js.map +1 -1
- package/dist/index.es168.js +5 -12
- package/dist/index.es168.js.map +1 -1
- package/dist/index.es169.js +11 -5
- package/dist/index.es169.js.map +1 -1
- package/dist/index.es17.js +3 -3
- package/dist/index.es170.js +5 -4
- package/dist/index.es170.js.map +1 -1
- package/dist/index.es171.js +4 -4
- package/dist/index.es171.js.map +1 -1
- package/dist/index.es172.js +4 -4
- package/dist/index.es172.js.map +1 -1
- package/dist/index.es173.js +4 -4
- package/dist/index.es173.js.map +1 -1
- package/dist/index.es174.js +4 -4
- package/dist/index.es174.js.map +1 -1
- package/dist/index.es175.js +4 -4
- package/dist/index.es175.js.map +1 -1
- package/dist/index.es176.js +4 -12
- package/dist/index.es176.js.map +1 -1
- package/dist/index.es177.js +11 -13
- package/dist/index.es177.js.map +1 -1
- package/dist/index.es178.js +14 -8
- package/dist/index.es178.js.map +1 -1
- package/dist/index.es179.js +8 -6
- package/dist/index.es179.js.map +1 -1
- package/dist/index.es18.js +2832 -15806
- package/dist/index.es18.js.map +1 -1
- package/dist/index.es180.js +5 -5
- package/dist/index.es180.js.map +1 -1
- package/dist/index.es181.js +6 -8
- package/dist/index.es181.js.map +1 -1
- package/dist/index.es182.js +8 -320
- package/dist/index.es182.js.map +1 -1
- package/dist/index.es183.js +317 -71
- package/dist/index.es183.js.map +1 -1
- package/dist/index.es184.js +75 -3
- package/dist/index.es184.js.map +1 -1
- package/dist/index.es185.js +3 -16
- package/dist/index.es185.js.map +1 -1
- package/dist/index.es186.js +15 -10
- package/dist/index.es186.js.map +1 -1
- package/dist/index.es187.js +9 -29
- package/dist/index.es187.js.map +1 -1
- package/dist/index.es188.js +30 -4
- package/dist/index.es188.js.map +1 -1
- package/dist/index.es189.js +5 -2
- package/dist/index.es189.js.map +1 -1
- package/dist/index.es19.js +4 -4
- package/dist/index.es190.js +2 -2
- package/dist/index.es193.js +1 -1
- package/dist/index.es194.js +1 -1
- package/dist/index.es195.js +2 -2
- package/dist/index.es196.js +2 -2
- package/dist/index.es197.js +3 -3
- package/dist/index.es198.js +1 -1
- package/dist/index.es199.js +1 -1
- package/dist/index.es20.js +1 -8
- package/dist/index.es20.js.map +1 -1
- package/dist/index.es200.js +1 -1
- package/dist/index.es202.js +2 -2
- package/dist/index.es203.js +3 -3
- package/dist/index.es205.js +6 -44
- package/dist/index.es205.js.map +1 -1
- package/dist/index.es206.js +4 -22
- package/dist/index.es206.js.map +1 -1
- package/dist/index.es207.js +4 -8
- package/dist/index.es207.js.map +1 -1
- package/dist/index.es208.js +3 -5
- package/dist/index.es208.js.map +1 -1
- package/dist/index.es209.js +3 -4
- package/dist/index.es209.js.map +1 -1
- package/dist/index.es21.js +5 -5
- package/dist/index.es21.js.map +1 -1
- package/dist/index.es210.js +9 -3
- package/dist/index.es210.js.map +1 -1
- package/dist/index.es211.js +22 -3
- package/dist/index.es211.js.map +1 -1
- package/dist/index.es212.js +21 -8
- package/dist/index.es212.js.map +1 -1
- package/dist/index.es213.js +11 -19
- package/dist/index.es213.js.map +1 -1
- package/dist/index.es214.js +14 -19
- package/dist/index.es214.js.map +1 -1
- package/dist/index.es215.js +5 -13
- package/dist/index.es215.js.map +1 -1
- package/dist/index.es216.js +8 -16
- package/dist/index.es216.js.map +1 -1
- package/dist/index.es217.js +6 -5
- package/dist/index.es217.js.map +1 -1
- package/dist/index.es218.js +20 -7
- package/dist/index.es218.js.map +1 -1
- package/dist/index.es219.js +8 -5
- package/dist/index.es219.js.map +1 -1
- package/dist/index.es22.js +6 -5
- package/dist/index.es22.js.map +1 -1
- package/dist/index.es220.js +9 -22
- package/dist/index.es220.js.map +1 -1
- package/dist/index.es221.js +4 -10
- package/dist/index.es221.js.map +1 -1
- package/dist/index.es222.js +11 -9
- package/dist/index.es222.js.map +1 -1
- package/dist/index.es223.js +9 -4
- package/dist/index.es223.js.map +1 -1
- package/dist/index.es224.js +21 -9
- package/dist/index.es224.js.map +1 -1
- package/dist/index.es225.js +11 -8
- package/dist/index.es225.js.map +1 -1
- package/dist/index.es226.js +18 -22
- package/dist/index.es226.js.map +1 -1
- package/dist/index.es227.js +4 -12
- package/dist/index.es227.js.map +1 -1
- package/dist/index.es228.js +16 -17
- package/dist/index.es228.js.map +1 -1
- package/dist/index.es229.js +12 -4
- package/dist/index.es229.js.map +1 -1
- package/dist/index.es23.js +5 -28
- package/dist/index.es23.js.map +1 -1
- package/dist/index.es230.js +3 -17
- package/dist/index.es230.js.map +1 -1
- package/dist/index.es231.js +4 -11
- package/dist/index.es231.js.map +1 -1
- package/dist/index.es232.js +45 -3
- package/dist/index.es232.js.map +1 -1
- package/dist/index.es233.js +22 -4
- package/dist/index.es233.js.map +1 -1
- package/dist/index.es234.js +2 -3
- package/dist/index.es234.js.map +1 -1
- package/dist/index.es235.js +3 -6
- package/dist/index.es235.js.map +1 -1
- package/dist/index.es236.js +1 -1
- package/dist/index.es237.js +5 -24
- package/dist/index.es237.js.map +1 -1
- package/dist/index.es238.js +23 -15
- package/dist/index.es238.js.map +1 -1
- package/dist/index.es239.js +15 -29
- package/dist/index.es239.js.map +1 -1
- package/dist/index.es24.js +28 -8
- package/dist/index.es24.js.map +1 -1
- package/dist/index.es240.js +29 -20
- package/dist/index.es240.js.map +1 -1
- package/dist/index.es241.js +21 -75
- package/dist/index.es241.js.map +1 -1
- package/dist/index.es242.js +73 -18
- package/dist/index.es242.js.map +1 -1
- package/dist/index.es243.js +19 -47
- package/dist/index.es243.js.map +1 -1
- package/dist/index.es244.js +42 -48
- package/dist/index.es244.js.map +1 -1
- package/dist/index.es245.js +54 -8
- package/dist/index.es245.js.map +1 -1
- package/dist/index.es246.js +8 -20
- package/dist/index.es246.js.map +1 -1
- package/dist/index.es247.js +18 -63
- package/dist/index.es247.js.map +1 -1
- package/dist/index.es248.js +64 -41
- package/dist/index.es248.js.map +1 -1
- package/dist/index.es249.js +41 -64
- package/dist/index.es249.js.map +1 -1
- package/dist/index.es25.js +8 -5
- package/dist/index.es25.js.map +1 -1
- package/dist/index.es250.js +64 -7
- package/dist/index.es250.js.map +1 -1
- package/dist/index.es251.js +8 -3
- package/dist/index.es251.js.map +1 -1
- package/dist/index.es252.js +3 -12
- package/dist/index.es252.js.map +1 -1
- package/dist/index.es253.js +11 -58
- package/dist/index.es253.js.map +1 -1
- package/dist/index.es254.js +57 -54
- package/dist/index.es254.js.map +1 -1
- package/dist/index.es255.js +56 -2
- package/dist/index.es255.js.map +1 -1
- package/dist/index.es256.js +2 -4
- package/dist/index.es256.js.map +1 -1
- package/dist/index.es257.js +1 -1
- package/dist/index.es258.js +4 -70
- package/dist/index.es258.js.map +1 -1
- package/dist/index.es259.js +70 -3
- package/dist/index.es259.js.map +1 -1
- package/dist/index.es26.js +5 -10
- package/dist/index.es26.js.map +1 -1
- package/dist/index.es260.js +3 -24
- package/dist/index.es260.js.map +1 -1
- package/dist/index.es261.js +28 -0
- package/dist/index.es261.js.map +1 -0
- package/dist/index.es27.js +10 -17
- package/dist/index.es27.js.map +1 -1
- package/dist/index.es28.js +17 -5
- package/dist/index.es28.js.map +1 -1
- package/dist/index.es29.js +5 -5
- package/dist/index.es29.js.map +1 -1
- package/dist/index.es30.js +5 -5
- package/dist/index.es30.js.map +1 -1
- package/dist/index.es31.js +4 -6
- package/dist/index.es31.js.map +1 -1
- package/dist/index.es32.js +6 -6
- package/dist/index.es32.js.map +1 -1
- package/dist/index.es33.js +7 -4
- package/dist/index.es33.js.map +1 -1
- package/dist/index.es34.js +2 -2
- package/dist/index.es34.js.map +1 -1
- package/dist/index.es35.js +4 -7
- package/dist/index.es35.js.map +1 -1
- package/dist/index.es36.js +7 -15
- package/dist/index.es36.js.map +1 -1
- package/dist/index.es37.js +14 -11
- package/dist/index.es37.js.map +1 -1
- package/dist/index.es38.js +11 -14
- package/dist/index.es38.js.map +1 -1
- package/dist/index.es39.js +14 -6
- package/dist/index.es39.js.map +1 -1
- package/dist/index.es4.js +6 -5
- package/dist/index.es4.js.map +1 -1
- package/dist/index.es40.js +7 -5
- package/dist/index.es40.js.map +1 -1
- package/dist/index.es41.js +5 -4
- package/dist/index.es41.js.map +1 -1
- package/dist/index.es42.js +4 -18
- package/dist/index.es42.js.map +1 -1
- package/dist/index.es43.js +17 -17
- package/dist/index.es43.js.map +1 -1
- package/dist/index.es44.js +17 -13
- package/dist/index.es44.js.map +1 -1
- package/dist/index.es45.js +13 -5
- package/dist/index.es45.js.map +1 -1
- package/dist/index.es46.js +5 -6
- package/dist/index.es46.js.map +1 -1
- package/dist/index.es47.js +6 -9
- package/dist/index.es47.js.map +1 -1
- package/dist/index.es48.js +10 -4
- package/dist/index.es48.js.map +1 -1
- package/dist/index.es49.js +4 -19
- package/dist/index.es49.js.map +1 -1
- package/dist/index.es5.js +5 -5
- package/dist/index.es50.js +21 -1
- package/dist/index.es50.js.map +1 -1
- package/dist/index.es51.js +1 -18
- package/dist/index.es51.js.map +1 -1
- package/dist/index.es52.js +18 -1
- package/dist/index.es52.js.map +1 -1
- package/dist/index.es53.js +1 -86
- package/dist/index.es53.js.map +1 -1
- package/dist/index.es54.js +71 -13817
- package/dist/index.es54.js.map +1 -1
- package/dist/index.es55.js +13830 -9
- package/dist/index.es55.js.map +1 -1
- package/dist/index.es56.js +8 -9
- package/dist/index.es56.js.map +1 -1
- package/dist/index.es57.js +9 -84
- package/dist/index.es57.js.map +1 -1
- package/dist/index.es58.js +84 -5
- package/dist/index.es58.js.map +1 -1
- package/dist/index.es59.js +6 -2
- package/dist/index.es59.js.map +1 -1
- package/dist/index.es6.js +2 -2
- package/dist/index.es61.js +2 -30
- package/dist/index.es61.js.map +1 -1
- package/dist/index.es62.js +2 -602
- package/dist/index.es62.js.map +1 -1
- package/dist/index.es63.js +30 -2
- package/dist/index.es63.js.map +1 -1
- package/dist/index.es64.js +601 -106
- package/dist/index.es64.js.map +1 -1
- package/dist/index.es65.js +107 -10
- package/dist/index.es65.js.map +1 -1
- package/dist/index.es66.js +10 -2
- package/dist/index.es66.js.map +1 -1
- package/dist/index.es67.js +55 -2
- package/dist/index.es67.js.map +1 -1
- package/dist/index.es68.js +47 -56
- package/dist/index.es68.js.map +1 -1
- package/dist/index.es69.js +37 -46
- package/dist/index.es69.js.map +1 -1
- package/dist/index.es7.js +2 -2
- package/dist/index.es70.js +11 -38
- package/dist/index.es70.js.map +1 -1
- package/dist/index.es71.js +13 -10
- package/dist/index.es71.js.map +1 -1
- package/dist/index.es72.js +29 -14
- package/dist/index.es72.js.map +1 -1
- package/dist/index.es73.js +14 -29
- package/dist/index.es73.js.map +1 -1
- package/dist/index.es74.js +12 -13
- package/dist/index.es74.js.map +1 -1
- package/dist/index.es75.js +12 -13
- package/dist/index.es75.js.map +1 -1
- package/dist/index.es76.js +2 -11
- package/dist/index.es76.js.map +1 -1
- package/dist/index.es77.js +2 -28
- package/dist/index.es77.js.map +1 -1
- package/dist/index.es78.js +26 -49
- package/dist/index.es78.js.map +1 -1
- package/dist/index.es79.js +44 -58
- package/dist/index.es79.js.map +1 -1
- package/dist/index.es8.js +39 -38
- package/dist/index.es8.js.map +1 -1
- package/dist/index.es80.js +65 -273
- package/dist/index.es80.js.map +1 -1
- package/dist/index.es81.js +273 -15
- package/dist/index.es81.js.map +1 -1
- package/dist/index.es82.js +14 -18
- package/dist/index.es82.js.map +1 -1
- package/dist/index.es83.js +18 -4
- package/dist/index.es83.js.map +1 -1
- package/dist/index.es84.js +4 -3
- package/dist/index.es84.js.map +1 -1
- package/dist/index.es85.js +3 -3
- package/dist/index.es85.js.map +1 -1
- package/dist/index.es86.js +3 -4
- package/dist/index.es86.js.map +1 -1
- package/dist/index.es87.js +4 -3
- package/dist/index.es87.js.map +1 -1
- package/dist/index.es88.js +4 -3
- package/dist/index.es88.js.map +1 -1
- package/dist/index.es89.js +3 -3
- package/dist/index.es89.js.map +1 -1
- package/dist/index.es90.js +3 -3
- package/dist/index.es90.js.map +1 -1
- package/dist/index.es91.js +3 -3
- package/dist/index.es91.js.map +1 -1
- package/dist/index.es92.js +3 -3
- package/dist/index.es92.js.map +1 -1
- package/dist/index.es93.js +3 -3
- package/dist/index.es93.js.map +1 -1
- package/dist/index.es94.js +3 -3
- package/dist/index.es94.js.map +1 -1
- package/dist/index.es95.js +3 -10
- package/dist/index.es95.js.map +1 -1
- package/dist/index.es96.js +10 -4
- package/dist/index.es96.js.map +1 -1
- package/dist/index.es97.js +4 -6
- package/dist/index.es97.js.map +1 -1
- package/dist/index.es98.js +5 -5
- package/dist/index.es98.js.map +1 -1
- package/dist/index.es99.js +5 -9
- package/dist/index.es99.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/src/components/GeocodingControl.css +3 -0
- package/src/components/GeocodingControl.js +1 -0
- package/src/components/MapDraw.js +6 -3
- package/types/components/GeocodingControl.js.flow +1 -0
- package/types/components/LocationMarker.js.flow +82 -0
- package/types/components/MapDraw.js.flow +6 -3
package/dist/index.cjs18.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Gl=require("./index.cjs19.js");var kl=Object.defineProperty,ql=(t,e,n)=>e in t?kl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,pa=(t,e,n)=>(ql(t,typeof e!="symbol"?e+"":e,n),n),hu=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},bn=(t,e,n)=>(hu(t,e,"read from private field"),n?n.call(t):e.get(t)),ha=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},xs=(t,e,n,r)=>(hu(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n);function Nt(){}function Bl(t,e){for(const n in e)t[n]=e[n];return t}function fu(t){return t()}function fa(){return Object.create(null)}function xr(t){t.forEach(fu)}function gu(t){return typeof t=="function"}function Ur(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let wo;function ye(t,e){return t===e?!0:(wo||(wo=document.createElement("a")),wo.href=e,t===wo.href)}function zl(t){return Object.keys(t).length===0}function Ul(t,e,n,r){if(t){const i=du(t,e,n,r);return t[0](i)}}function du(t,e,n,r){return t[1]&&r?Bl(n.ctx.slice(),t[1](r(e))):n.ctx}function Vl(t,e,n,r){if(t[2]&&r){const i=t[2](r(n));if(e.dirty===void 0)return i;if(typeof i=="object"){const o=[],s=Math.max(e.dirty.length,i.length);for(let a=0;a<s;a+=1)o[a]=e.dirty[a]|i[a];return o}return e.dirty|i}return e.dirty}function $l(t,e,n,r,i,o){if(i){const s=du(e,n,r,o);t.p(s,i)}}function Xl(t){if(t.ctx.length>32){const e=[],n=t.ctx.length/32;for(let r=0;r<n;r++)e[r]=-1;return e}return-1}function ga(t){return t??""}function nt(t,e){t.appendChild(e)}function Rt(t,e,n){t.insertBefore(e,n||null)}function Ct(t){t.parentNode&&t.parentNode.removeChild(t)}function ht(t){return document.createElement(t)}function Sn(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function Rr(t){return document.createTextNode(t)}function Ve(){return Rr(" ")}function jl(){return Rr("")}function be(t,e,n,r){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}function Yl(t){return function(e){return e.preventDefault(),t.call(this,e)}}function L(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function Wl(t){return Array.from(t.childNodes)}function Qi(t,e){e=""+e,t.data!==e&&(t.data=e)}function da(t,e){t.value=e??""}function To(t,e,n,r){n==null?t.style.removeProperty(e):t.style.setProperty(e,n,r?"important":"")}function un(t,e,n){t.classList.toggle(e,!!n)}function Hl(t,e,{bubbles:n=!1,cancelable:r=!1}={}){return new CustomEvent(t,{detail:e,bubbles:n,cancelable:r})}let to;function Ki(t){to=t}function mu(){if(!to)throw new Error("Function called outside component initialization");return to}function Zl(t){mu().$$.on_destroy.push(t)}function Kl(){const t=mu();return(e,n,{cancelable:r=!1}={})=>{const i=t.$$.callbacks[e];if(i){const o=Hl(e,n,{cancelable:r});return i.slice().forEach(s=>{s.call(t,o)}),!o.defaultPrevented}return!0}}function ma(t,e){const n=t.$$.callbacks[e.type];n&&n.slice().forEach(r=>r.call(this,e))}const mi=[],Ss=[];let vi=[];const ya=[],Jl=Promise.resolve();let ws=!1;function Ql(){ws||(ws=!0,Jl.then(yu))}function Ts(t){vi.push(t)}const Is=new Set;let di=0;function yu(){if(di!==0)return;const t=to;do{try{for(;di<mi.length;){const e=mi[di];di++,Ki(e),tc(e.$$)}}catch(e){throw mi.length=0,di=0,e}for(Ki(null),mi.length=0,di=0;Ss.length;)Ss.pop()();for(let e=0;e<vi.length;e+=1){const n=vi[e];Is.has(n)||(Is.add(n),n())}vi.length=0}while(mi.length);for(;ya.length;)ya.pop()();ws=!1,Is.clear(),Ki(t)}function tc(t){if(t.fragment!==null){t.update(),xr(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(Ts)}}function ec(t){const e=[],n=[];vi.forEach(r=>t.indexOf(r)===-1?e.push(r):n.push(r)),n.forEach(r=>r()),vi=e}const Fo=new Set;let Yr;function Go(){Yr={r:0,c:[],p:Yr}}function ko(){Yr.r||xr(Yr.c),Yr=Yr.p}function Gt(t,e){t&&t.i&&(Fo.delete(t),t.i(e))}function ee(t,e,n,r){if(t&&t.o){if(Fo.has(t))return;Fo.add(t),Yr.c.push(()=>{Fo.delete(t),r&&(n&&t.d(1),r())}),t.o(e)}else r&&r()}function _a(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function nc(t,e){ee(t,1,1,()=>{e.delete(t.key)})}function rc(t,e,n,r,i,o,s,a,u,l,c,p){let h=t.length,g=o.length,f=h;const m={};for(;f--;)m[t[f].key]=f;const y=[],v=new Map,x=new Map,I=[];for(f=g;f--;){const S=p(i,o,f),T=n(S);let w=s.get(T);w?r&&I.push(()=>w.p(S,e)):(w=l(T,S),w.c()),v.set(T,y[f]=w),T in m&&x.set(T,Math.abs(f-m[T]))}const C=new Set,P=new Set;function D(S){Gt(S,1),S.m(a,c),s.set(S.key,S),c=S.first,g--}for(;h&&g;){const S=y[g-1],T=t[h-1],w=S.key,A=T.key;S===T?(c=S.first,h--,g--):v.has(A)?!s.has(w)||C.has(w)?D(S):P.has(A)?h--:x.get(w)>x.get(A)?(P.add(w),D(S)):(C.add(A),h--):(u(T,s),h--)}for(;h--;){const S=t[h];v.has(S.key)||u(S,s)}for(;g;)D(y[g-1]);return xr(I),y}function Or(t){t&&t.c()}function cr(t,e,n){const{fragment:r,after_update:i}=t.$$;r&&r.m(e,n),Ts(()=>{const o=t.$$.on_mount.map(fu).filter(gu);t.$$.on_destroy?t.$$.on_destroy.push(...o):xr(o),t.$$.on_mount=[]}),i.forEach(Ts)}function pr(t,e){const n=t.$$;n.fragment!==null&&(ec(n.after_update),xr(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function ic(t,e){t.$$.dirty[0]===-1&&(mi.push(t),Ql(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function Vr(t,e,n,r,i,o,s=null,a=[-1]){const u=to;Ki(t);const l=t.$$={fragment:null,ctx:[],props:o,update:Nt,not_equal:i,bound:fa(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(u?u.$$.context:[])),callbacks:fa(),dirty:a,skip_bound:!1,root:e.target||u.$$.root};s&&s(l.root);let c=!1;if(l.ctx=n?n(t,e.props||{},(p,h,...g)=>{const f=g.length?g[0]:h;return l.ctx&&i(l.ctx[p],l.ctx[p]=f)&&(!l.skip_bound&&l.bound[p]&&l.bound[p](f),c&&ic(t,p)),h}):[],l.update(),c=!0,xr(l.before_update),l.fragment=r?r(l.ctx):!1,e.target){if(e.hydrate){const p=Wl(e.target);l.fragment&&l.fragment.l(p),p.forEach(Ct)}else l.fragment&&l.fragment.c();e.intro&&Gt(t.$$.fragment),cr(t,e.target,e.anchor),yu()}Ki(u)}class $r{constructor(){pa(this,"$$"),pa(this,"$$set")}$destroy(){pr(this,1),this.$destroy=Nt}$on(e,n){if(!gu(n))return Nt;const r=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return r.push(n),()=>{const i=r.indexOf(n);i!==-1&&r.splice(i,1)}}$set(e){this.$$set&&!zl(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const oc="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(oc);function sc(t){let e,n;return{c(){e=Sn("svg"),n=Sn("path"),L(n,"d","M13.12.706a.982.982 0 0 0-1.391 0L6.907 5.517 2.087.696a.982.982 0 1 0-1.391 1.39l4.821 4.821L.696 11.73a.982.982 0 1 0 1.39 1.39l4.821-4.821 4.822 4.821a.982.982 0 1 0 1.39-1.39L8.298 6.908l4.821-4.822a.988.988 0 0 0 0-1.38Z"),L(e,"viewBox","0 0 14 14"),L(e,"width","13"),L(e,"height","13"),L(e,"class","svelte-en2qvf")},m(r,i){Rt(r,e,i),nt(e,n)},p:Nt,i:Nt,o:Nt,d(r){r&&Ct(e)}}}class _u extends $r{constructor(e){super(),Vr(this,e,null,sc,Ur,{})}}function ac(t){let e,n;return{c(){e=Sn("svg"),n=Sn("path"),L(n,"d","M15 0C6.705 0 0 6.705 0 15C0 23.295 6.705 30 15 30C23.295 30 30 23.295 30 15C30 6.705 23.295 0 15 0ZM22.5 20.385L20.385 22.5L15 17.115L9.615 22.5L7.5 20.385L12.885 15L7.5 9.615L9.615 7.5L15 12.885L20.385 7.5L22.5 9.615L17.115 15L22.5 20.385Z"),L(e,"viewBox","0 0 30 30"),L(e,"fill","none"),L(e,"xmlns","http://www.w3.org/2000/svg"),L(e,"class","svelte-d2loi5")},m(r,i){Rt(r,e,i),nt(e,n)},p:Nt,i:Nt,o:Nt,d(r){r&&Ct(e)}}}class vu extends $r{constructor(e){super(),Vr(this,e,null,ac,Ur,{})}}function uc(t){let e,n;return{c(){e=ht("img"),ye(e.src,n=t[3]+"area.svg")||L(e,"src",n),L(e,"alt",t[6]),L(e,"class","svelte-ltkwvy")},m(r,i){Rt(r,e,i)},p(r,i){i&8&&!ye(e.src,n=r[3]+"area.svg")&&L(e,"src",n),i&64&&L(e,"alt",r[6])},d(r){r&&Ct(e)}}}function lc(t){let e,n;return{c(){e=ht("img"),ye(e.src,n=t[3]+"reverse.svg")||L(e,"src",n),L(e,"alt",t[6]),L(e,"class","svelte-ltkwvy")},m(r,i){Rt(r,e,i)},p(r,i){i&8&&!ye(e.src,n=r[3]+"reverse.svg")&&L(e,"src",n),i&64&&L(e,"alt",r[6])},d(r){r&&Ct(e)}}}function cc(t){let e,n;return{c(){e=ht("img"),ye(e.src,n=t[3]+"poi.svg")||L(e,"src",n),L(e,"alt",t[6]),L(e,"class","svelte-ltkwvy")},m(r,i){Rt(r,e,i)},p(r,i){i&8&&!ye(e.src,n=r[3]+"poi.svg")&&L(e,"src",n),i&64&&L(e,"alt",r[6])},d(r){r&&Ct(e)}}}function pc(t){let e,n;return{c(){e=ht("img"),ye(e.src,n=t[3]+"postal_code.svg")||L(e,"src",n),L(e,"alt",t[6]),L(e,"class","svelte-ltkwvy")},m(r,i){Rt(r,e,i)},p(r,i){i&8&&!ye(e.src,n=r[3]+"postal_code.svg")&&L(e,"src",n),i&64&&L(e,"alt",r[6])},d(r){r&&Ct(e)}}}function hc(t){let e,n;return{c(){e=ht("img"),ye(e.src,n=t[3]+"street.svg")||L(e,"src",n),L(e,"alt",t[6]),L(e,"class","svelte-ltkwvy")},m(r,i){Rt(r,e,i)},p(r,i){i&8&&!ye(e.src,n=r[3]+"street.svg")&&L(e,"src",n),i&64&&L(e,"alt",r[6])},d(r){r&&Ct(e)}}}function fc(t){let e,n;return{c(){e=ht("img"),ye(e.src,n=t[3]+"road.svg")||L(e,"src",n),L(e,"alt",t[6]),L(e,"class","svelte-ltkwvy")},m(r,i){Rt(r,e,i)},p(r,i){i&8&&!ye(e.src,n=r[3]+"road.svg")&&L(e,"src",n),i&64&&L(e,"alt",r[6])},d(r){r&&Ct(e)}}}function gc(t){let e,n;return{c(){e=ht("img"),ye(e.src,n=t[3]+"housenumber.svg")||L(e,"src",n),L(e,"alt",t[6]),L(e,"class","svelte-ltkwvy")},m(r,i){Rt(r,e,i)},p(r,i){i&8&&!ye(e.src,n=r[3]+"housenumber.svg")&&L(e,"src",n),i&64&&L(e,"alt",r[6])},d(r){r&&Ct(e)}}}function dc(t){let e,n,r,i;return{c(){e=ht("img"),ye(e.src,n=t[5])||L(e,"src",n),L(e,"alt",t[4]),L(e,"class","svelte-ltkwvy")},m(o,s){Rt(o,e,s),r||(i=be(e,"error",t[14]),r=!0)},p(o,s){s&32&&!ye(e.src,n=o[5])&&L(e,"src",n),s&16&&L(e,"alt",o[4])},d(o){o&&Ct(e),r=!1,i()}}}function va(t){let e,n;return{c(){e=ht("span"),n=Rr(t[6]),L(e,"class","secondary svelte-ltkwvy")},m(r,i){Rt(r,e,i),nt(e,n)},p(r,i){i&64&&Qi(n,r[6])},d(r){r&&Ct(e)}}}function mc(t){var e,n;let r,i,o,s,a,u,l,c,p=(t[7]?t[0].place_name:t[0].place_name.replace(/,.*/,""))+"",h,g,f=t[2]==="always"||t[2]&&!t[0].address&&((e=t[0].properties)==null?void 0:e.kind)!=="road"&&((n=t[0].properties)==null?void 0:n.kind)!=="road_relation"&&!t[0].id.startsWith("address.")&&!t[0].id.startsWith("postal_code.")&&(!t[0].id.startsWith("poi.")||!t[5])&&!t[7],m,y,v=(t[7]?"":t[0].place_name.replace(/[^,]*,?\s*/,""))+"",x,I,C;function P(w,A){var X,k;return A&1&&(i=null),A&1&&(o=null),A&1&&(s=null),w[5]?dc:w[0].address?gc:((X=w[0].properties)==null?void 0:X.kind)==="road"||((k=w[0].properties)==null?void 0:k.kind)==="road_relation"?fc:(i==null&&(i=!!w[0].id.startsWith("address.")),i?hc:(o==null&&(o=!!w[0].id.startsWith("postal_code.")),o?pc:(s==null&&(s=!!w[0].id.startsWith("poi.")),s?cc:w[7]?lc:uc)))}let D=P(t,-1),S=D(t),T=f&&va(t);return{c(){r=ht("li"),S.c(),a=Ve(),u=ht("span"),l=ht("span"),c=ht("span"),h=Rr(p),g=Ve(),T&&T.c(),m=Ve(),y=ht("span"),x=Rr(v),L(c,"class","primary svelte-ltkwvy"),L(l,"class","svelte-ltkwvy"),L(y,"class","line2 svelte-ltkwvy"),L(u,"class","texts svelte-ltkwvy"),L(r,"tabindex","0"),L(r,"data-selected",t[1]),L(r,"class","svelte-ltkwvy"),un(r,"selected",t[1])},m(w,A){Rt(w,r,A),S.m(r,null),nt(r,a),nt(r,u),nt(u,l),nt(l,c),nt(c,h),nt(l,g),T&&T.m(l,null),nt(u,m),nt(u,y),nt(y,x),I||(C=[be(r,"mouseenter",t[12]),be(r,"focus",t[13])],I=!0)},p(w,[A]){var X,k;D===(D=P(w,A))&&S?S.p(w,A):(S.d(1),S=D(w),S&&(S.c(),S.m(r,a))),A&1&&p!==(p=(w[7]?w[0].place_name:w[0].place_name.replace(/,.*/,""))+"")&&Qi(h,p),A&37&&(f=w[2]==="always"||w[2]&&!w[0].address&&((X=w[0].properties)==null?void 0:X.kind)!=="road"&&((k=w[0].properties)==null?void 0:k.kind)!=="road_relation"&&!w[0].id.startsWith("address.")&&!w[0].id.startsWith("postal_code.")&&(!w[0].id.startsWith("poi.")||!w[5])&&!w[7]),f?T?T.p(w,A):(T=va(w),T.c(),T.m(l,null)):T&&(T.d(1),T=null),A&1&&v!==(v=(w[7]?"":w[0].place_name.replace(/[^,]*,?\s*/,""))+"")&&Qi(x,v),A&2&&L(r,"data-selected",w[1]),A&2&&un(r,"selected",w[1])},i:Nt,o:Nt,d(w){w&&Ct(r),S.d(),T&&T.d(),I=!1,xr(C)}}}function yc(t,e,n){var r;let i,o,{feature:s}=e,{selected:a=!1}=e,{showPlaceType:u}=e,{missingIconsCache:l}=e,{iconsBaseUrl:c}=e;const p=(r=s.properties)==null?void 0:r.categories;let h,g,f=0,m=s.place_type[0]==="reverse";function y(C){g&&l.add(g),n(10,f++,f)}function v(C){ma.call(this,t,C)}function x(C){ma.call(this,t,C)}const I=C=>y(C.currentTarget);return t.$$set=C=>{"feature"in C&&n(0,s=C.feature),"selected"in C&&n(1,a=C.selected),"showPlaceType"in C&&n(2,u=C.showPlaceType),"missingIconsCache"in C&&n(9,l=C.missingIconsCache),"iconsBaseUrl"in C&&n(3,c=C.iconsBaseUrl)},t.$$.update=()=>{var C,P,D,S;if(t.$$.dirty&3640)do n(11,i--,i),n(4,h=p==null?void 0:p[i]),n(5,g=h?c+h.replace(/ /g,"_")+".svg":void 0);while(i>-1&&(!g||l.has(g)));t.$$.dirty&1&&n(6,o=s.id.startsWith("poi.")?(P=(C=s.properties)==null?void 0:C.categories)==null?void 0:P.join(", "):((S=(D=s.properties)==null?void 0:D.place_type_name)==null?void 0:S[0])??s.place_type[0])},n(11,i=(p==null?void 0:p.length)??0),[s,a,u,c,h,g,o,m,y,l,f,i,v,x,I]}class _c extends $r{constructor(e){super(),Vr(this,e,yc,mc,Ur,{feature:0,selected:1,showPlaceType:2,missingIconsCache:9,iconsBaseUrl:3})}}function vc(t){let e;return{c(){e=ht("div"),e.innerHTML='<svg viewBox="0 0 18 18" width="24" height="24" class="svelte-7cmwmc"><path fill="#333" d="M4.4 4.4l.8.8c2.1-2.1 5.5-2.1 7.6 0l.8-.8c-2.5-2.5-6.7-2.5-9.2 0z"></path><path opacity=".1" d="M12.8 12.9c-2.1 2.1-5.5 2.1-7.6 0-2.1-2.1-2.1-5.5 0-7.7l-.8-.8c-2.5 2.5-2.5 6.7 0 9.2s6.6 2.5 9.2 0 2.5-6.6 0-9.2l-.8.8c2.2 2.1 2.2 5.6 0 7.7z"></path></svg>',L(e,"class","svelte-7cmwmc")},m(n,r){Rt(n,e,r)},p:Nt,i:Nt,o:Nt,d(n){n&&Ct(e)}}}class Ec extends $r{constructor(e){super(),Vr(this,e,null,vc,Ur,{})}}function xc(t){let e,n,r;return{c(){e=Sn("svg"),n=Sn("path"),L(n,"stroke-width","4"),L(n,"d","M 5,33.103579 C 5,17.607779 18.457,5 35,5 C 51.543,5 65,17.607779 65,33.103579 C 65,56.388679 40.4668,76.048179 36.6112,79.137779 C 36.3714,79.329879 36.2116,79.457979 36.1427,79.518879 C 35.8203,79.800879 35.4102,79.942779 35,79.942779 C 34.5899,79.942779 34.1797,79.800879 33.8575,79.518879 C 33.7886,79.457979 33.6289,79.330079 33.3893,79.138079 C 29.5346,76.049279 5,56.389379 5,33.103579 Z M 35.0001,49.386379 C 43.1917,49.386379 49.8323,42.646079 49.8323,34.331379 C 49.8323,26.016779 43.1917,19.276479 35.0001,19.276479 C 26.8085,19.276479 20.1679,26.016779 20.1679,34.331379 C 20.1679,42.646079 26.8085,49.386379 35.0001,49.386379 Z"),L(n,"class","svelte-gzo3ar"),L(e,"width",r=t[0]==="list"?20:void 0),L(e,"viewBox","0 0 70 85"),L(e,"fill","none"),L(e,"class","svelte-gzo3ar"),un(e,"in-map",t[0]!=="list"),un(e,"list-icon",t[0]==="list")},m(i,o){Rt(i,e,o),nt(e,n)},p(i,[o]){o&1&&r!==(r=i[0]==="list"?20:void 0)&&L(e,"width",r),o&1&&un(e,"in-map",i[0]!=="list"),o&1&&un(e,"list-icon",i[0]==="list")},i:Nt,o:Nt,d(i){i&&Ct(e)}}}function Ic(t,e,n){let{displayIn:r}=e;return t.$$set=i=>{"displayIn"in i&&n(0,r=i.displayIn)},[r]}class Nc extends $r{constructor(e){super(),Vr(this,e,Ic,xc,Ur,{displayIn:0})}}function bc(t){let e,n;return{c(){e=Sn("svg"),n=Sn("path"),L(n,"d","M30.003-26.765C13.46-26.765 0-14.158 0 1.337c0 23.286 24.535 42.952 28.39 46.04.24.192.402.316.471.376.323.282.732.424 1.142.424.41 0 .82-.142 1.142-.424.068-.06.231-.183.471-.376 3.856-3.09 28.39-22.754 28.39-46.04 0-15.495-13.46-28.102-30.003-28.102Zm1.757 12.469c4.38 0 7.858 1.052 10.431 3.158 2.595 2.105 3.89 4.913 3.89 8.422 0 2.34-.53 4.362-1.593 6.063-1.063 1.702-3.086 3.616-6.063 5.742-2.042 1.51-3.337 2.659-3.89 3.446-.532.787-.8 1.82-.8 3.096v1.914h-8.449V15.18c0-2.041.434-3.815 1.306-5.325.872-1.51 2.467-3.118 4.785-4.82 2.233-1.594 3.7-2.89 4.402-3.889a5.582 5.582 0 0 0 1.087-3.35c0-1.382-.51-2.435-1.531-3.158-1.02-.723-2.45-1.087-4.28-1.087-3.19 0-6.826 1.047-10.91 3.131l-3.472-6.986c4.742-2.659 9.77-3.992 15.087-3.992Zm-1.88 37.324c1.765 0 3.124.472 4.08 1.408.98.936 1.47 2.276 1.47 4.02 0 1.68-.49 3.007-1.47 3.985-.977.957-2.336 1.435-4.08 1.435-1.787 0-3.171-.465-4.15-1.4-.978-.958-1.47-2.298-1.47-4.02 0-1.787.48-3.14 1.436-4.054.957-.915 2.355-1.374 4.184-1.374Z"),L(e,"viewBox","0 0 60.006 21.412"),L(e,"width","14"),L(e,"height","20"),L(e,"class","svelte-en2qvf")},m(r,i){Rt(r,e,i),nt(e,n)},p:Nt,i:Nt,o:Nt,d(r){r&&Ct(e)}}}class Cc extends $r{constructor(e){super(),Vr(this,e,null,bc,Ur,{})}}function Lc(t){let e,n,r;return{c(){e=Sn("svg"),n=Sn("circle"),r=Sn("path"),L(n,"cx","4.789"),L(n,"cy","4.787"),L(n,"r","3.85"),To(n,"stroke-width","1.875"),To(n,"fill","none"),L(r,"d","M12.063 12.063 7.635 7.635"),To(r,"stroke-width","1.875"),To(r,"stroke-linecap","round"),L(e,"xmlns","http://www.w3.org/2000/svg"),L(e,"width","13"),L(e,"height","13"),L(e,"viewBox","0 0 13 13"),L(e,"class","svelte-1bpbt60")},m(i,o){Rt(i,e,o),nt(e,n),nt(e,r)},p:Nt,i:Nt,o:Nt,d(i){i&&Ct(e)}}}class Sc extends $r{constructor(e){super(),Vr(this,e,null,Lc,Ur,{})}}function wc(t,e,n){const r=e[1],i=e[0],o=r-i;return t===r&&n?t:((t-i)%o+o)%o+i}function Ea(t){const e=[...t];return e[2]<e[0]&&(e[2]+=360),e}let ji;async function Tc(t,e,n){const r=t==null?void 0:t.getCenterAndZoom();for(const i of e??[])if(!(r&&(i.minZoom!=null&&i.minZoom>r[0]||i.maxZoom!=null&&i.maxZoom<r[0]))){if(i.type==="fixed")return i.coordinates.join(",");t:if(i.type==="client-geolocation"){if(ji&&i.cachedLocationExpiry&&ji.time+i.cachedLocationExpiry>Date.now()){if(!ji.coords)break t;return ji.coords}let o;try{return o=await new Promise((s,a)=>{n.signal.addEventListener("abort",()=>{a(Error("aborted"))}),navigator.geolocation.getCurrentPosition(u=>{s([u.coords.longitude,u.coords.latitude].map(l=>l.toFixed(6)).join(","))},u=>{a(u)},i)}),o}catch{}finally{i.cachedLocationExpiry&&(ji={time:Date.now(),coords:o})}if(n.signal.aborted)return}if(i.type==="server-geolocation")return"ip";if(r&&i.type==="map-center")return r[1].toFixed(6)+","+r[2].toFixed(6)}}const xa=/(NORTH|SOUTH|[NS])?[\s]*([+-]?[0-8]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(NORTH|SOUTH|[NS])?[\s]*[,/;]?[\s]*(EAST|WEST|[EW])?[\s]*([+-]?[0-1]?[0-9]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(EAST|WEST|[EW])?/i,Ia=/(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(EAST|WEST|[EW])?/i,Na=/(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)\s*(EAST|WEST|[EW])?/i,ba=/(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|’’|´´|["″”\.])?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|´´|’’|["″”\.])?\s*(EAST|WEST|[EW])?/i;function Rc(t){if(!["DMS","DM","DD"].includes(t))throw new Error("invalid format specified");if(this.decimalCoordinates&&this.decimalCoordinates.trim()){if(t=="DD")return this.decimalCoordinates;const e=this.decimalCoordinates.split(",").map(s=>Number(s.trim()));let n=Ca(e[0],t),r=Ca(e[1],t);n.endsWith('.0"')&&r.endsWith('.0"')&&(n=n.replace(/\.0"$/,'"'),r=r.replace(/\.0"$/,'"'));const i=e[0]>=0?" N":" S",o=e[1]>=0?" E":" W";return`${n+i}, ${r+o}`}else throw new Error("no decimal coordinates to convert")}function Ca(t,e){const n=Math.abs(t),r=Math.floor(n),i=(n-r)*60;if(e=="DM"){let a=Oc(i,3).toFixed(3).padStart(6,"0");return`${r}° ${a}'`}let o=Math.floor(i),s=((i-o)*60).toFixed(1).padStart(4,"0");return o=o.toString().padStart(2,"0"),`${r}° ${o}' ${s}"`}function Oc(t,e){const n=Math.pow(10,e);return Math.round((t+Number.EPSILON)*n)/n}function $s(t,e){e||(e=5),t=t.replace(/\s+/g," ").trim();let n=null,r=null,i="",o="",s=[],a=!1;if(xa.test(t))if(s=xa.exec(t),a=Ro(s),a){if(n=s[2],r=s[6],n.includes(",")&&(n=n.replace(",",".")),r.includes(",")&&(r=r.replace(",",".")),Number(Math.round(n))==Number(n))throw new Error("integer only coordinate provided");if(Number(Math.round(r))==Number(r))throw new Error("integer only coordinate provided");s[1]?(i=s[1],o=s[5]):s[4]&&(i=s[4],o=s[8])}else throw new Error("invalid decimal coordinate format");else if(Ia.test(t))if(s=Ia.exec(t),a=Ro(s),a)n=Math.abs(parseInt(s[2])),s[4]&&(n+=s[4]/60),s[6]&&(n+=s[6].replace(",",".")/3600),parseInt(s[2])<0&&(n=-1*n),r=Math.abs(parseInt(s[9])),s[11]&&(r+=s[11]/60),s[13]&&(r+=s[13].replace(",",".")/3600),parseInt(s[9])<0&&(r=-1*r),s[1]?(i=s[1],o=s[8]):s[7]&&(i=s[7],o=s[14]);else throw new Error("invalid DMS coordinates format");else if(Na.test(t))if(s=Na.exec(t),a=Ro(s),a)n=Math.abs(parseInt(s[2])),s[4]&&(n+=s[4]/60),s[6]&&(n+=s[6]/3600),parseInt(s[2])<0&&(n=-1*n),r=Math.abs(parseInt(s[10])),s[12]&&(r+=s[12]/60),s[14]&&(r+=s[14]/3600),parseInt(s[10])<0&&(r=-1*r),s[1]?(i=s[1],o=s[9]):s[8]&&(i=s[8],o=s[16]);else throw new Error("invalid DMS coordinates format");else if(ba.test(t))if(s=ba.exec(t),a=Ro(s),a)n=Math.abs(parseInt(s[2])),s[4]&&(n+=s[4]/60),s[6]&&(n+=s[6]/3600),parseInt(s[2])<0&&(n=-1*n),r=Math.abs(parseInt(s[10])),s[12]&&(r+=s[12]/60),s[14]&&(r+=s[14]/3600),parseInt(s[10])<0&&(r=-1*r),s[1]?(i=s[1],o=s[9]):s[8]&&(i=s[8],o=s[16]);else throw new Error("invalid coordinates format");if(a){if(Math.abs(r)>=180)throw new Error("invalid longitude value");if(Math.abs(n)>=90)throw new Error("invalid latitude value");if((i||o)&&(!i||!o))throw new Error("invalid coordinates format");if(i&&i==o)throw new Error("invalid coordinates format");let u=/S|SOUTH/i;u.test(i)&&n>0&&(n=-1*n),u=/W|WEST/i,u.test(o)&&r>0&&(r=-1*r);const l=s[0].trim();let c,p;const h=/[,/;\u0020]/g,g=l.match(h);if(g==null){const y=Math.floor(t.length/2);c=l.substring(0,y).trim(),p=l.substring(y).trim()}else{let y;g.length%2==1?y=Math.floor(g.length/2):y=g.length/2-1;let v=0;if(y==0)v=l.indexOf(g[0]),c=l.substring(0,v).trim(),p=l.substring(v+1).trim();else{let x=0,I=0;for(;x<=y;)v=l.indexOf(g[x],I),I=v+1,x++;c=l.substring(0,v).trim(),p=l.substring(v+1).trim()}}const f=c.split(".");if(f.length==2&&f[1]==0&&f[1].length!=2)throw new Error("invalid coordinates format");const m=p.split(".");if(m.length==2&&m[1]==0&&m[1].length!=2)throw new Error("invalid coordinates format");if(/^\d+$/.test(c)||/^\d+$/.test(p))throw new Error("degree only coordinate/s provided");return isNaN(n)&&n.includes(",")&&(n=n.replace(",",".")),n=Number(Number(n).toFixed(e)),isNaN(r)&&r.includes(",")&&(r=r.replace(",",".")),r=Number(Number(r).toFixed(e)),Object.freeze({verbatimCoordinates:l,verbatimLatitude:c,verbatimLongitude:p,decimalLatitude:n,decimalLongitude:r,decimalCoordinates:`${n},${r}`,closeEnough:Pc,toCoordinateFormat:Rc})}else throw new Error("coordinates pattern match failed")}function Ro(t){if(!isNaN(t[0]))return!1;const e=[...t];if(e.shift(),e.length%2>0)return!1;const n=/^[-+]?\d+([\.,]\d+)?$/,r=/[eastsouthnorthwest]+/i,i=e.length/2;for(let o=0;o<i;o++){const s=e[o],a=e[o+i],u=n.test(s)&&n.test(a),l=r.test(s)&&r.test(a),c=s==a;if(!(s==null&&a==null)){if(s==null||a==null)return!1;if(u||l||c)continue;return!1}}return!0}function La(t,e){const n=Math.abs(t-e);return Number(n.toFixed(6))<=1e-5}function Pc(t){if(t.includes(",")){const e=t.split(",");if(Number(e[0])==NaN||Number(e[1])==NaN)throw new Error("coords are not valid decimals");return La(this.decimalLatitude,Number(e[0]))&&La(this.decimalLongitude,e[1])}else throw new Error("coords being tested must be separated by a comma")}const Mc=Object.freeze({DMS:"DMS",DM:"DM",DD:"DD"});$s.to=Mc;const Dc=[{verbatimCoordinates:"40.123, -74.123",verbatimLatitude:"40.123",verbatimLongitude:"-74.123"},{verbatimCoordinates:"40.123° N 74.123° W",verbatimLatitude:"40.123° N",verbatimLongitude:"74.123° W"},{verbatimCoordinates:"40.123° N 74.123° W",verbatimLatitude:"40.123° N",verbatimLongitude:"74.123° W"},{verbatimCoordinates:'40° 7´ 22.8" N 74° 7´ 22.8" W',verbatimLatitude:'40° 7´ 22.8" N',verbatimLongitude:'74° 7´ 22.8" W'},{verbatimCoordinates:"40° 7.38’ , -74° 7.38’",verbatimLatitude:"40° 7.38’",verbatimLongitude:"-74° 7.38’"},{verbatimCoordinates:"N40°7’22.8’’, W74°7’22.8’’",verbatimLatitude:"N40°7’22.8’’",verbatimLongitude:"W74°7’22.8’’"},{verbatimCoordinates:'40°7’22.8"N, 74°7’22.8"W',verbatimLatitude:'40°7’22.8"N',verbatimLongitude:'74°7’22.8"W'},{verbatimCoordinates:`40°7'22.8"N, 74°7'22.8"W`,verbatimLatitude:`40°7'22.8"N`,verbatimLongitude:`74°7'22.8"W`},{verbatimCoordinates:"40 7 22.8, -74 7 22.8",verbatimLatitude:"40 7 22.8",verbatimLongitude:"-74 7 22.8"},{verbatimCoordinates:"40.123 -74.123",verbatimLatitude:"40.123",verbatimLongitude:"-74.123"},{verbatimCoordinates:"40.123°,-74.123°",verbatimLatitude:"40.123°",verbatimLongitude:"-74.123°"},{verbatimCoordinates:"40.123N74.123W",verbatimLatitude:"40.123N",verbatimLongitude:"74.123W"},{verbatimCoordinates:"4007.38N7407.38W",verbatimLatitude:"4007.38N",verbatimLongitude:"7407.38W"},{verbatimCoordinates:'40°7’22.8"N, 74°7’22.8"W',verbatimLatitude:'40°7’22.8"N',verbatimLongitude:'74°7’22.8"W'},{verbatimCoordinates:"400722.8N740722.8W",verbatimLatitude:"400722.8N",verbatimLongitude:"740722.8W"},{verbatimCoordinates:"N 40 7.38 W 74 7.38",verbatimLatitude:"N 40 7.38",verbatimLongitude:"W 74 7.38"},{verbatimCoordinates:"40:7:22.8N 74:7:22.8W",verbatimLatitude:"40:7:22.8N",verbatimLongitude:"74:7:22.8W"},{verbatimCoordinates:"40:7:23N,74:7:23W",verbatimLatitude:"40:7:23N",verbatimLongitude:"74:7:23W",decimalLatitude:40.1230555555,decimalLongitude:-74.1230555555},{verbatimCoordinates:'40°7’23"N 74°7’23"W',verbatimLatitude:'40°7’23"N',verbatimLongitude:'74°7’23"W',decimalLatitude:40.1230555555,decimalLongitude:-74.12305555555555},{verbatimCoordinates:'40°7’23"S 74°7’23"E',verbatimLatitude:'40°7’23"S',verbatimLongitude:'74°7’23"E',decimalLatitude:-40.1230555555,decimalLongitude:74.12305555555555},{verbatimCoordinates:'40°7’23" -74°7’23"',verbatimLatitude:'40°7’23"',verbatimLongitude:'-74°7’23"',decimalLatitude:40.1230555555,decimalLongitude:-74.123055555},{verbatimCoordinates:'40d 7’ 23" N 74d 7’ 23" W',verbatimLatitude:'40d 7’ 23" N',verbatimLongitude:'74d 7’ 23" W',decimalLatitude:40.1230555555,decimalLongitude:-74.123055555},{verbatimCoordinates:"40.123N 74.123W",verbatimLatitude:"40.123N",verbatimLongitude:"74.123W"},{verbatimCoordinates:"40° 7.38, -74° 7.38",verbatimLatitude:"40° 7.38",verbatimLongitude:"-74° 7.38"},{verbatimCoordinates:"40° 7.38, -74° 7.38",verbatimLatitude:"40° 7.38",verbatimLongitude:"-74° 7.38"},{verbatimCoordinates:"40 7 22.8; -74 7 22.8",verbatimLatitude:"40 7 22.8",verbatimLongitude:"-74 7 22.8"}],Ac={decimalLatitude:40.123,decimalLongitude:-74.123},Fc=[{verbatimCoordinates:`50°4'17.698"south, 14°24'2.826"east`,verbatimLatitude:`50°4'17.698"south`,verbatimLongitude:`14°24'2.826"east`,decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"50d4m17.698S 14d24m2.826E",verbatimLatitude:"50d4m17.698S",verbatimLongitude:"14d24m2.826E",decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"40:26:46N,79:56:55W",verbatimLatitude:"40:26:46N",verbatimLongitude:"79:56:55W",decimalLatitude:40.44611111111111,decimalLongitude:-79.9486111111111},{verbatimCoordinates:"40:26:46.302N 79:56:55.903W",verbatimLatitude:"40:26:46.302N",verbatimLongitude:"79:56:55.903W",decimalLatitude:40.446195,decimalLongitude:-79.94886194444445},{verbatimCoordinates:"40°26′47″N 79°58′36″W",verbatimLatitude:"40°26′47″N",verbatimLongitude:"79°58′36″W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40d 26′ 47″ N 79d 58′ 36″ W",verbatimLatitude:"40d 26′ 47″ N",verbatimLongitude:"79d 58′ 36″ W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40.446195N 79.948862W",verbatimLatitude:"40.446195N",verbatimLongitude:"79.948862W",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40,446195° 79,948862°",verbatimLatitude:"40,446195°",verbatimLongitude:"79,948862°",decimalLatitude:40.446195,decimalLongitude:79.948862},{verbatimCoordinates:"40° 26.7717, -79° 56.93172",verbatimLatitude:"40° 26.7717",verbatimLongitude:"-79° 56.93172",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.446195, -79.948862",verbatimLatitude:"40.446195",verbatimLongitude:"-79.948862",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.123256; -74.123256",verbatimLatitude:"40.123256",verbatimLongitude:"-74.123256",decimalLatitude:40.123256,decimalLongitude:-74.123256},{verbatimCoordinates:"18°24S 22°45E",verbatimLatitude:"18°24S",verbatimLongitude:"22°45E",decimalLatitude:-18.4,decimalLongitude:22.75}],Gc=[{verbatimCoordinates:"10.432342S 10.6345345E",verbatimLatitude:"10.432342S",verbatimLongitude:"10.6345345E",decimalLatitude:-10.432342,decimalLongitude:10.6345345},{verbatimCoordinates:"10.00S 10.00E",verbatimLatitude:"10.00S",verbatimLongitude:"10.00E",decimalLatitude:-10,decimalLongitude:10},{verbatimCoordinates:"00.00S 01.00E",verbatimLatitude:"00.00S",verbatimLongitude:"01.00E",decimalLatitude:0,decimalLongitude:1},{verbatimCoordinates:"18.24S 22.45E",verbatimLatitude:"18.24S",verbatimLongitude:"22.45E",decimalLatitude:-18.4,decimalLongitude:22.75},{verbatimCoordinates:"27deg 15min 45.2sec S 18deg 32min 53.7sec E",verbatimLatitude:"27deg 15min 45.2sec S",verbatimLongitude:"18deg 32min 53.7sec E",decimalLatitude:-27.262555555555554,decimalLongitude:18.54825},{verbatimCoordinates:"-23.3245° S / 28.2344° E",verbatimLatitude:"-23.3245° S",verbatimLongitude:"28.2344° E",decimalLatitude:-23.3245,decimalLongitude:28.2344},{verbatimCoordinates:"40° 26.7717 -79° 56.93172",verbatimLatitude:"40° 26.7717",verbatimLongitude:"-79° 56.93172",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"27.15.45S 18.32.53E",verbatimLatitude:"27.15.45S",verbatimLongitude:"18.32.53E",decimalLatitude:-27.2625,decimalLongitude:18.548055},{verbatimCoordinates:"-27.15.45 18.32.53",verbatimLatitude:"-27.15.45",verbatimLongitude:"18.32.53",decimalLatitude:-27.2625,decimalLongitude:18.548055},{verbatimCoordinates:"27.15.45.2S 18.32.53.4E",verbatimLatitude:"27.15.45.2S",verbatimLongitude:"18.32.53.4E",decimalLatitude:-27.262556,decimalLongitude:18.548167},{verbatimCoordinates:"27.15.45,2S 18.32.53,4E",verbatimLatitude:"27.15.45,2S",verbatimLongitude:"18.32.53,4E",decimalLatitude:-27.262556,decimalLongitude:18.548167},{verbatimCoordinates:"S23.43563 ° E22.45634 °",verbatimLatitude:"S23.43563 °",verbatimLongitude:"E22.45634 °",decimalLatitude:-23.43563,decimalLongitude:22.45634},{verbatimCoordinates:"27,71372° S 23,07771° E",verbatimLatitude:"27,71372° S",verbatimLongitude:"23,07771° E",decimalLatitude:-27.71372,decimalLongitude:23.07771},{verbatimCoordinates:"27.45.34 S 23.23.23 E",verbatimLatitude:"27.45.34 S",verbatimLongitude:"23.23.23 E",decimalLatitude:-27.759444,decimalLongitude:23.38972222},{verbatimCoordinates:"S 27.45.34 E 23.23.23",verbatimLatitude:"S 27.45.34",verbatimLongitude:"E 23.23.23",decimalLatitude:-27.759444,decimalLongitude:23.38972222}];function kc(){const t=[];return Dc.forEach(e=>{e.decimalLatitude?t.push(e):t.push({...e,...Ac})}),[...t,...Fc,...Gc]}const qc=kc();$s.formats=qc.map(t=>t.verbatimCoordinates);const Bc=$s;function Sa(t,e,n){const r=t.slice();return r[81]=e[n],r[83]=n,r}function wa(t){let e,n;return e=new Ec({}),{c(){Or(e.$$.fragment)},m(r,i){cr(e,r,i),n=!0},i(r){n||(Gt(e.$$.fragment,r),n=!0)},o(r){ee(e.$$.fragment,r),n=!1},d(r){pr(e,r)}}}function Ta(t){let e,n,r,i,o;return n=new Cc({}),{c(){e=ht("button"),Or(n.$$.fragment),L(e,"type","button"),L(e,"title",t[9]),L(e,"class","svelte-zh3kmv"),un(e,"active",t[0])},m(s,a){Rt(s,e,a),cr(n,e,null),r=!0,i||(o=be(e,"click",t[67]),i=!0)},p(s,a){(!r||a[0]&512)&&L(e,"title",s[9]),(!r||a[0]&1)&&un(e,"active",s[0])},i(s){r||(Gt(n.$$.fragment,s),r=!0)},o(s){ee(n.$$.fragment,s),r=!1},d(s){s&&Ct(e),pr(n),i=!1,o()}}}function zc(t){let e,n=[],r=new Map,i,o,s,a=_a(t[14]);const u=l=>l[81].id+(l[81].address?","+l[81].address:"");for(let l=0;l<a.length;l+=1){let c=Sa(t,a,l),p=u(c);r.set(p,n[l]=Ra(p,c))}return{c(){e=ht("ul");for(let l=0;l<n.length;l+=1)n[l].c();L(e,"class","svelte-zh3kmv")},m(l,c){Rt(l,e,c);for(let p=0;p<n.length;p+=1)n[p]&&n[p].m(e,null);i=!0,o||(s=[be(e,"mouseleave",t[71]),be(e,"blur",t[72])],o=!0)},p(l,c){c[0]&17880064&&(a=_a(l[14]),Go(),n=rc(n,c,u,1,l,a,r,e,nc,Ra,null,Sa),ko())},i(l){if(!i){for(let c=0;c<a.length;c+=1)Gt(n[c]);i=!0}},o(l){for(let c=0;c<n.length;c+=1)ee(n[c]);i=!1},d(l){l&&Ct(e);for(let c=0;c<n.length;c+=1)n[c].d();o=!1,xr(s)}}}function Uc(t){let e,n,r,i,o,s;return n=new vu({}),{c(){e=ht("div"),Or(n.$$.fragment),r=Ve(),i=ht("div"),o=Rr(t[7]),L(i,"class","svelte-zh3kmv"),L(e,"class","no-results svelte-zh3kmv")},m(a,u){Rt(a,e,u),cr(n,e,null),nt(e,r),nt(e,i),nt(i,o),s=!0},p(a,u){(!s||u[0]&128)&&Qi(o,a[7])},i(a){s||(Gt(n.$$.fragment,a),s=!0)},o(a){ee(n.$$.fragment,a),s=!1},d(a){a&&Ct(e),pr(n)}}}function Vc(t){let e="",n;return{c(){n=Rr(e)},m(r,i){Rt(r,n,i)},p:Nt,i:Nt,o:Nt,d(r){r&&Ct(n)}}}function $c(t){let e,n,r,i,o,s,a,u,l,c,p;return n=new vu({}),u=new _u({}),{c(){e=ht("div"),Or(n.$$.fragment),r=Ve(),i=ht("div"),o=Rr(t[6]),s=Ve(),a=ht("button"),Or(u.$$.fragment),L(i,"class","svelte-zh3kmv"),L(a,"class","svelte-zh3kmv"),L(e,"class","error svelte-zh3kmv")},m(h,g){Rt(h,e,g),cr(n,e,null),nt(e,r),nt(e,i),nt(i,o),nt(e,s),nt(e,a),cr(u,a,null),l=!0,c||(p=be(a,"click",t[68]),c=!0)},p(h,g){(!l||g[0]&64)&&Qi(o,h[6])},i(h){l||(Gt(n.$$.fragment,h),Gt(u.$$.fragment,h),l=!0)},o(h){ee(n.$$.fragment,h),ee(u.$$.fragment,h),l=!1},d(h){h&&Ct(e),pr(n),pr(u),c=!1,p()}}}function Ra(t,e){let n,r,i;function o(){return e[69](e[83])}function s(){return e[70](e[81])}return r=new _c({props:{feature:e[81],showPlaceType:e[10],selected:e[15]===e[83],missingIconsCache:e[20],iconsBaseUrl:e[12]}}),r.$on("mouseenter",o),r.$on("focus",s),{key:t,first:null,c(){n=jl(),Or(r.$$.fragment),this.first=n},m(a,u){Rt(a,n,u),cr(r,a,u),i=!0},p(a,u){e=a;const l={};u[0]&16384&&(l.feature=e[81]),u[0]&1024&&(l.showPlaceType=e[10]),u[0]&49152&&(l.selected=e[15]===e[83]),u[0]&4096&&(l.iconsBaseUrl=e[12]),r.$set(l)},i(a){i||(Gt(r.$$.fragment,a),i=!0)},o(a){ee(r.$$.fragment,a),i=!1},d(a){a&&Ct(n),pr(r,a)}}}function Xc(t){let e,n,r,i,o,s,a,u,l,c,p,h,g,f,m,y,v,x,I,C,P,D=!1;o=new Sc({}),p=new _u({});let S=t[19]&&wa(),T=t[5]===!0&&Ta(t);const w=t[59].default,A=Ul(w,t,t[58],null),X=[$c,Vc,Uc,zc],k=[];function pt(N,q){var H,Et;return N[18]?0:N[16]?((H=N[14])==null?void 0:H.length)===0?2:N[16]&&(Et=N[14])!=null&&Et.length?3:-1:1}return~(y=pt(t))&&(v=k[y]=X[y](t)),{c(){e=Ve(),n=ht("form"),r=ht("div"),i=ht("button"),Or(o.$$.fragment),s=Ve(),a=ht("input"),u=Ve(),l=ht("div"),c=ht("button"),Or(p.$$.fragment),h=Ve(),S&&S.c(),g=Ve(),T&&T.c(),f=Ve(),A&&A.c(),m=Ve(),v&&v.c(),L(i,"class","search-button svelte-zh3kmv"),L(i,"type","button"),L(a,"placeholder",t[8]),L(a,"aria-label",t[8]),L(a,"class","svelte-zh3kmv"),L(c,"type","button"),L(c,"title",t[3]),L(c,"class","svelte-zh3kmv"),L(l,"class","clear-button-container svelte-zh3kmv"),un(l,"displayable",t[1]!==""),L(r,"class","input-group svelte-zh3kmv"),L(n,"tabindex","0"),L(n,"class",x=ga(t[2])+" svelte-zh3kmv"),un(n,"can-collapse",t[4]&&t[1]==="")},m(N,q){Rt(N,e,q),Rt(N,n,q),nt(n,r),nt(r,i),cr(o,i,null),nt(r,s),nt(r,a),t[61](a),da(a,t[1]),nt(r,u),nt(r,l),nt(l,c),cr(p,c,null),nt(l,h),S&&S.m(l,null),nt(r,g),T&&T.m(r,null),nt(r,f),A&&A.m(r,null),nt(n,m),~y&&k[y].m(n,null),I=!0,C||(P=[be(i,"click",t[60]),be(a,"input",t[62]),be(a,"focus",t[63]),be(a,"blur",t[64]),be(a,"keydown",t[22]),be(a,"input",t[65]),be(c,"click",t[66]),be(n,"submit",Yl(t[21]))],C=!0)},p(N,q){(!I||q[0]&256)&&L(a,"placeholder",N[8]),(!I||q[0]&256)&&L(a,"aria-label",N[8]),q[0]&2&&a.value!==N[1]&&da(a,N[1]),(!I||q[0]&8)&&L(c,"title",N[3]),N[19]?S?q[0]&524288&&Gt(S,1):(S=wa(),S.c(),Gt(S,1),S.m(l,null)):S&&(Go(),ee(S,1,1,()=>{S=null}),ko()),(!I||q[0]&2)&&un(l,"displayable",N[1]!==""),N[5]===!0?T?(T.p(N,q),q[0]&32&&Gt(T,1)):(T=Ta(N),T.c(),Gt(T,1),T.m(r,f)):T&&(Go(),ee(T,1,1,()=>{T=null}),ko()),A&&A.p&&(!I||q[1]&134217728)&&$l(A,w,N,N[58],I?Vl(w,N[58],q,null):Xl(N[58]),null);let H=y;y=pt(N),y===H?~y&&k[y].p(N,q):(v&&(Go(),ee(k[H],1,1,()=>{k[H]=null}),ko()),~y?(v=k[y],v?v.p(N,q):(v=k[y]=X[y](N),v.c()),Gt(v,1),v.m(n,null)):v=null),(!I||q[0]&4&&x!==(x=ga(N[2])+" svelte-zh3kmv"))&&L(n,"class",x),(!I||q[0]&22)&&un(n,"can-collapse",N[4]&&N[1]==="")},i(N){I||(Gt(D),Gt(o.$$.fragment,N),Gt(p.$$.fragment,N),Gt(S),Gt(T),Gt(A,N),Gt(v),I=!0)},o(N){ee(D),ee(o.$$.fragment,N),ee(p.$$.fragment,N),ee(S),ee(T),ee(A,N),ee(v),I=!1},d(N){N&&(Ct(e),Ct(n)),pr(o),t[61](null),pr(p),S&&S.d(),T&&T.d(),A&&A.d(N),~y&&k[y].d(),C=!1,xr(P)}}}function jc(t,e,n){let r,{$$slots:i={},$$scope:o}=e,{class:s=void 0}=e,{apiKey:a}=e,{bbox:u=void 0}=e,{clearButtonTitle:l="clear"}=e,{clearOnBlur:c=!1}=e,{collapsed:p=!1}=e,{country:h=void 0}=e,{debounceSearch:g=200}=e,{enableReverse:f=!1}=e,{errorMessage:m="Something went wrong…"}=e,{filter:y=()=>!0}=e,{flyTo:v=!0}=e,{fuzzyMatch:x=!0}=e,{language:I=void 0}=e,{limit:C=void 0}=e,{mapController:P=void 0}=e,{minLength:D=2}=e,{noResultsMessage:S="Oops! Looks like you're trying to predict something that's not quite right. We can't seem to find what you're looking for. Maybe try double-checking your spelling or try a different search term. Keep on typing - we'll do our best to get you where you need to go!"}=e,{placeholder:T="Search"}=e,{proximity:w=[{type:"server-geolocation"}]}=e,{reverseActive:A=f==="always"}=e,{reverseButtonTitle:X="toggle reverse geocoding"}=e,{searchValue:k=""}=e,{showFullGeometry:pt=!0}=e,{showPlaceType:N="ifNeeded"}=e,{showResultsWhileTyping:q=!0}=e,{selectFirst:H=!0}=e,{flyToSelected:Et=!1}=e,{markerOnSelected:Wt=!0}=e,{types:Ht=void 0}=e,{excludeTypes:Bn=!1}=e,{zoom:Ie=16}=e,{maxZoom:Me=18}=e,{apiUrl:Ue="https://api.maptiler.com/geocoding"}=e,{fetchParameters:Ir={}}=e,{iconsBaseUrl:or="https://cdn.maptiler.com/maptiler-geocoding-control/v1.2.2/icons/"}=e,{adjustUrlQuery:fs=b=>{}}=e;function ml(){zn.focus()}function yl(){zn.blur()}function ua(b,mt=!0){n(1,k=b),mt?(n(15,St=-1),ca()):(ys(),setTimeout(()=>{zn.focus(),zn.select()}))}function _l(){n(14,lt=void 0),n(55,et=void 0),n(15,St=-1)}function vl(){n(54,Zt=[]),n(55,et=void 0)}let hi=!1,lt,Zt,et,la="",zn,St=-1,Un,bo=[],fi,gi,Co,gs;const El=new Set,Nr=Kl();Zl(()=>{P&&(P.setEventHandler(void 0),P.indicateReverse(!1),P.setSelectedMarker(-1),P.setMarkers(void 0,void 0))});function ca(b){if(gi&&(clearTimeout(gi),gi=void 0),St>-1&<)n(55,et=lt[St]),n(1,k=et.place_type[0]==="reverse"?et.place_name:et.place_name.replace(/,.*/,"")),n(18,Un=void 0),n(54,Zt=void 0),n(15,St=-1);else if(k){const mt=b||!ds(k);ms(k,{exact:!0}).then(()=>{n(54,Zt=lt),n(55,et=void 0),mt&&xl()}).catch(sr=>n(18,Un=sr))}}function ds(b){try{return Bc(b,6)}catch{return!1}}async function ms(b,{byId:mt=!1,exact:sr=!1}={}){n(18,Un=void 0),fi==null||fi.abort();const Vn=new AbortController;n(19,fi=Vn);try{const it=ds(b),en=new URLSearchParams;if(I!==void 0&&en.set("language",Array.isArray(I)?I.join(","):I??""),Ht&&en.set("types",Ht.join(",")),Bn&&en.set("excludeTypes",String(Bn)),u&&en.set("bbox",u.map(So=>So.toFixed(6)).join(",")),h&&en.set("country",Array.isArray(h)?h.join(","):h),!mt&&!it){const So=await Tc(P,w,Vn);So&&en.set("proximity",So),(sr||!q)&&en.set("autocomplete","false"),en.set("fuzzyMatch",String(x))}C!==void 0&&(!it||(Ht==null?void 0:Ht.length)===1)&&en.set("limit",String(C)),en.set("key",a),fs(en);const Lo=Ue+"/"+encodeURIComponent(it?it.decimalLongitude+","+it.decimalLatitude:b)+".json?"+en.toString();if(Lo===la){mt?(n(14,lt=void 0),n(55,et=bo[0])):n(14,lt=bo);return}la=Lo;const vs=await fetch(Lo,{signal:Vn.signal,...Ir});if(!vs.ok)throw new Error(await vs.text());const Es=await vs.json();Nr("response",{url:Lo,featureCollection:Es}),mt?(n(14,lt=void 0),n(55,et=Es.features[0]),bo=[et]):(n(14,lt=Es.features.filter(y)),it&<.unshift({type:"Feature",properties:{},id:"reverse_"+it.decimalLongitude+"_"+it.decimalLatitude,text:it.decimalLatitude+", "+it.decimalLongitude,place_name:it.decimalLatitude+", "+it.decimalLongitude,place_type:["reverse"],center:[it.decimalLongitude,it.decimalLatitude],bbox:[it.decimalLongitude,it.decimalLatitude,it.decimalLongitude,it.decimalLatitude],geometry:{type:"Point",coordinates:[it.decimalLongitude,it.decimalLatitude]}}),bo=lt,it&&zn.focus())}catch(it){if(it&&typeof it=="object"&&"name"in it&&it.name==="AbortError")return;throw it}finally{Vn===fi&&n(19,fi=void 0)}}function xl(){var b;if(!(Zt!=null&&Zt.length)||!v)return;const mt=[180,90,-180,-90],sr=!Zt.some(Vn=>!Vn.matching_text);for(const Vn of Zt)if(sr||!Vn.matching_text)for(const it of[0,1,2,3])mt[it]=Math[it<2?"min":"max"](mt[it],((b=Vn.bbox)==null?void 0:b[it])??Vn.center[it%2]);P&&Zt.length>0&&(et&&mt[0]===mt[2]&&mt[1]===mt[3]?P.flyTo(et.center,Ie):P.fitBounds(Ea(mt),50,Me))}function Il(b){n(0,A=f==="always"),n(14,lt=void 0),n(55,et=void 0),n(15,St=-1),ua(b[1].toFixed(6)+", "+wc(b[0],[-180,180],!0).toFixed(6),!1)}function Nl(b){if(!lt)return;let mt=b.key==="ArrowDown"?1:b.key==="ArrowUp"?-1:0;mt&&(St===(H?0:-1)&&mt===-1&&n(15,St=lt.length),n(15,St+=mt),St>=lt.length&&n(15,St=-1),St<0&&H&&n(15,St=0),b.preventDefault())}function ys(b=!0){if(n(18,Un=void 0),q){if(gi&&clearTimeout(gi),k.length<D)return;const mt=k;gi=window.setTimeout(()=>{ms(mt).catch(sr=>n(18,Un=sr))},b?g:0)}else n(14,lt=void 0),n(18,Un=void 0)}function _s(b){n(55,et=b),n(1,k=b.place_name),n(15,St=-1)}const bl=()=>zn.focus();function Cl(b){Ss[b?"unshift":"push"](()=>{zn=b,n(17,zn)})}function Ll(){k=this.value,n(1,k),n(13,hi),n(27,c)}const Sl=()=>n(13,hi=!0),wl=()=>n(13,hi=!1),Tl=()=>ys(),Rl=()=>{n(1,k=""),zn.focus()},Ol=()=>n(0,A=!A),Pl=()=>n(18,Un=void 0),Ml=b=>n(15,St=b),Dl=b=>_s(b),Al=()=>{H||n(15,St=-1)},Fl=()=>{};return t.$$set=b=>{"class"in b&&n(2,s=b.class),"apiKey"in b&&n(25,a=b.apiKey),"bbox"in b&&n(26,u=b.bbox),"clearButtonTitle"in b&&n(3,l=b.clearButtonTitle),"clearOnBlur"in b&&n(27,c=b.clearOnBlur),"collapsed"in b&&n(4,p=b.collapsed),"country"in b&&n(28,h=b.country),"debounceSearch"in b&&n(29,g=b.debounceSearch),"enableReverse"in b&&n(5,f=b.enableReverse),"errorMessage"in b&&n(6,m=b.errorMessage),"filter"in b&&n(30,y=b.filter),"flyTo"in b&&n(31,v=b.flyTo),"fuzzyMatch"in b&&n(32,x=b.fuzzyMatch),"language"in b&&n(33,I=b.language),"limit"in b&&n(34,C=b.limit),"mapController"in b&&n(35,P=b.mapController),"minLength"in b&&n(36,D=b.minLength),"noResultsMessage"in b&&n(7,S=b.noResultsMessage),"placeholder"in b&&n(8,T=b.placeholder),"proximity"in b&&n(37,w=b.proximity),"reverseActive"in b&&n(0,A=b.reverseActive),"reverseButtonTitle"in b&&n(9,X=b.reverseButtonTitle),"searchValue"in b&&n(1,k=b.searchValue),"showFullGeometry"in b&&n(38,pt=b.showFullGeometry),"showPlaceType"in b&&n(10,N=b.showPlaceType),"showResultsWhileTyping"in b&&n(39,q=b.showResultsWhileTyping),"selectFirst"in b&&n(11,H=b.selectFirst),"flyToSelected"in b&&n(40,Et=b.flyToSelected),"markerOnSelected"in b&&n(41,Wt=b.markerOnSelected),"types"in b&&n(42,Ht=b.types),"excludeTypes"in b&&n(43,Bn=b.excludeTypes),"zoom"in b&&n(44,Ie=b.zoom),"maxZoom"in b&&n(45,Me=b.maxZoom),"apiUrl"in b&&n(46,Ue=b.apiUrl),"fetchParameters"in b&&n(47,Ir=b.fetchParameters),"iconsBaseUrl"in b&&n(12,or=b.iconsBaseUrl),"adjustUrlQuery"in b&&n(48,fs=b.adjustUrlQuery),"$$scope"in b&&n(58,o=b.$$scope)},t.$$.update=()=>{if(t.$$.dirty[0]&134225920&&setTimeout(()=>{n(16,Co=hi),c&&!hi&&n(1,k="")}),t.$$.dirty[0]&16386|t.$$.dirty[1]&32&&k.length<D&&(n(55,et=void 0),n(14,lt=void 0),n(18,Un=void 0),n(54,Zt=lt)),t.$$.dirty[1]&16777344&&pt&&et&&!et.address&&et.geometry.type==="Point"&&et.place_type[0]!=="reverse"&&ms(et.id,{byId:!0}).catch(b=>n(18,Un=b)),t.$$.dirty[1]&50356241&&(P&&et&&et.id!==gs&&v&&(!et.bbox||et.bbox[0]===et.bbox[2]&&et.bbox[1]===et.bbox[3]?P.flyTo(et.center,et.id.startsWith("poi.")||et.id.startsWith("address.")?Me:Ie):P.fitBounds(Ea(et.bbox),50,Me),n(14,lt=void 0),n(54,Zt=void 0),n(15,St=-1)),n(56,gs=et==null?void 0:et.id)),t.$$.dirty[0]&18432&&H&<!=null&<.length&&n(15,St=0),t.$$.dirty[0]&2050&&(H||n(15,St=-1)),t.$$.dirty[0]&16384|t.$$.dirty[1]&8388608&&Zt!==lt&&n(54,Zt=void 0),t.$$.dirty[0]&81921|t.$$.dirty[1]&8388624&&P&&P.setEventHandler(b=>{switch(b.type){case"mapClick":A&&Il(b.coordinates);break;case"markerClick":{const mt=lt==null?void 0:lt.find(sr=>sr.id===b.id);mt&&_s(mt)}break;case"markerMouseEnter":Zt&&n(15,St=Co?(lt==null?void 0:lt.findIndex(mt=>mt.id===b.id))??-1:-1);break;case"markerMouseLeave":Zt&&n(15,St=-1);break}}),t.$$.dirty[0]&49152&&n(57,r=lt==null?void 0:lt[St]),t.$$.dirty[1]&67133969&&P&&r&&v&&Et&&P.flyTo(r.center,r.id.startsWith("poi.")||r.id.startsWith("address.")?Me:Ie),t.$$.dirty[1]&1040&&(Wt||P==null||P.setMarkers(void 0,void 0)),t.$$.dirty[1]&75498512&&P&&Wt&&!Zt&&(P.setMarkers(r?[r]:void 0,void 0),P.setSelectedMarker(r?0:-1)),t.$$.dirty[1]&25165840&&P&&P.setMarkers(Zt,et),t.$$.dirty[0]&32768|t.$$.dirty[1]&8388624&&Zt&&P&&P.setSelectedMarker(St),t.$$.dirty[0]&2|t.$$.dirty[1]&16&&P){const b=ds(k);P.setReverseMarker(b?[b.decimalLongitude,b.decimalLatitude]:void 0)}t.$$.dirty[1]&67108864&&Nr("select",r),t.$$.dirty[1]&16777216&&Nr("pick",et),t.$$.dirty[0]&81920&&Nr("optionsVisibilityChange",Co&&!!lt),t.$$.dirty[0]&16384&&Nr("featuresListed",lt),t.$$.dirty[1]&8388608&&Nr("featuresMarked",Zt),t.$$.dirty[0]&1&&Nr("reverseToggle",A),t.$$.dirty[0]&2&&Nr("queryChange",k),t.$$.dirty[0]&1|t.$$.dirty[1]&16&&P&&P.indicateReverse(A)},[A,k,s,l,p,f,m,S,T,X,N,H,or,hi,lt,St,Co,zn,Un,fi,El,ca,Nl,ys,_s,a,u,c,h,g,y,v,x,I,C,P,D,w,pt,q,Et,Wt,Ht,Bn,Ie,Me,Ue,Ir,fs,ml,yl,ua,_l,vl,Zt,et,gs,r,o,i,bl,Cl,Ll,Sl,wl,Tl,Rl,Ol,Pl,Ml,Dl,Al,Fl]}let Yc=class extends $r{constructor(t){super(),Vr(this,t,jc,Xc,Ur,{class:2,apiKey:25,bbox:26,clearButtonTitle:3,clearOnBlur:27,collapsed:4,country:28,debounceSearch:29,enableReverse:5,errorMessage:6,filter:30,flyTo:31,fuzzyMatch:32,language:33,limit:34,mapController:35,minLength:36,noResultsMessage:7,placeholder:8,proximity:37,reverseActive:0,reverseButtonTitle:9,searchValue:1,showFullGeometry:38,showPlaceType:10,showResultsWhileTyping:39,selectFirst:11,flyToSelected:40,markerOnSelected:41,types:42,excludeTypes:43,zoom:44,maxZoom:45,apiUrl:46,fetchParameters:47,iconsBaseUrl:12,adjustUrlQuery:48,focus:49,blur:50,setQuery:51,clearList:52,clearMap:53},null,[-1,-1,-1])}get focus(){return this.$$.ctx[49]}get blur(){return this.$$.ctx[50]}get setQuery(){return this.$$.ctx[51]}get clearList(){return this.$$.ctx[52]}get clearMap(){return this.$$.ctx[53]}};/**
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ii=require("./index.cjs19.js");var oi=Object.defineProperty,Er=i=>{throw TypeError(i)},ni=(i,t,e)=>t in i?oi(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,Ue=(i,t,e)=>ni(i,typeof t!="symbol"?t+"":t,e),Lr=(i,t,e)=>t.has(i)||Er("Cannot "+e),st=(i,t,e)=>(Lr(i,t,"read from private field"),e?e.call(i):t.get(i)),Fe=(i,t,e)=>t.has(i)?Er("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,e),be=(i,t,e,r)=>(Lr(i,t,"write to private field"),r?r.call(i,e):t.set(i,e),e);function A(){}function si(i,t){for(const e in t)i[e]=t[e];return i}function wr(i){return i()}function De(){return Object.create(null)}function mt(i){i.forEach(wr)}function Sr(i){return typeof i=="function"}function wt(i,t){return i!=i?t==t:i!==t||i&&typeof i=="object"||typeof i=="function"}let te;function K(i,t){return i===t?!0:(te||(te=document.createElement("a")),te.href=t,i===te.href)}function li(i){return Object.keys(i).length===0}function ai(i,t,e,r){if(i){const o=$r(i,t,e,r);return i[0](o)}}function $r(i,t,e,r){return i[1]&&r?si(e.ctx.slice(),i[1](r(t))):e.ctx}function ui(i,t,e,r){if(i[2]&&r){const o=i[2](r(e));if(t.dirty===void 0)return o;if(typeof o=="object"){const n=[],l=Math.max(t.dirty.length,o.length);for(let s=0;s<l;s+=1)n[s]=t.dirty[s]|o[s];return n}return t.dirty|o}return t.dirty}function ci(i,t,e,r,o,n){if(o){const l=$r(t,e,r,n);i.p(l,o)}}function di(i){if(i.ctx.length>32){const t=[],e=i.ctx.length/32;for(let r=0;r<e;r++)t[r]=-1;return t}return-1}function ze(i){return i??""}function T(i,t){i.appendChild(t)}function D(i,t,e){i.insertBefore(t,e||null)}function B(i){i.parentNode&&i.parentNode.removeChild(i)}function O(i){return document.createElement(i)}function at(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function xt(i){return document.createTextNode(i)}function et(){return xt(" ")}function fi(){return xt("")}function J(i,t,e,r){return i.addEventListener(t,e,r),()=>i.removeEventListener(t,e,r)}function hi(i){return function(t){return t.preventDefault(),i.call(this,t)}}function y(i,t,e){e==null?i.removeAttribute(t):i.getAttribute(t)!==e&&i.setAttribute(t,e)}function pi(i){return Array.from(i.childNodes)}function zt(i,t){t=""+t,i.data!==t&&(i.data=t)}function Ge(i,t){i.value=t??""}function nt(i,t,e){i.classList.toggle(t,!!e)}function mi(i,t,{bubbles:e=!1,cancelable:r=!1}={}){return new CustomEvent(i,{detail:t,bubbles:e,cancelable:r})}let Gt;function Dt(i){Gt=i}function kr(){if(!Gt)throw new Error("Function called outside component initialization");return Gt}function gi(i){kr().$$.on_destroy.push(i)}function yi(){const i=kr();return(t,e,{cancelable:r=!1}={})=>{const o=i.$$.callbacks[t];if(o){const n=mi(t,e,{cancelable:r});return o.slice().forEach(l=>{l.call(i,n)}),!n.defaultPrevented}return!0}}function je(i,t){const e=i.$$.callbacks[t.type];e&&e.slice().forEach(r=>r.call(this,t))}const It=[],we=[];let Ot=[];const He=[],vi=Promise.resolve();let Se=!1;function bi(){Se||(Se=!0,vi.then(_r))}function $e(i){Ot.push(i)}const xe=new Set;let Pt=0;function _r(){if(Pt!==0)return;const i=Gt;do{try{for(;Pt<It.length;){const t=It[Pt];Pt++,Dt(t),xi(t.$$)}}catch(t){throw It.length=0,Pt=0,t}for(Dt(null),It.length=0,Pt=0;we.length;)we.pop()();for(let t=0;t<Ot.length;t+=1){const e=Ot[t];xe.has(e)||(xe.add(e),e())}Ot.length=0}while(It.length);for(;He.length;)He.pop()();Se=!1,xe.clear(),Dt(i)}function xi(i){if(i.fragment!==null){i.update(),mt(i.before_update);const t=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,t),i.after_update.forEach($e)}}function Ei(i){const t=[],e=[];Ot.forEach(r=>i.indexOf(r)===-1?t.push(r):e.push(r)),e.forEach(r=>r()),Ot=t}const ee=new Set;let kt;function re(){kt={r:0,c:[],p:kt}}function ie(){kt.r||mt(kt.c),kt=kt.p}function j(i,t){i&&i.i&&(ee.delete(i),i.i(t))}function Z(i,t,e,r){if(i&&i.o){if(ee.has(i))return;ee.add(i),kt.c.push(()=>{ee.delete(i),r&&(e&&i.d(1),r())}),i.o(t)}else r&&r()}function qe(i){return(i==null?void 0:i.length)!==void 0?i:Array.from(i)}function Li(i,t){Z(i,1,1,()=>{t.delete(i.key)})}function wi(i,t,e,r,o,n,l,s,c,a,d,u){let f=i.length,h=n.length,v=f;const x={};for(;v--;)x[i[v].key]=v;const g=[],m=new Map,L=new Map,$=[];for(v=h;v--;){const w=u(o,n,v),b=e(w);let N=l.get(b);N?$.push(()=>N.p(w,t)):(N=a(b,w),N.c()),m.set(b,g[v]=N),b in x&&L.set(b,Math.abs(v-x[b]))}const E=new Set,_=new Set;function S(w){j(w,1),w.m(s,d),l.set(w.key,w),d=w.first,h--}for(;f&&h;){const w=g[h-1],b=i[f-1],N=w.key,P=b.key;w===b?(d=w.first,f--,h--):m.has(P)?!l.has(N)||E.has(N)?S(w):_.has(P)?f--:L.get(N)>L.get(P)?(_.add(N),S(w)):(E.add(P),f--):(c(b,l),f--)}for(;f--;){const w=i[f];m.has(w.key)||c(w,l)}for(;h;)S(g[h-1]);return mt($),g}function Et(i){i&&i.c()}function ht(i,t,e){const{fragment:r,after_update:o}=i.$$;r&&r.m(t,e),$e(()=>{const n=i.$$.on_mount.map(wr).filter(Sr);i.$$.on_destroy?i.$$.on_destroy.push(...n):mt(n),i.$$.on_mount=[]}),o.forEach($e)}function pt(i,t){const e=i.$$;e.fragment!==null&&(Ei(e.after_update),mt(e.on_destroy),e.fragment&&e.fragment.d(t),e.on_destroy=e.fragment=null,e.ctx=[])}function Si(i,t){i.$$.dirty[0]===-1&&(It.push(i),bi(),i.$$.dirty.fill(0)),i.$$.dirty[t/31|0]|=1<<t%31}function St(i,t,e,r,o,n,l=null,s=[-1]){const c=Gt;Dt(i);const a=i.$$={fragment:null,ctx:[],props:n,update:A,not_equal:o,bound:De(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(c?c.$$.context:[])),callbacks:De(),dirty:s,skip_bound:!1,root:t.target||c.$$.root};l&&l(a.root);let d=!1;if(a.ctx=e?e(i,t.props||{},(u,f,...h)=>{const v=h.length?h[0]:f;return a.ctx&&o(a.ctx[u],a.ctx[u]=v)&&(!a.skip_bound&&a.bound[u]&&a.bound[u](v),d&&Si(i,u)),f}):[],a.update(),d=!0,mt(a.before_update),a.fragment=r?r(a.ctx):!1,t.target){if(t.hydrate){const u=pi(t.target);a.fragment&&a.fragment.l(u),u.forEach(B)}else a.fragment&&a.fragment.c();t.intro&&j(i.$$.fragment),ht(i,t.target,t.anchor),_r()}Dt(c)}class $t{constructor(){Ue(this,"$$"),Ue(this,"$$set")}$destroy(){pt(this,1),this.$destroy=A}$on(t,e){if(!Sr(e))return A;const r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(e),()=>{const o=r.indexOf(e);o!==-1&&r.splice(o,1)}}$set(t){this.$$set&&!li(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const $i="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add($i);function ki(i){let t,e;return{c(){t=at("svg"),e=at("path"),y(e,"d","M13.12.706a.982.982 0 0 0-1.391 0L6.907 5.517 2.087.696a.982.982 0 1 0-1.391 1.39l4.821 4.821L.696 11.73a.982.982 0 1 0 1.39 1.39l4.821-4.821 4.822 4.821a.982.982 0 1 0 1.39-1.39L8.298 6.908l4.821-4.822a.988.988 0 0 0 0-1.38Z"),y(t,"viewBox","0 0 14 14"),y(t,"width","13"),y(t,"height","13"),y(t,"class","svelte-en2qvf")},m(r,o){D(r,t,o),T(t,e)},p:A,i:A,o:A,d(r){r&&B(t)}}}class Nr extends $t{constructor(t){super(),St(this,t,null,ki,wt,{})}}function _i(i){let t,e;return{c(){t=at("svg"),e=at("path"),y(e,"d","M15 0C6.705 0 0 6.705 0 15C0 23.295 6.705 30 15 30C23.295 30 30 23.295 30 15C30 6.705 23.295 0 15 0ZM22.5 20.385L20.385 22.5L15 17.115L9.615 22.5L7.5 20.385L12.885 15L7.5 9.615L9.615 7.5L15 12.885L20.385 7.5L22.5 9.615L17.115 15L22.5 20.385Z"),y(t,"viewBox","0 0 30 30"),y(t,"fill","none"),y(t,"xmlns","http://www.w3.org/2000/svg"),y(t,"class","svelte-d2loi5")},m(r,o){D(r,t,o),T(t,e)},p:A,i:A,o:A,d(r){r&&B(t)}}}class Mr extends $t{constructor(t){super(),St(this,t,null,_i,wt,{})}}function Ni(i){let t,e;return{c(){t=O("img"),K(t.src,e=i[3]+"area.svg")||y(t,"src",e),y(t,"alt",i[6]),y(t,"class","svelte-ltkwvy")},m(r,o){D(r,t,o)},p(r,o){o&8&&!K(t.src,e=r[3]+"area.svg")&&y(t,"src",e),o&64&&y(t,"alt",r[6])},d(r){r&&B(t)}}}function Mi(i){let t,e;return{c(){t=O("img"),K(t.src,e=i[3]+"reverse.svg")||y(t,"src",e),y(t,"alt",i[6]),y(t,"class","svelte-ltkwvy")},m(r,o){D(r,t,o)},p(r,o){o&8&&!K(t.src,e=r[3]+"reverse.svg")&&y(t,"src",e),o&64&&y(t,"alt",r[6])},d(r){r&&B(t)}}}function Ci(i){let t,e;return{c(){t=O("img"),K(t.src,e=i[3]+"poi.svg")||y(t,"src",e),y(t,"alt",i[6]),y(t,"class","svelte-ltkwvy")},m(r,o){D(r,t,o)},p(r,o){o&8&&!K(t.src,e=r[3]+"poi.svg")&&y(t,"src",e),o&64&&y(t,"alt",r[6])},d(r){r&&B(t)}}}function Ti(i){let t,e;return{c(){t=O("img"),K(t.src,e=i[3]+"postal_code.svg")||y(t,"src",e),y(t,"alt",i[6]),y(t,"class","svelte-ltkwvy")},m(r,o){D(r,t,o)},p(r,o){o&8&&!K(t.src,e=r[3]+"postal_code.svg")&&y(t,"src",e),o&64&&y(t,"alt",r[6])},d(r){r&&B(t)}}}function Pi(i){let t,e;return{c(){t=O("img"),K(t.src,e=i[3]+"street.svg")||y(t,"src",e),y(t,"alt",i[6]),y(t,"class","svelte-ltkwvy")},m(r,o){D(r,t,o)},p(r,o){o&8&&!K(t.src,e=r[3]+"street.svg")&&y(t,"src",e),o&64&&y(t,"alt",r[6])},d(r){r&&B(t)}}}function Ri(i){let t,e;return{c(){t=O("img"),K(t.src,e=i[3]+"road.svg")||y(t,"src",e),y(t,"alt",i[6]),y(t,"class","svelte-ltkwvy")},m(r,o){D(r,t,o)},p(r,o){o&8&&!K(t.src,e=r[3]+"road.svg")&&y(t,"src",e),o&64&&y(t,"alt",r[6])},d(r){r&&B(t)}}}function Ii(i){let t,e;return{c(){t=O("img"),K(t.src,e=i[3]+"housenumber.svg")||y(t,"src",e),y(t,"alt",i[6]),y(t,"class","svelte-ltkwvy")},m(r,o){D(r,t,o)},p(r,o){o&8&&!K(t.src,e=r[3]+"housenumber.svg")&&y(t,"src",e),o&64&&y(t,"alt",r[6])},d(r){r&&B(t)}}}function Wi(i){let t,e,r,o;return{c(){t=O("img"),K(t.src,e=i[5])||y(t,"src",e),y(t,"alt",i[4]),y(t,"class","svelte-ltkwvy")},m(n,l){D(n,t,l),r||(o=J(t,"error",i[14]),r=!0)},p(n,l){l&32&&!K(t.src,e=n[5])&&y(t,"src",e),l&16&&y(t,"alt",n[4])},d(n){n&&B(t),r=!1,o()}}}function Ze(i){let t,e;return{c(){t=O("span"),e=xt(i[6]),y(t,"class","secondary svelte-ltkwvy")},m(r,o){D(r,t,o),T(t,e)},p(r,o){o&64&&zt(e,r[6])},d(r){r&&B(t)}}}function Oi(i){let t,e,r,o,n,l,s,c,a,d=(i[7]?i[0].place_name:i[0].place_name.replace(/,.*/,""))+"",u,f,h=i[2]==="always"||i[2]&&!i[0].address&&!i[0].id.startsWith("road.")&&!i[0].id.startsWith("address.")&&!i[0].id.startsWith("postal_code.")&&(!i[0].id.startsWith("poi.")||!i[5])&&!i[7],v,x,g=(i[7]?"":i[0].place_name.replace(/[^,]*,?\s*/,""))+"",m,L,$;function E(b,N){return N&1&&(e=null),N&1&&(r=null),N&1&&(o=null),N&1&&(n=null),b[5]?Wi:b[0].address?Ii:(e==null&&(e=!!b[0].id.startsWith("road.")),e?Ri:(r==null&&(r=!!b[0].id.startsWith("address.")),r?Pi:(o==null&&(o=!!b[0].id.startsWith("postal_code.")),o?Ti:(n==null&&(n=!!b[0].id.startsWith("poi.")),n?Ci:b[7]?Mi:Ni))))}let _=E(i,-1),S=_(i),w=h&&Ze(i);return{c(){t=O("li"),S.c(),l=et(),s=O("span"),c=O("span"),a=O("span"),u=xt(d),f=et(),w&&w.c(),v=et(),x=O("span"),m=xt(g),y(a,"class","primary svelte-ltkwvy"),y(c,"class","svelte-ltkwvy"),y(x,"class","line2 svelte-ltkwvy"),y(s,"class","texts svelte-ltkwvy"),y(t,"tabindex","0"),y(t,"data-selected",i[1]),y(t,"class","svelte-ltkwvy"),nt(t,"selected",i[1])},m(b,N){D(b,t,N),S.m(t,null),T(t,l),T(t,s),T(s,c),T(c,a),T(a,u),T(c,f),w&&w.m(c,null),T(s,v),T(s,x),T(x,m),L||($=[J(t,"mouseenter",i[12]),J(t,"focus",i[13])],L=!0)},p(b,[N]){_===(_=E(b,N))&&S?S.p(b,N):(S.d(1),S=_(b),S&&(S.c(),S.m(t,l))),N&1&&d!==(d=(b[7]?b[0].place_name:b[0].place_name.replace(/,.*/,""))+"")&&zt(u,d),N&37&&(h=b[2]==="always"||b[2]&&!b[0].address&&!b[0].id.startsWith("road.")&&!b[0].id.startsWith("address.")&&!b[0].id.startsWith("postal_code.")&&(!b[0].id.startsWith("poi.")||!b[5])&&!b[7]),h?w?w.p(b,N):(w=Ze(b),w.c(),w.m(c,null)):w&&(w.d(1),w=null),N&1&&g!==(g=(b[7]?"":b[0].place_name.replace(/[^,]*,?\s*/,""))+"")&&zt(m,g),N&2&&y(t,"data-selected",b[1]),N&2&&nt(t,"selected",b[1])},i:A,o:A,d(b){b&&B(t),S.d(),w&&w.d(),L=!1,mt($)}}}function Ai(i,t,e){var r;let o,n,{feature:l}=t,{selected:s=!1}=t,{showPlaceType:c}=t,{missingIconsCache:a}=t,{iconsBaseUrl:d}=t;const u=(r=l.properties)==null?void 0:r.categories;let f,h,v=0,x=l.place_type[0]==="reverse";function g(){h&&a.add(h),e(10,v++,v)}function m(E){je.call(this,i,E)}function L(E){je.call(this,i,E)}const $=()=>g();return i.$$set=E=>{"feature"in E&&e(0,l=E.feature),"selected"in E&&e(1,s=E.selected),"showPlaceType"in E&&e(2,c=E.showPlaceType),"missingIconsCache"in E&&e(9,a=E.missingIconsCache),"iconsBaseUrl"in E&&e(3,d=E.iconsBaseUrl)},i.$$.update=()=>{var E,_,S,w;if(i.$$.dirty&3640)do e(11,o--,o),e(4,f=u==null?void 0:u[o]),e(5,h=f?d+f.replace(/ /g,"_")+".svg":void 0);while(o>-1&&(!h||a.has(h)));i.$$.dirty&1&&e(6,n=((_=(E=l.properties)==null?void 0:E.categories)==null?void 0:_.join(", "))??((w=(S=l.properties)==null?void 0:S.place_type_name)==null?void 0:w[0])??l.place_type[0])},e(11,o=(u==null?void 0:u.length)??0),[l,s,c,d,f,h,n,x,g,a,v,o,m,L,$]}class Bi extends $t{constructor(t){super(),St(this,t,Ai,Oi,wt,{feature:0,selected:1,showPlaceType:2,missingIconsCache:9,iconsBaseUrl:3})}}function Ui(i){let t;return{c(){t=O("div"),t.innerHTML='<svg viewBox="0 0 18 18" width="24" height="24" class="svelte-7cmwmc"><path fill="#333" d="M4.4 4.4l.8.8c2.1-2.1 5.5-2.1 7.6 0l.8-.8c-2.5-2.5-6.7-2.5-9.2 0z"></path><path opacity=".1" d="M12.8 12.9c-2.1 2.1-5.5 2.1-7.6 0-2.1-2.1-2.1-5.5 0-7.7l-.8-.8c-2.5 2.5-2.5 6.7 0 9.2s6.6 2.5 9.2 0 2.5-6.6 0-9.2l-.8.8c2.2 2.1 2.2 5.6 0 7.7z"></path></svg>',y(t,"class","svelte-7cmwmc")},m(e,r){D(e,t,r)},p:A,i:A,o:A,d(e){e&&B(t)}}}class Fi extends $t{constructor(t){super(),St(this,t,null,Ui,wt,{})}}function Di(i){let t,e,r;return{c(){t=at("svg"),e=at("path"),y(e,"stroke-width","4"),y(e,"d","M 5,33.103579 C 5,17.607779 18.457,5 35,5 C 51.543,5 65,17.607779 65,33.103579 C 65,56.388679 40.4668,76.048179 36.6112,79.137779 C 36.3714,79.329879 36.2116,79.457979 36.1427,79.518879 C 35.8203,79.800879 35.4102,79.942779 35,79.942779 C 34.5899,79.942779 34.1797,79.800879 33.8575,79.518879 C 33.7886,79.457979 33.6289,79.330079 33.3893,79.138079 C 29.5346,76.049279 5,56.389379 5,33.103579 Z M 35.0001,49.386379 C 43.1917,49.386379 49.8323,42.646079 49.8323,34.331379 C 49.8323,26.016779 43.1917,19.276479 35.0001,19.276479 C 26.8085,19.276479 20.1679,26.016779 20.1679,34.331379 C 20.1679,42.646079 26.8085,49.386379 35.0001,49.386379 Z"),y(e,"class","svelte-gzo3ar"),y(t,"width",r=i[0]==="list"?20:void 0),y(t,"viewBox","0 0 70 85"),y(t,"fill","none"),y(t,"class","svelte-gzo3ar"),nt(t,"in-map",i[0]!=="list"),nt(t,"list-icon",i[0]==="list")},m(o,n){D(o,t,n),T(t,e)},p(o,[n]){n&1&&r!==(r=o[0]==="list"?20:void 0)&&y(t,"width",r),n&1&&nt(t,"in-map",o[0]!=="list"),n&1&&nt(t,"list-icon",o[0]==="list")},i:A,o:A,d(o){o&&B(t)}}}function zi(i,t,e){let{displayIn:r}=t;return i.$$set=o=>{"displayIn"in o&&e(0,r=o.displayIn)},[r]}class Gi extends $t{constructor(t){super(),St(this,t,zi,Di,wt,{displayIn:0})}}function ji(i){let t,e;return{c(){t=at("svg"),e=at("path"),y(e,"d","M30.003-26.765C13.46-26.765 0-14.158 0 1.337c0 23.286 24.535 42.952 28.39 46.04.24.192.402.316.471.376.323.282.732.424 1.142.424.41 0 .82-.142 1.142-.424.068-.06.231-.183.471-.376 3.856-3.09 28.39-22.754 28.39-46.04 0-15.495-13.46-28.102-30.003-28.102Zm1.757 12.469c4.38 0 7.858 1.052 10.431 3.158 2.595 2.105 3.89 4.913 3.89 8.422 0 2.34-.53 4.362-1.593 6.063-1.063 1.702-3.086 3.616-6.063 5.742-2.042 1.51-3.337 2.659-3.89 3.446-.532.787-.8 1.82-.8 3.096v1.914h-8.449V15.18c0-2.041.434-3.815 1.306-5.325.872-1.51 2.467-3.118 4.785-4.82 2.233-1.594 3.7-2.89 4.402-3.889a5.582 5.582 0 0 0 1.087-3.35c0-1.382-.51-2.435-1.531-3.158-1.02-.723-2.45-1.087-4.28-1.087-3.19 0-6.826 1.047-10.91 3.131l-3.472-6.986c4.742-2.659 9.77-3.992 15.087-3.992Zm-1.88 37.324c1.765 0 3.124.472 4.08 1.408.98.936 1.47 2.276 1.47 4.02 0 1.68-.49 3.007-1.47 3.985-.977.957-2.336 1.435-4.08 1.435-1.787 0-3.171-.465-4.15-1.4-.978-.958-1.47-2.298-1.47-4.02 0-1.787.48-3.14 1.436-4.054.957-.915 2.355-1.374 4.184-1.374Z"),y(t,"viewBox","0 0 60.006 21.412"),y(t,"width","14"),y(t,"height","20"),y(t,"class","svelte-en2qvf")},m(r,o){D(r,t,o),T(t,e)},p:A,i:A,o:A,d(r){r&&B(t)}}}class Hi extends $t{constructor(t){super(),St(this,t,null,ji,wt,{})}}function qi(i){let t,e,r;return{c(){t=at("svg"),e=at("circle"),r=at("path"),y(e,"cx","4.789"),y(e,"cy","4.787"),y(e,"r","3.85"),y(e,"class","svelte-1aq105l"),y(r,"d","M12.063 12.063 7.635 7.635"),y(r,"class","svelte-1aq105l"),y(t,"xmlns","http://www.w3.org/2000/svg"),y(t,"width","13"),y(t,"height","13"),y(t,"viewBox","0 0 13 13"),y(t,"class","svelte-1aq105l")},m(o,n){D(o,t,n),T(t,e),T(t,r)},p:A,i:A,o:A,d(o){o&&B(t)}}}class Zi extends $t{constructor(t){super(),St(this,t,null,qi,wt,{})}}function Qi(i,t,e){const r=t[1],o=t[0],n=r-o;return i===r&&e?i:((i-o)%n+n)%n+o}function ne(i){const t=[...i];return t[2]<t[0]&&(Math.abs((t[0]+t[2]+360)/2)>Math.abs((t[0]-360+t[2])/2)?t[0]-=360:t[2]+=360),t}let Bt;async function Vi(i,t,e){const r=i==null?void 0:i.getCenterAndZoom();for(const o of t??[])if(!(r&&(o.minZoom!=null&&o.minZoom>r[0]||o.maxZoom!=null&&o.maxZoom<r[0]))){if(o.type==="fixed")return o.coordinates.join(",");t:if(o.type==="client-geolocation"){if(Bt&&o.cachedLocationExpiry&&Bt.time+o.cachedLocationExpiry>Date.now()){if(!Bt.coords)break t;return Bt.coords}let n;try{return n=await new Promise((l,s)=>{e.signal.addEventListener("abort",()=>{s(Error("aborted"))}),navigator.geolocation.getCurrentPosition(c=>{l([c.coords.longitude,c.coords.latitude].map(a=>a.toFixed(6)).join(","))},c=>{s(c)},o)}),n}catch{}finally{o.cachedLocationExpiry&&(Bt={time:Date.now(),coords:n})}if(e.signal.aborted)return}if(o.type==="server-geolocation")return"ip";if(r&&o.type==="map-center")return r[1].toFixed(6)+","+r[2].toFixed(6)}}const Ki=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([6-9][0-9])\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([6-9][0-9])\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*(EAST|WEST|[EW])?$/i,Qe=/^([+-]?[0-8]?[0-9])\s+([0-5]?[0-9]\.\d{3,})[\s,]{1,}([+-]?[0-1]?[0-9]?[0-9])\s+([0-5]?[0-9]\.\d{3,})$/,Ve=/^(NORTH|SOUTH|[NS])?[\s]*([+-]?[0-8]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(NORTH|SOUTH|[NS])?[\s]*[,/;]?[\s]*(EAST|WEST|[EW])?[\s]*([+-]?[0-1]?[0-9]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(EAST|WEST|[EW])?$/i,Ke=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(EAST|WEST|[EW])?$/i,Ye=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)\s*(EAST|WEST|[EW])?$/i,Xe=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|’’|´´|["″”\.])?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|´´|’’|["″”\.])?\s*(EAST|WEST|[EW])?$/i;function Yi(i){if(!["DMS","DM","DD"].includes(i))throw new Error("invalid format specified");if(this.decimalCoordinates&&this.decimalCoordinates.trim()){const t=this.decimalCoordinates.split(",").map(h=>Number(h.trim())),e=Number(t[0]),r=Number(t[1]),o=Math.abs(e),n=Math.abs(r),l=e>0?"N":"S",s=r>0?"E":"W";let c;i=="DD"&&(c=`${o}° ${l}, ${n}° ${s}`);const a=Math.floor(o),d=Math.floor(n),u=(o-a)*60,f=(n-d)*60;if(i=="DM"){let h=Je(u,3).toFixed(3).padStart(6,"0"),v=Je(f,3).toFixed(3).padStart(6,"0");h.endsWith(".000")&&v.endsWith(".000")&&(h=h.replace(/\.000$/,""),v=v.replace(/\.000$/,"")),c=`${a}° ${h}' ${l}, ${d}° ${v}' ${s}`}if(i=="DMS"){const h=Math.floor(u),v=Math.floor(f);let x=((u-h)*60).toFixed(1).padStart(4,"0"),g=((f-v)*60).toFixed(1).padStart(4,"0");const m=h.toString().padStart(2,"0"),L=v.toString().padStart(2,"0");x.endsWith(".0")&&g.endsWith(".0")&&(x=x.replace(/\.0$/,""),g=g.replace(/\.0$/,"")),c=`${a}° ${m}' ${x}" ${l}, ${d}° ${L}' ${g}" ${s}`}return c}else throw new Error("no decimal coordinates to convert")}function Je(i,t){const e=Math.pow(10,t);return Math.round((i+Number.EPSILON)*e)/e}function Te(i,t){t||(t=5),i=i.replace(/\s+/g," ").trim();let e=null,r=null,o="",n="",l=null,s=[],c=!1;if(Ki.test(i))throw new Error("invalid coordinate value");if(Qe.test(i))if(s=Qe.exec(i),c=Ut(s),c)e=Math.abs(s[1])+s[2]/60,Number(s[1])<0&&(e*=-1),r=Math.abs(s[3])+s[4]/60,Number(s[3])<0&&(r*=-1),l="DM";else throw new Error("invalid coordinate format");else if(Ve.test(i))if(s=Ve.exec(i),c=Ut(s),c){if(e=s[2],r=s[6],e.includes(",")&&(e=e.replace(",",".")),r.includes(",")&&(r=r.replace(",",".")),l="DD",Number(Math.round(e))==Number(e))throw new Error("integer only coordinate provided");if(Number(Math.round(r))==Number(r))throw new Error("integer only coordinate provided");s[1]?(o=s[1],n=s[5]):s[4]&&(o=s[4],n=s[8])}else throw new Error("invalid decimal coordinate format");else if(Ke.test(i))if(s=Ke.exec(i),c=Ut(s),c)e=Math.abs(parseInt(s[2])),s[4]&&(e+=s[4]/60,l="DM"),s[6]&&(e+=s[6].replace(",",".")/3600,l="DMS"),parseInt(s[2])<0&&(e=-1*e),r=Math.abs(parseInt(s[9])),s[11]&&(r+=s[11]/60),s[13]&&(r+=s[13].replace(",",".")/3600),parseInt(s[9])<0&&(r=-1*r),s[1]?(o=s[1],n=s[8]):s[7]&&(o=s[7],n=s[14]);else throw new Error("invalid DMS coordinates format");else if(Ye.test(i))if(s=Ye.exec(i),c=Ut(s),c)e=Math.abs(parseInt(s[2])),s[4]&&(e+=s[4]/60,l="DM"),s[6]&&(e+=s[6]/3600,l="DMS"),parseInt(s[2])<0&&(e=-1*e),r=Math.abs(parseInt(s[10])),s[12]&&(r+=s[12]/60),s[14]&&(r+=s[14]/3600),parseInt(s[10])<0&&(r=-1*r),s[1]?(o=s[1],n=s[9]):s[8]&&(o=s[8],n=s[16]);else throw new Error("invalid DMS coordinates format");else if(Xe.test(i)){if(s=Xe.exec(i),c=Ut(s),s.filter(a=>a).length<=5)throw new Error("invalid coordinates format");if(c)e=Math.abs(parseInt(s[2])),s[4]&&(e+=s[4].replace(",",".")/60,l="DM"),s[6]&&(e+=s[6].replace(",",".")/3600,l="DMS"),parseInt(s[2])<0&&(e=-1*e),r=Math.abs(parseInt(s[10])),s[12]&&(r+=s[12].replace(",",".")/60),s[14]&&(r+=s[14].replace(",",".")/3600),parseInt(s[10])<0&&(r=-1*r),s[1]?(o=s[1],n=s[9]):s[8]&&(o=s[8],n=s[16]);else throw new Error("invalid coordinates format")}if(c){if(Math.abs(r)>=180)throw new Error("invalid longitude value");if(Math.abs(e)>=90)throw new Error("invalid latitude value");if(o&&!n||!o&&n)throw new Error("invalid coordinates value");if(o&&o==n)throw new Error("invalid coordinates format");e.toString().includes(",")&&(e=e.replace(",",".")),r.toString().includes(",")&&(r=r.replace(",","."));let a=/S|SOUTH/i;a.test(o)&&e>0&&(e=-1*e),a=/W|WEST/i,a.test(n)&&r>0&&(r=-1*r);const d=s[0].trim();let u,f;const h=/[,/;\u0020]/g,v=d.match(h);if(v==null){const m=Math.floor(i.length/2);u=d.substring(0,m).trim(),f=d.substring(m).trim()}else{let m;v.length%2==1?m=Math.floor(v.length/2):m=v.length/2-1;let L=0;if(m==0)L=d.indexOf(v[0]),u=d.substring(0,L).trim(),f=d.substring(L+1).trim();else{let $=0,E=0;for(;$<=m;)L=d.indexOf(v[$],E),E=L+1,$++;u=d.substring(0,L).trim(),f=d.substring(L+1).trim()}}const x=u.split(".");if(x.length==2&&x[1]==0&&x[1].length!=2)throw new Error("invalid coordinates format");const g=f.split(".");if(g.length==2&&g[1]==0&&g[1].length!=2)throw new Error("invalid coordinates format");if(/^\d+$/.test(u)||/^\d+$/.test(f))throw new Error("degree only coordinate/s provided");return e=Number(Number(e).toFixed(t)),r=Number(Number(r).toFixed(t)),Object.freeze({verbatimCoordinates:d,verbatimLatitude:u,verbatimLongitude:f,decimalLatitude:e,decimalLongitude:r,decimalCoordinates:`${e},${r}`,originalFormat:l,closeEnough:Xi,toCoordinateFormat:Yi})}else throw new Error("coordinates pattern match failed")}function Ut(i){if(!isNaN(i[0]))return!1;const t=[...i];if(t.shift(),t.length%2>0)return!1;const e=/^[-+]?\d+([\.,]\d+)?$/,r=/[eastsouthnorthwest]+/i,o=t.length/2;for(let n=0;n<o;n++){const l=t[n],s=t[n+o],c=e.test(l)&&e.test(s),a=r.test(l)&&r.test(s),d=l==s;if(!(l==null&&s==null)){if(l==null||s==null)return!1;if(c||a||d)continue;return!1}}return!0}function tr(i,t){const e=Math.abs(i-t);return Number(e.toFixed(6))<=1e-5}function Xi(i){if(!i)throw new Error("coords must be provided");if(i.includes(",")){const t=i.split(",");if(Number(t[0])==NaN||Number(t[1])==NaN)throw new Error("coords are not valid decimals");return tr(this.decimalLatitude,Number(t[0]))&&tr(this.decimalLongitude,t[1])}else throw new Error("coords being tested must be separated by a comma")}const Ji=Object.freeze({DMS:"DMS",DM:"DM",DD:"DD"});Te.to=Ji;const to=[{verbatimCoordinates:"40.123, -74.123",verbatimLatitude:"40.123",verbatimLongitude:"-74.123"},{verbatimCoordinates:"40.123° N 74.123° W",verbatimLatitude:"40.123° N",verbatimLongitude:"74.123° W"},{verbatimCoordinates:"40.123° N 74.123° W",verbatimLatitude:"40.123° N",verbatimLongitude:"74.123° W"},{verbatimCoordinates:'40° 7´ 22.8" N 74° 7´ 22.8" W',verbatimLatitude:'40° 7´ 22.8" N',verbatimLongitude:'74° 7´ 22.8" W'},{verbatimCoordinates:"40° 7.38’ , -74° 7.38’",verbatimLatitude:"40° 7.38’",verbatimLongitude:"-74° 7.38’"},{verbatimCoordinates:"N40°7’22.8’’, W74°7’22.8’’",verbatimLatitude:"N40°7’22.8’’",verbatimLongitude:"W74°7’22.8’’"},{verbatimCoordinates:'40°7’22.8"N, 74°7’22.8"W',verbatimLatitude:'40°7’22.8"N',verbatimLongitude:'74°7’22.8"W'},{verbatimCoordinates:`40°7'22.8"N, 74°7'22.8"W`,verbatimLatitude:`40°7'22.8"N`,verbatimLongitude:`74°7'22.8"W`},{verbatimCoordinates:"40 7 22.8, -74 7 22.8",verbatimLatitude:"40 7 22.8",verbatimLongitude:"-74 7 22.8"},{verbatimCoordinates:"40.123 -74.123",verbatimLatitude:"40.123",verbatimLongitude:"-74.123"},{verbatimCoordinates:"40.123°,-74.123°",verbatimLatitude:"40.123°",verbatimLongitude:"-74.123°"},{verbatimCoordinates:"40.123N74.123W",verbatimLatitude:"40.123N",verbatimLongitude:"74.123W"},{verbatimCoordinates:"4007.38N7407.38W",verbatimLatitude:"4007.38N",verbatimLongitude:"7407.38W"},{verbatimCoordinates:'40°7’22.8"N, 74°7’22.8"W',verbatimLatitude:'40°7’22.8"N',verbatimLongitude:'74°7’22.8"W'},{verbatimCoordinates:"400722.8N740722.8W",verbatimLatitude:"400722.8N",verbatimLongitude:"740722.8W"},{verbatimCoordinates:"N 40 7.38 W 74 7.38",verbatimLatitude:"N 40 7.38",verbatimLongitude:"W 74 7.38"},{verbatimCoordinates:"40:7:22.8N 74:7:22.8W",verbatimLatitude:"40:7:22.8N",verbatimLongitude:"74:7:22.8W"},{verbatimCoordinates:"40:7:23N,74:7:23W",verbatimLatitude:"40:7:23N",verbatimLongitude:"74:7:23W",decimalLatitude:40.1230555555,decimalLongitude:-74.1230555555},{verbatimCoordinates:'40°7’23"N 74°7’23"W',verbatimLatitude:'40°7’23"N',verbatimLongitude:'74°7’23"W',decimalLatitude:40.1230555555,decimalLongitude:-74.12305555555555},{verbatimCoordinates:'40°7’23"S 74°7’23"E',verbatimLatitude:'40°7’23"S',verbatimLongitude:'74°7’23"E',decimalLatitude:-40.1230555555,decimalLongitude:74.12305555555555},{verbatimCoordinates:'40°7’23" -74°7’23"',verbatimLatitude:'40°7’23"',verbatimLongitude:'-74°7’23"',decimalLatitude:40.1230555555,decimalLongitude:-74.123055555},{verbatimCoordinates:'40d 7’ 23" N 74d 7’ 23" W',verbatimLatitude:'40d 7’ 23" N',verbatimLongitude:'74d 7’ 23" W',decimalLatitude:40.1230555555,decimalLongitude:-74.123055555},{verbatimCoordinates:"40.123N 74.123W",verbatimLatitude:"40.123N",verbatimLongitude:"74.123W"},{verbatimCoordinates:"40° 7.38, -74° 7.38",verbatimLatitude:"40° 7.38",verbatimLongitude:"-74° 7.38"},{verbatimCoordinates:"40° 7.38, -74° 7.38",verbatimLatitude:"40° 7.38",verbatimLongitude:"-74° 7.38"},{verbatimCoordinates:"40 7 22.8; -74 7 22.8",verbatimLatitude:"40 7 22.8",verbatimLongitude:"-74 7 22.8"}],eo={decimalLatitude:40.123,decimalLongitude:-74.123},ro=[{verbatimCoordinates:`50°4'17.698"south, 14°24'2.826"east`,verbatimLatitude:`50°4'17.698"south`,verbatimLongitude:`14°24'2.826"east`,decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"50d4m17.698S 14d24m2.826E",verbatimLatitude:"50d4m17.698S",verbatimLongitude:"14d24m2.826E",decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"40:26:46N,79:56:55W",verbatimLatitude:"40:26:46N",verbatimLongitude:"79:56:55W",decimalLatitude:40.44611111111111,decimalLongitude:-79.9486111111111},{verbatimCoordinates:"40:26:46.302N 79:56:55.903W",verbatimLatitude:"40:26:46.302N",verbatimLongitude:"79:56:55.903W",decimalLatitude:40.446195,decimalLongitude:-79.94886194444445},{verbatimCoordinates:"40°26′47″N 79°58′36″W",verbatimLatitude:"40°26′47″N",verbatimLongitude:"79°58′36″W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40d 26′ 47″ N 79d 58′ 36″ W",verbatimLatitude:"40d 26′ 47″ N",verbatimLongitude:"79d 58′ 36″ W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40.446195N 79.948862W",verbatimLatitude:"40.446195N",verbatimLongitude:"79.948862W",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40,446195° 79,948862°",verbatimLatitude:"40,446195°",verbatimLongitude:"79,948862°",decimalLatitude:40.446195,decimalLongitude:79.948862},{verbatimCoordinates:"40° 26.7717, -79° 56.93172",verbatimLatitude:"40° 26.7717",verbatimLongitude:"-79° 56.93172",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.446195, -79.948862",verbatimLatitude:"40.446195",verbatimLongitude:"-79.948862",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.123256; -74.123256",verbatimLatitude:"40.123256",verbatimLongitude:"-74.123256",decimalLatitude:40.123256,decimalLongitude:-74.123256},{verbatimCoordinates:"18°24S 22°45E",verbatimLatitude:"18°24S",verbatimLongitude:"22°45E",decimalLatitude:-18.4,decimalLongitude:22.75}],io=[{verbatimCoordinates:"10.432342S 10.6345345E",verbatimLatitude:"10.432342S",verbatimLongitude:"10.6345345E",decimalLatitude:-10.432342,decimalLongitude:10.6345345},{verbatimCoordinates:"10.00S 10.00E",verbatimLatitude:"10.00S",verbatimLongitude:"10.00E",decimalLatitude:-10,decimalLongitude:10},{verbatimCoordinates:"00.00S 01.00E",verbatimLatitude:"00.00S",verbatimLongitude:"01.00E",decimalLatitude:0,decimalLongitude:1},{verbatimCoordinates:"18.24S 22.45E",verbatimLatitude:"18.24S",verbatimLongitude:"22.45E",decimalLatitude:-18.4,decimalLongitude:22.75},{verbatimCoordinates:"27deg 15min 45.2sec S 18deg 32min 53.7sec E",verbatimLatitude:"27deg 15min 45.2sec S",verbatimLongitude:"18deg 32min 53.7sec E",decimalLatitude:-27.262555555555554,decimalLongitude:18.54825},{verbatimCoordinates:"-23.3245° S / 28.2344° E",verbatimLatitude:"-23.3245° S",verbatimLongitude:"28.2344° E",decimalLatitude:-23.3245,decimalLongitude:28.2344},{verbatimCoordinates:"40° 26.7717 -79° 56.93172",verbatimLatitude:"40° 26.7717",verbatimLongitude:"-79° 56.93172",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"27.15.45S 18.32.53E",verbatimLatitude:"27.15.45S",verbatimLongitude:"18.32.53E",decimalLatitude:-27.2625,decimalLongitude:18.548055},{verbatimCoordinates:"-27.15.45 18.32.53",verbatimLatitude:"-27.15.45",verbatimLongitude:"18.32.53",decimalLatitude:-27.2625,decimalLongitude:18.548055},{verbatimCoordinates:"27.15.45.2S 18.32.53.4E",verbatimLatitude:"27.15.45.2S",verbatimLongitude:"18.32.53.4E",decimalLatitude:-27.262556,decimalLongitude:18.548167},{verbatimCoordinates:"27.15.45,2S 18.32.53,4E",verbatimLatitude:"27.15.45,2S",verbatimLongitude:"18.32.53,4E",decimalLatitude:-27.262556,decimalLongitude:18.548167},{verbatimCoordinates:"S23.43563 ° E22.45634 °",verbatimLatitude:"S23.43563 °",verbatimLongitude:"E22.45634 °",decimalLatitude:-23.43563,decimalLongitude:22.45634},{verbatimCoordinates:"27,71372° S 23,07771° E",verbatimLatitude:"27,71372° S",verbatimLongitude:"23,07771° E",decimalLatitude:-27.71372,decimalLongitude:23.07771},{verbatimCoordinates:"27.45.34 S 23.23.23 E",verbatimLatitude:"27.45.34 S",verbatimLongitude:"23.23.23 E",decimalLatitude:-27.759444,decimalLongitude:23.38972222},{verbatimCoordinates:"S 27.45.34 E 23.23.23",verbatimLatitude:"S 27.45.34",verbatimLongitude:"E 23.23.23",decimalLatitude:-27.759444,decimalLongitude:23.38972222},{verbatimCoordinates:"53 16.3863,4 52.8171",verbatimLatitude:"53 16.3863",verbatimLongitude:"4 52.8171",decimalLatitude:53.273105,decimalLongitude:4.88029},{verbatimCoordinates:"50 8.2914,-5 2.4447",verbatimLatitude:"50 8.2914",verbatimLongitude:"-5 2.4447",decimalLatitude:50.13819,decimalLongitude:-5.040745},{verbatimCoordinates:"N 48° 30,6410', E 18° 57,4583'",verbatimLatitude:"N 48° 30,6410'",verbatimLongitude:"E 18° 57,4583'",decimalLatitude:48.51068,decimalLongitude:18.95764},{verbatimCoordinates:"1.23456, 18.33453",verbatimLatitude:"1.23456",verbatimLongitude:"18.33453",decimalLatitude:1.23456,decimalLongitude:18.33453}];function oo(){const i=[];return to.forEach(t=>{t.decimalLatitude?i.push(t):i.push({...t,...eo})}),[...i,...ro,...io]}const no=oo();Te.formats=no.map(i=>i.verbatimCoordinates);const so=Te;function er(i,t,e){const r=i.slice();return r[83]=t[e],r[85]=e,r}function rr(i){let t,e;return t=new Fi({}),{c(){Et(t.$$.fragment)},m(r,o){ht(t,r,o),e=!0},i(r){e||(j(t.$$.fragment,r),e=!0)},o(r){Z(t.$$.fragment,r),e=!1},d(r){pt(t,r)}}}function ir(i){let t,e,r,o,n;return e=new Hi({}),{c(){t=O("button"),Et(e.$$.fragment),y(t,"type","button"),y(t,"title",i[9]),y(t,"class","svelte-qnu791"),nt(t,"active",i[0])},m(l,s){D(l,t,s),ht(e,t,null),r=!0,o||(n=J(t,"click",i[68]),o=!0)},p(l,s){(!r||s[0]&512)&&y(t,"title",l[9]),(!r||s[0]&1)&&nt(t,"active",l[0])},i(l){r||(j(e.$$.fragment,l),r=!0)},o(l){Z(e.$$.fragment,l),r=!1},d(l){l&&B(t),pt(e),o=!1,n()}}}function lo(i){let t,e=[],r=new Map,o,n,l,s=qe(i[14]);const c=a=>a[83].id+(a[83].address?","+a[83].address:"");for(let a=0;a<s.length;a+=1){let d=er(i,s,a),u=c(d);r.set(u,e[a]=or(u,d))}return{c(){t=O("ul");for(let a=0;a<e.length;a+=1)e[a].c();y(t,"class","svelte-qnu791")},m(a,d){D(a,t,d);for(let u=0;u<e.length;u+=1)e[u]&&e[u].m(t,null);o=!0,n||(l=[J(t,"mouseleave",i[72]),J(t,"blur",i[73])],n=!0)},p(a,d){d[0]&17880064&&(s=qe(a[14]),re(),e=wi(e,d,c,1,a,s,r,t,Li,or,null,er),ie())},i(a){if(!o){for(let d=0;d<s.length;d+=1)j(e[d]);o=!0}},o(a){for(let d=0;d<e.length;d+=1)Z(e[d]);o=!1},d(a){a&&B(t);for(let d=0;d<e.length;d+=1)e[d].d();n=!1,mt(l)}}}function ao(i){let t,e,r,o,n,l;return e=new Mr({}),{c(){t=O("div"),Et(e.$$.fragment),r=et(),o=O("div"),n=xt(i[7]),y(o,"class","svelte-qnu791"),y(t,"class","no-results svelte-qnu791")},m(s,c){D(s,t,c),ht(e,t,null),T(t,r),T(t,o),T(o,n),l=!0},p(s,c){(!l||c[0]&128)&&zt(n,s[7])},i(s){l||(j(e.$$.fragment,s),l=!0)},o(s){Z(e.$$.fragment,s),l=!1},d(s){s&&B(t),pt(e)}}}function uo(i){let t="",e;return{c(){e=xt(t)},m(r,o){D(r,e,o)},p:A,i:A,o:A,d(r){r&&B(e)}}}function co(i){let t,e,r,o,n,l,s,c,a,d,u;return e=new Mr({}),c=new Nr({}),{c(){t=O("div"),Et(e.$$.fragment),r=et(),o=O("div"),n=xt(i[6]),l=et(),s=O("button"),Et(c.$$.fragment),y(o,"class","svelte-qnu791"),y(s,"class","svelte-qnu791"),y(t,"class","error svelte-qnu791")},m(f,h){D(f,t,h),ht(e,t,null),T(t,r),T(t,o),T(o,n),T(t,l),T(t,s),ht(c,s,null),a=!0,d||(u=J(s,"click",i[69]),d=!0)},p(f,h){(!a||h[0]&64)&&zt(n,f[6])},i(f){a||(j(e.$$.fragment,f),j(c.$$.fragment,f),a=!0)},o(f){Z(e.$$.fragment,f),Z(c.$$.fragment,f),a=!1},d(f){f&&B(t),pt(e),pt(c),d=!1,u()}}}function or(i,t){let e,r,o;function n(){return t[70](t[85])}function l(){return t[71](t[83])}return r=new Bi({props:{feature:t[83],showPlaceType:t[10],selected:t[15]===t[85],missingIconsCache:t[20],iconsBaseUrl:t[12]}}),r.$on("mouseenter",n),r.$on("focus",l),{key:i,first:null,c(){e=fi(),Et(r.$$.fragment),this.first=e},m(s,c){D(s,e,c),ht(r,s,c),o=!0},p(s,c){t=s;const a={};c[0]&16384&&(a.feature=t[83]),c[0]&1024&&(a.showPlaceType=t[10]),c[0]&49152&&(a.selected=t[15]===t[85]),c[0]&4096&&(a.iconsBaseUrl=t[12]),r.$set(a)},i(s){o||(j(r.$$.fragment,s),o=!0)},o(s){Z(r.$$.fragment,s),o=!1},d(s){s&&B(e),pt(r,s)}}}function fo(i){let t,e,r,o,n,l,s,c,a,d,u,f,h,v,x,g,m,L,$,E,_,S=!1;n=new Zi({}),u=new Nr({});let w=i[19]&&rr(),b=i[5]===!0&&ir(i);const N=i[60].default,P=ai(N,i,i[59],null),U=[co,uo,ao,lo],z=[];function W(k,G){var tt,rt;return k[18]?0:k[16]?((tt=k[14])==null?void 0:tt.length)===0?2:k[16]&&(rt=k[14])!=null&&rt.length?3:-1:1}return~(g=W(i))&&(m=z[g]=U[g](i)),{c(){t=et(),e=O("form"),r=O("div"),o=O("button"),Et(n.$$.fragment),l=et(),s=O("input"),c=et(),a=O("div"),d=O("button"),Et(u.$$.fragment),f=et(),w&&w.c(),h=et(),b&&b.c(),v=et(),P&&P.c(),x=et(),m&&m.c(),y(o,"class","search-button svelte-qnu791"),y(o,"type","button"),y(s,"placeholder",i[8]),y(s,"aria-label",i[8]),y(s,"class","svelte-qnu791"),y(d,"type","button"),y(d,"title",i[3]),y(d,"class","svelte-qnu791"),y(a,"class","clear-button-container svelte-qnu791"),nt(a,"displayable",i[1]!==""),y(r,"class","input-group svelte-qnu791"),y(e,"tabindex","0"),y(e,"class",L=ze(i[2])+" svelte-qnu791"),nt(e,"can-collapse",i[4]&&i[1]==="")},m(k,G){D(k,t,G),D(k,e,G),T(e,r),T(r,o),ht(n,o,null),T(r,l),T(r,s),i[62](s),Ge(s,i[1]),T(r,c),T(r,a),T(a,d),ht(u,d,null),T(a,f),w&&w.m(a,null),T(r,h),b&&b.m(r,null),T(r,v),P&&P.m(r,null),T(e,x),~g&&z[g].m(e,null),$=!0,E||(_=[J(o,"click",i[61]),J(s,"input",i[63]),J(s,"focus",i[64]),J(s,"blur",i[65]),J(s,"keydown",i[22]),J(s,"input",i[66]),J(d,"click",i[67]),J(e,"submit",hi(i[21]))],E=!0)},p(k,G){(!$||G[0]&256)&&y(s,"placeholder",k[8]),(!$||G[0]&256)&&y(s,"aria-label",k[8]),G[0]&2&&s.value!==k[1]&&Ge(s,k[1]),(!$||G[0]&8)&&y(d,"title",k[3]),k[19]?w?G[0]&524288&&j(w,1):(w=rr(),w.c(),j(w,1),w.m(a,null)):w&&(re(),Z(w,1,1,()=>{w=null}),ie()),(!$||G[0]&2)&&nt(a,"displayable",k[1]!==""),k[5]===!0?b?(b.p(k,G),G[0]&32&&j(b,1)):(b=ir(k),b.c(),j(b,1),b.m(r,v)):b&&(re(),Z(b,1,1,()=>{b=null}),ie()),P&&P.p&&(!$||G[1]&268435456)&&ci(P,N,k,k[59],$?ui(N,k[59],G,null):di(k[59]),null);let tt=g;g=W(k),g===tt?~g&&z[g].p(k,G):(m&&(re(),Z(z[tt],1,1,()=>{z[tt]=null}),ie()),~g?(m=z[g],m?m.p(k,G):(m=z[g]=U[g](k),m.c()),j(m,1),m.m(e,null)):m=null),(!$||G[0]&4&&L!==(L=ze(k[2])+" svelte-qnu791"))&&y(e,"class",L),(!$||G[0]&22)&&nt(e,"can-collapse",k[4]&&k[1]==="")},i(k){$||(j(S),j(n.$$.fragment,k),j(u.$$.fragment,k),j(w),j(b),j(P,k),j(m),$=!0)},o(k){Z(S),Z(n.$$.fragment,k),Z(u.$$.fragment,k),Z(w),Z(b),Z(P,k),Z(m),$=!1},d(k){k&&(B(t),B(e)),pt(n),i[62](null),pt(u),w&&w.d(),b&&b.d(),P&&P.d(k),~g&&z[g].d(),E=!1,mt(_)}}}function ho(i,t,e){let r,{$$slots:o={},$$scope:n}=t;const l={continental_marine:4,country:4,major_landform:8,region:5,subregion:6,county:7,joint_municipality:8,joint_submunicipality:9,municipality:10,municipal_district:11,locality:12,neighbourhood:13,place:14,postal_code:14,road:16,poi:17,address:18,"poi.peak":15,"poi.shop":18,"poi.cafe":18,"poi.restaurant":18,"poi.aerodrome":13};let{class:s=void 0}=t,{apiKey:c}=t,{bbox:a=void 0}=t,{clearButtonTitle:d="clear"}=t,{clearOnBlur:u=!1}=t,{collapsed:f=!1}=t,{country:h=void 0}=t,{debounceSearch:v=200}=t,{enableReverse:x=!1}=t,{errorMessage:g="Something went wrong…"}=t,{filter:m=()=>!0}=t,{flyTo:L=!0}=t,{fuzzyMatch:$=!0}=t,{language:E=void 0}=t,{limit:_=void 0}=t,{mapController:S=void 0}=t,{minLength:w=2}=t,{noResultsMessage:b="Oops! Looks like you're trying to predict something that's not quite right. We can't seem to find what you're looking for. Maybe try double-checking your spelling or try a different search term. Keep on typing - we'll do our best to get you where you need to go!"}=t,{placeholder:N="Search"}=t,{proximity:P=[{type:"server-geolocation"}]}=t,{reverseActive:U=x==="always"}=t,{reverseButtonTitle:z="toggle reverse geocoding"}=t,{searchValue:W=""}=t,{showFullGeometry:k=!0}=t,{showPlaceType:G="ifNeeded"}=t,{showResultsWhileTyping:tt=!0}=t,{selectFirst:rt=!0}=t,{flyToSelected:ae=!1}=t,{markerOnSelected:Qt=!0}=t,{types:_t=void 0}=t,{excludeTypes:Vt=!1}=t,{zoom:Nt=l}=t,{maxZoom:Kt=void 0}=t,{apiUrl:ue="https://api.maptiler.com/geocoding"}=t,{fetchParameters:ce={}}=t,{iconsBaseUrl:We="https://cdn.maptiler.com/maptiler-geocoding-control/v1.4.1/icons/"}=t,{adjustUrlQuery:de=()=>{}}=t;function Or(){ut.focus()}function Ar(){ut.blur()}function Oe(p,I=!0,Y=!1){e(1,W=p),I?(e(15,F=-1),Be()):(me(!Y,Y),setTimeout(()=>{ut.focus(),ut.select()}))}function Br(){e(14,R=void 0),e(56,M=void 0),e(15,F=-1)}function Ur(){e(55,q=[]),e(56,M=void 0)}let Mt=!1,R,q,M,Ae="",ut,F=-1,ct,Yt=[],Ct,Tt,Xt,fe;const Fr=new Set,gt=yi();gi(()=>{S&&(S.setEventHandler(void 0),S.indicateReverse(!1),S.setSelectedMarker(-1),S.setMarkers(void 0,void 0))});function Be(p){if(Tt&&(clearTimeout(Tt),Tt=void 0),F>-1&&R)e(56,M=R[F]),e(1,W=M.place_type[0]==="reverse"?M.place_name:M.place_name.replace(/,.*/,"")),e(18,ct=void 0),e(55,q=void 0),e(15,F=-1);else if(W){const I=p||!he(W);pe(W,{exact:!0}).then(()=>{e(55,q=R),e(56,M=void 0),I&&Dr()}).catch(Y=>e(18,ct=Y))}}function he(p){try{return so(p,6)}catch{return!1}}async function pe(p,{byId:I=!1,exact:Y=!1}={}){e(18,ct=void 0),Ct==null||Ct.abort();const Q=new AbortController;e(19,Ct=Q);try{const C=he(p),H=new URLSearchParams;if(E!==void 0&&H.set("language",Array.isArray(E)?E.join(","):E??""),_t&&H.set("types",_t.join(",")),Vt&&H.set("excludeTypes",String(Vt)),a&&H.set("bbox",a.map(Jt=>Jt.toFixed(6)).join(",")),h&&H.set("country",Array.isArray(h)?h.join(","):h),!I&&!C){const Jt=await Vi(S,P,Q);Jt&&H.set("proximity",Jt),(Y||!tt)&&H.set("autocomplete","false"),H.set("fuzzyMatch",String($))}_!==void 0&&(!C||(_t==null?void 0:_t.length)===1)&&H.set("limit",String(_)),H.set("key",c),de(H);const dt=ue+"/"+encodeURIComponent(C?C.decimalLongitude+","+C.decimalLatitude:p)+".json?"+H.toString();if(dt===Ae){I?(e(14,R=void 0),e(56,M=Yt[0])):e(14,R=Yt);return}Ae=dt;const ye=await fetch(dt,{signal:Q.signal,...ce});if(!ye.ok)throw new Error(await ye.text());const ve=await ye.json();gt("response",{url:dt,featureCollection:ve}),I?(e(14,R=void 0),e(56,M=ve.features[0]),Yt=[M]):(e(14,R=ve.features.filter(m)),C&&R.unshift({type:"Feature",properties:{},id:"reverse_"+C.decimalLongitude+"_"+C.decimalLatitude,text:C.decimalLatitude+", "+C.decimalLongitude,place_name:C.decimalLatitude+", "+C.decimalLongitude,place_type:["reverse"],center:[C.decimalLongitude,C.decimalLatitude],bbox:[C.decimalLongitude,C.decimalLatitude,C.decimalLongitude,C.decimalLatitude],geometry:{type:"Point",coordinates:[C.decimalLongitude,C.decimalLatitude]}}),Yt=R,C&&ut.focus())}catch(C){if(C&&typeof C=="object"&&"name"in C&&C.name==="AbortError")return;throw C}finally{Q===Ct&&e(19,Ct=void 0)}}function Dr(){var p;if(!(q!=null&&q.length)||!L)return;const I=[180,90,-180,-90],Y=!q.some(C=>!C.matching_text);let Q;for(const C of q){const H=At(C);if(Q=Kt??(Q===void 0?H:H===void 0?Q:Math.max(Q,H)),Y||!C.matching_text)for(const dt of[0,1,2,3])I[dt]=Math[dt<2?"min":"max"](I[dt],((p=C.bbox)==null?void 0:p[dt])??C.center[dt%2])}S&&q.length>0&&(M&&I[0]===I[2]&&I[1]===I[3]?S.flyTo(M.center,At(M)):S.fitBounds(ne(I),50,Q))}function At(p){var I;if(!p.bbox||p.bbox[0]!==p.bbox[2]&&p.bbox[1]!==p.bbox[3])return;if(typeof Nt=="number")return p.id.startsWith("poi.")||p.id.startsWith("address.")?Kt:Nt;const Y=p.id.replace(/\..*/,"");return(Array.isArray((I=p.properties)==null?void 0:I.categories)?p.properties.categories.reduce((Q,C)=>{const H=Nt[Y+"."+C];return Q===void 0?H:H===void 0?Q:Math.max(Q,H)},void 0):void 0)??Nt[Y]}function zr(p){e(0,U=x==="always"),e(14,R=void 0),e(56,M=void 0),e(15,F=-1),Oe(p[1].toFixed(6)+", "+Qi(p[0],[-180,180],!0).toFixed(6),!1,!0)}function Gr(p){if(!R)return;let I=p.key==="ArrowDown"?1:p.key==="ArrowUp"?-1:0;I&&(F===(rt?0:-1)&&I===-1&&e(15,F=R.length),e(15,F+=I),F>=R.length&&e(15,F=-1),F<0&&rt&&e(15,F=0),p.preventDefault())}function me(p=!0,I=!1){if(e(18,ct=void 0),tt||I){if(Tt&&clearTimeout(Tt),W.length<w)return;const Y=W;Tt=window.setTimeout(()=>{pe(Y).catch(Q=>e(18,ct=Q))},p?v:0)}else e(14,R=void 0),e(18,ct=void 0)}function ge(p){e(56,M=p),e(1,W=p.place_name),e(15,F=-1)}const jr=()=>ut.focus();function Hr(p){we[p?"unshift":"push"](()=>{ut=p,e(17,ut)})}function qr(){W=this.value,e(1,W),e(13,Mt),e(28,u)}const Zr=()=>e(13,Mt=!0),Qr=()=>e(13,Mt=!1),Vr=()=>me(),Kr=()=>{e(1,W=""),ut.focus()},Yr=()=>e(0,U=!U),Xr=()=>e(18,ct=void 0),Jr=p=>e(15,F=p),ti=p=>ge(p),ei=()=>{rt||e(15,F=-1)},ri=()=>{};return i.$$set=p=>{"class"in p&&e(2,s=p.class),"apiKey"in p&&e(26,c=p.apiKey),"bbox"in p&&e(27,a=p.bbox),"clearButtonTitle"in p&&e(3,d=p.clearButtonTitle),"clearOnBlur"in p&&e(28,u=p.clearOnBlur),"collapsed"in p&&e(4,f=p.collapsed),"country"in p&&e(29,h=p.country),"debounceSearch"in p&&e(30,v=p.debounceSearch),"enableReverse"in p&&e(5,x=p.enableReverse),"errorMessage"in p&&e(6,g=p.errorMessage),"filter"in p&&e(31,m=p.filter),"flyTo"in p&&e(32,L=p.flyTo),"fuzzyMatch"in p&&e(33,$=p.fuzzyMatch),"language"in p&&e(34,E=p.language),"limit"in p&&e(35,_=p.limit),"mapController"in p&&e(36,S=p.mapController),"minLength"in p&&e(37,w=p.minLength),"noResultsMessage"in p&&e(7,b=p.noResultsMessage),"placeholder"in p&&e(8,N=p.placeholder),"proximity"in p&&e(38,P=p.proximity),"reverseActive"in p&&e(0,U=p.reverseActive),"reverseButtonTitle"in p&&e(9,z=p.reverseButtonTitle),"searchValue"in p&&e(1,W=p.searchValue),"showFullGeometry"in p&&e(39,k=p.showFullGeometry),"showPlaceType"in p&&e(10,G=p.showPlaceType),"showResultsWhileTyping"in p&&e(40,tt=p.showResultsWhileTyping),"selectFirst"in p&&e(11,rt=p.selectFirst),"flyToSelected"in p&&e(41,ae=p.flyToSelected),"markerOnSelected"in p&&e(42,Qt=p.markerOnSelected),"types"in p&&e(43,_t=p.types),"excludeTypes"in p&&e(44,Vt=p.excludeTypes),"zoom"in p&&e(45,Nt=p.zoom),"maxZoom"in p&&e(46,Kt=p.maxZoom),"apiUrl"in p&&e(47,ue=p.apiUrl),"fetchParameters"in p&&e(48,ce=p.fetchParameters),"iconsBaseUrl"in p&&e(12,We=p.iconsBaseUrl),"adjustUrlQuery"in p&&e(49,de=p.adjustUrlQuery),"$$scope"in p&&e(59,n=p.$$scope)},i.$$.update=()=>{if(i.$$.dirty[0]&32&&e(0,U=x==="always"),i.$$.dirty[0]&268443648&&setTimeout(()=>{e(16,Xt=Mt),u&&!Mt&&e(1,W="")}),i.$$.dirty[0]&16386|i.$$.dirty[1]&64&&W.length<w&&(e(56,M=void 0),e(14,R=void 0),e(18,ct=void 0),e(55,q=R)),i.$$.dirty[1]&33554688&&k&&M&&!M.address&&M.geometry.type==="Point"&&M.place_type[0]!=="reverse"&&pe(M.id,{byId:!0}).catch(p=>e(18,ct=p)),i.$$.dirty[1]&100663330&&(S&&M&&M.id!==fe&&L&&(!M.bbox||M.bbox[0]===M.bbox[2]&&M.bbox[1]===M.bbox[3]?S.flyTo(M.center,At(M)):S.fitBounds(ne(M.bbox),50,At(M)),e(14,R=void 0),e(55,q=void 0),e(15,F=-1)),e(57,fe=M==null?void 0:M.id)),i.$$.dirty[0]&18432&&rt&&R!=null&&R.length&&e(15,F=0),i.$$.dirty[0]&2050&&(rt||e(15,F=-1)),i.$$.dirty[0]&16384|i.$$.dirty[1]&16777216&&q!==R&&e(55,q=void 0),i.$$.dirty[0]&81921|i.$$.dirty[1]&16777248&&S&&S.setEventHandler(p=>{switch(p.type){case"mapClick":U&&zr(p.coordinates);break;case"markerClick":{const I=R==null?void 0:R.find(Y=>Y.id===p.id);I&&ge(I)}break;case"markerMouseEnter":q&&e(15,F=Xt?(R==null?void 0:R.findIndex(I=>I.id===p.id))??-1:-1);break;case"markerMouseLeave":q&&e(15,F=-1);break}}),i.$$.dirty[0]&49152&&e(58,r=R==null?void 0:R[F]),i.$$.dirty[1]&134218786&&S&&r&&L&&ae&&S.flyTo(r.center,At(r)),i.$$.dirty[1]&2080&&(Qt||S==null||S.setMarkers(void 0,void 0)),i.$$.dirty[1]&150997024&&S&&Qt&&!q&&(S.setMarkers(r?[r]:void 0,void 0),S.setSelectedMarker(r?0:-1)),i.$$.dirty[1]&50331680&&S&&S.setMarkers(q,M),i.$$.dirty[0]&32768|i.$$.dirty[1]&16777248&&q&&S&&S.setSelectedMarker(F),i.$$.dirty[0]&2|i.$$.dirty[1]&32&&S){const p=he(W);S.setReverseMarker(p?[p.decimalLongitude,p.decimalLatitude]:void 0)}i.$$.dirty[1]&134217728&>("select",r),i.$$.dirty[1]&33554432&>("pick",M),i.$$.dirty[0]&81920&>("optionsVisibilityChange",Xt&&!!R),i.$$.dirty[0]&16384&>("featuresListed",R),i.$$.dirty[1]&16777216&>("featuresMarked",q),i.$$.dirty[0]&1&>("reverseToggle",U),i.$$.dirty[0]&2&>("queryChange",W),i.$$.dirty[0]&1|i.$$.dirty[1]&32&&S&&S.indicateReverse(U)},[U,W,s,d,f,x,g,b,N,z,G,rt,We,Mt,R,F,Xt,ut,ct,Ct,Fr,Be,Gr,me,ge,l,c,a,u,h,v,m,L,$,E,_,S,w,P,k,tt,ae,Qt,_t,Vt,Nt,Kt,ue,ce,de,Or,Ar,Oe,Br,Ur,q,M,fe,r,n,o,jr,Hr,qr,Zr,Qr,Vr,Kr,Yr,Xr,Jr,ti,ei,ri]}let po=class extends $t{constructor(i){super(),St(this,i,ho,fo,wt,{ZOOM_DEFAULTS:25,class:2,apiKey:26,bbox:27,clearButtonTitle:3,clearOnBlur:28,collapsed:4,country:29,debounceSearch:30,enableReverse:5,errorMessage:6,filter:31,flyTo:32,fuzzyMatch:33,language:34,limit:35,mapController:36,minLength:37,noResultsMessage:7,placeholder:8,proximity:38,reverseActive:0,reverseButtonTitle:9,searchValue:1,showFullGeometry:39,showPlaceType:10,showResultsWhileTyping:40,selectFirst:11,flyToSelected:41,markerOnSelected:42,types:43,excludeTypes:44,zoom:45,maxZoom:46,apiUrl:47,fetchParameters:48,iconsBaseUrl:12,adjustUrlQuery:49,focus:50,blur:51,setQuery:52,clearList:53,clearMap:54},null,[-1,-1,-1])}get ZOOM_DEFAULTS(){return this.$$.ctx[25]}get focus(){return this.$$.ctx[50]}get blur(){return this.$$.ctx[51]}get setQuery(){return this.$$.ctx[52]}get clearList(){return this.$$.ctx[53]}get clearMap(){return this.$$.ctx[54]}};function jt(i,t,e={}){const r={type:"Feature"};return(e.id===0||e.id)&&(r.id=e.id),e.bbox&&(r.bbox=e.bbox),r.properties=t||{},r.geometry=i,r}function Pe(i,t,e={}){for(const r of i){if(r.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(r[r.length-1].length!==r[0].length)throw new Error("First and last Position are not equivalent.");for(let o=0;o<r[r.length-1].length;o++)if(r[r.length-1][o]!==r[0][o])throw new Error("First and last Position are not equivalent.")}return jt({type:"Polygon",coordinates:i},t,e)}function Ht(i,t={}){const e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=i,e}function Cr(i,t,e={}){return jt({type:"MultiPolygon",coordinates:i},t,e)}/**
|
|
2
2
|
* splaytree v3.1.2
|
|
3
3
|
* Fast Splay tree for Node and browser
|
|
4
4
|
*
|
|
@@ -18,9 +18,6 @@ MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
|
18
18
|
|
|
19
19
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
20
20
|
and limitations under the License.
|
|
21
|
-
***************************************************************************** */function
|
|
22
|
-
`);var o=e+(n?" ":"│ ");t.left&&Rs(t.left,o,!1,r,i),t.right&&Rs(t.right,o,!0,r,i)}}var Xs=function(){function t(e){e===void 0&&(e=Hc),this._root=null,this._size=0,this._comparator=e}return t.prototype.insert=function(e,n){return this._size++,this._root=Ns(e,n,this._root,this._comparator)},t.prototype.add=function(e,n){var r=new Pr(e,n);this._root===null&&(r.left=r.right=null,this._size++,this._root=r);var i=this._comparator,o=Lr(e,this._root,i),s=i(e,o.key);return s===0?this._root=o:(s<0?(r.left=o.left,r.right=o,o.left=null):s>0&&(r.right=o.right,r.left=o,o.right=null),this._size++,this._root=r),this._root},t.prototype.remove=function(e){this._root=this._remove(e,this._root,this._comparator)},t.prototype._remove=function(e,n,r){var i;if(n===null)return null;n=Lr(e,n,r);var o=r(e,n.key);return o===0?(n.left===null?i=n.right:(i=Lr(e,n.left,r),i.right=n.right),this._size--,i):n},t.prototype.pop=function(){var e=this._root;if(e){for(;e.left;)e=e.left;return this._root=Lr(e.key,this._root,this._comparator),this._root=this._remove(e.key,this._root,this._comparator),{key:e.key,data:e.data}}return null},t.prototype.findStatic=function(e){for(var n=this._root,r=this._comparator;n;){var i=r(e,n.key);if(i===0)return n;i<0?n=n.left:n=n.right}return null},t.prototype.find=function(e){return this._root&&(this._root=Lr(e,this._root,this._comparator),this._comparator(e,this._root.key)!==0)?null:this._root},t.prototype.contains=function(e){for(var n=this._root,r=this._comparator;n;){var i=r(e,n.key);if(i===0)return!0;i<0?n=n.left:n=n.right}return!1},t.prototype.forEach=function(e,n){for(var r=this._root,i=[],o=!1;!o;)r!==null?(i.push(r),r=r.left):i.length!==0?(r=i.pop(),e.call(n,r),r=r.right):o=!0;return this},t.prototype.range=function(e,n,r,i){for(var o=[],s=this._comparator,a=this._root,u;o.length!==0||a;)if(a)o.push(a),a=a.left;else{if(a=o.pop(),u=s(a.key,n),u>0)break;if(s(a.key,e)>=0&&r.call(i,a))return this;a=a.right}return this},t.prototype.keys=function(){var e=[];return this.forEach(function(n){var r=n.key;return e.push(r)}),e},t.prototype.values=function(){var e=[];return this.forEach(function(n){var r=n.data;return e.push(r)}),e},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},t.prototype.minNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.left;)e=e.left;return e},t.prototype.maxNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.right;)e=e.right;return e},t.prototype.at=function(e){for(var n=this._root,r=!1,i=0,o=[];!r;)if(n)o.push(n),n=n.left;else if(o.length>0){if(n=o.pop(),i===e)return n;i++,n=n.right}else r=!0;return null},t.prototype.next=function(e){var n=this._root,r=null;if(e.right){for(r=e.right;r.left;)r=r.left;return r}for(var i=this._comparator;n;){var o=i(e.key,n.key);if(o===0)break;o<0?(r=n,n=n.left):n=n.right}return r},t.prototype.prev=function(e){var n=this._root,r=null;if(e.left!==null){for(r=e.left;r.right;)r=r.right;return r}for(var i=this._comparator;n;){var o=i(e.key,n.key);if(o===0)break;o<0?n=n.left:(r=n,n=n.right)}return r},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return Jc(this._root)},t.prototype.load=function(e,n,r){n===void 0&&(n=[]),r===void 0&&(r=!1);var i=e.length,o=this._comparator;if(r&&Ms(e,n,0,i-1,o),this._root===null)this._root=Os(e,n,0,i),this._size=i;else{var s=Qc(this.toList(),Kc(e,n),o);i=this._size+i,this._root=Ps({head:s},0,i)}return this},t.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),t.prototype.toString=function(e){e===void 0&&(e=function(r){return String(r.key)});var n=[];return Rs(this._root,"",!0,function(r){return n.push(r)},e),n.join("")},t.prototype.update=function(e,n,r){var i=this._comparator,o=Oa(e,this._root,i),s=o.left,a=o.right;i(e,n)<0?a=Ns(n,r,a,i):s=Ns(n,r,s,i),this._root=Zc(s,a,i)},t.prototype.split=function(e){return Oa(e,this._root,this._comparator)},t.prototype[Symbol.iterator]=function(){var e,n,r;return Wc(this,function(i){switch(i.label){case 0:e=this._root,n=[],r=!1,i.label=1;case 1:return r?[3,6]:e===null?[3,2]:(n.push(e),e=e.left,[3,5]);case 2:return n.length===0?[3,4]:(e=n.pop(),[4,e]);case 3:return i.sent(),e=e.right,[3,5];case 4:r=!0,i.label=5;case 5:return[3,1];case 6:return[2]}})},t}();function Os(t,e,n,r){var i=r-n;if(i>0){var o=n+Math.floor(i/2),s=t[o],a=e[o],u=new Pr(s,a);return u.left=Os(t,e,n,o),u.right=Os(t,e,o+1,r),u}return null}function Kc(t,e){for(var n=new Pr(null,null),r=n,i=0;i<t.length;i++)r=r.next=new Pr(t[i],e[i]);return r.next=null,n.next}function Jc(t){for(var e=t,n=[],r=!1,i=new Pr(null,null),o=i;!r;)e?(n.push(e),e=e.left):n.length>0?(e=o=o.next=n.pop(),e=e.right):r=!0;return o.next=null,i.next}function Ps(t,e,n){var r=n-e;if(r>0){var i=e+Math.floor(r/2),o=Ps(t,e,i),s=t.head;return s.left=o,t.head=t.head.next,s.right=Ps(t,i+1,n),s}return null}function Qc(t,e,n){for(var r=new Pr(null,null),i=r,o=t,s=e;o!==null&&s!==null;)n(o.key,s.key)<0?(i.next=o,o=o.next):(i.next=s,s=s.next),i=i.next;return o!==null?i.next=o:s!==null&&(i.next=s),r.next}function Ms(t,e,n,r,i){if(!(n>=r)){for(var o=t[n+r>>1],s=n-1,a=r+1;;){do s++;while(i(t[s],o)<0);do a--;while(i(t[a],o)>0);if(s>=a)break;var u=t[s];t[s]=t[a],t[a]=u,u=e[s],e[s]=e[a],e[a]=u}Ms(t,e,n,a,i),Ms(t,e,a+1,r,i)}}function xn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Pa(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Se(t,e,n){return e&&Pa(t.prototype,e),n&&Pa(t,n),t}var Yi=function(t,e){return t.ll.x<=e.x&&e.x<=t.ur.x&&t.ll.y<=e.y&&e.y<=t.ur.y},Ds=function(t,e){if(e.ur.x<t.ll.x||t.ur.x<e.ll.x||e.ur.y<t.ll.y||t.ur.y<e.ll.y)return null;var n=t.ll.x<e.ll.x?e.ll.x:t.ll.x,r=t.ur.x<e.ur.x?t.ur.x:e.ur.x,i=t.ll.y<e.ll.y?e.ll.y:t.ll.y,o=t.ur.y<e.ur.y?t.ur.y:e.ur.y;return{ll:{x:n,y:i},ur:{x:r,y:o}}},Sr=Number.EPSILON;Sr===void 0&&(Sr=Math.pow(2,-52));var tp=Sr*Sr,As=function(t,e){if(-Sr<t&&t<Sr&&-Sr<e&&e<Sr)return 0;var n=t-e;return n*n<tp*t*e?0:t<e?-1:1},ep=function(){function t(){xn(this,t),this.reset()}return Se(t,[{key:"reset",value:function(){this.xRounder=new Ma,this.yRounder=new Ma}},{key:"round",value:function(e,n){return{x:this.xRounder.round(e),y:this.yRounder.round(n)}}}]),t}(),Ma=function(){function t(){xn(this,t),this.tree=new Xs,this.round(0)}return Se(t,[{key:"round",value:function(e){var n=this.tree.add(e),r=this.tree.prev(n);if(r!==null&&As(n.key,r.key)===0)return this.tree.remove(e),r.key;var i=this.tree.next(n);return i!==null&&As(n.key,i.key)===0?(this.tree.remove(e),i.key):e}}]),t}(),eo=new ep,Ji=function(t,e){return t.x*e.y-t.y*e.x},Eu=function(t,e){return t.x*e.x+t.y*e.y},Da=function(t,e,n){var r={x:e.x-t.x,y:e.y-t.y},i={x:n.x-t.x,y:n.y-t.y},o=Ji(r,i);return As(o,0)},zo=function(t){return Math.sqrt(Eu(t,t))},np=function(t,e,n){var r={x:e.x-t.x,y:e.y-t.y},i={x:n.x-t.x,y:n.y-t.y};return Ji(i,r)/zo(i)/zo(r)},rp=function(t,e,n){var r={x:e.x-t.x,y:e.y-t.y},i={x:n.x-t.x,y:n.y-t.y};return Eu(i,r)/zo(i)/zo(r)},Aa=function(t,e,n){return e.y===0?null:{x:t.x+e.x/e.y*(n-t.y),y:n}},Fa=function(t,e,n){return e.x===0?null:{x:n,y:t.y+e.y/e.x*(n-t.x)}},ip=function(t,e,n,r){if(e.x===0)return Fa(n,r,t.x);if(r.x===0)return Fa(t,e,n.x);if(e.y===0)return Aa(n,r,t.y);if(r.y===0)return Aa(t,e,n.y);var i=Ji(e,r);if(i==0)return null;var o={x:n.x-t.x,y:n.y-t.y},s=Ji(o,e)/i,a=Ji(o,r)/i,u=t.x+a*e.x,l=n.x+s*r.x,c=t.y+a*e.y,p=n.y+s*r.y,h=(u+l)/2,g=(c+p)/2;return{x:h,y:g}},Yn=function(){Se(t,null,[{key:"compare",value:function(e,n){var r=t.comparePoints(e.point,n.point);return r!==0?r:(e.point!==n.point&&e.link(n),e.isLeft!==n.isLeft?e.isLeft?1:-1:Uo.compare(e.segment,n.segment))}},{key:"comparePoints",value:function(e,n){return e.x<n.x?-1:e.x>n.x?1:e.y<n.y?-1:e.y>n.y?1:0}}]);function t(e,n){xn(this,t),e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=n}return Se(t,[{key:"link",value:function(e){if(e.point===this.point)throw new Error("Tried to link already linked events");for(var n=e.point.events,r=0,i=n.length;r<i;r++){var o=n[r];this.point.events.push(o),o.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function(){for(var e=this.point.events.length,n=0;n<e;n++){var r=this.point.events[n];if(r.segment.consumedBy===void 0)for(var i=n+1;i<e;i++){var o=this.point.events[i];o.consumedBy===void 0&&r.otherSE.point.events===o.otherSE.point.events&&r.segment.consume(o.segment)}}}},{key:"getAvailableLinkedEvents",value:function(){for(var e=[],n=0,r=this.point.events.length;n<r;n++){var i=this.point.events[n];i!==this&&!i.segment.ringOut&&i.segment.isInResult()&&e.push(i)}return e}},{key:"getLeftmostComparator",value:function(e){var n=this,r=new Map,i=function(o){var s=o.otherSE;r.set(o,{sine:np(n.point,e.point,s.point),cosine:rp(n.point,e.point,s.point)})};return function(o,s){r.has(o)||i(o),r.has(s)||i(s);var a=r.get(o),u=a.sine,l=a.cosine,c=r.get(s),p=c.sine,h=c.cosine;return u>=0&&p>=0?l<h?1:l>h?-1:0:u<0&&p<0?l<h?-1:l>h?1:0:p<u?-1:p>u?1:0}}}]),t}(),op=0,Uo=function(){Se(t,null,[{key:"compare",value:function(e,n){var r=e.leftSE.point.x,i=n.leftSE.point.x,o=e.rightSE.point.x,s=n.rightSE.point.x;if(s<r)return 1;if(o<i)return-1;var a=e.leftSE.point.y,u=n.leftSE.point.y,l=e.rightSE.point.y,c=n.rightSE.point.y;if(r<i){if(u<a&&u<l)return 1;if(u>a&&u>l)return-1;var p=e.comparePoint(n.leftSE.point);if(p<0)return 1;if(p>0)return-1;var h=n.comparePoint(e.rightSE.point);return h!==0?h:-1}if(r>i){if(a<u&&a<c)return-1;if(a>u&&a>c)return 1;var g=n.comparePoint(e.leftSE.point);if(g!==0)return g;var f=e.comparePoint(n.rightSE.point);return f<0?1:f>0?-1:1}if(a<u)return-1;if(a>u)return 1;if(o<s){var m=n.comparePoint(e.rightSE.point);if(m!==0)return m}if(o>s){var y=e.comparePoint(n.rightSE.point);if(y<0)return 1;if(y>0)return-1}if(o!==s){var v=l-a,x=o-r,I=c-u,C=s-i;if(v>x&&I<C)return 1;if(v<x&&I>C)return-1}return o>s?1:o<s||l<c?-1:l>c?1:e.id<n.id?-1:e.id>n.id?1:0}}]);function t(e,n,r,i){xn(this,t),this.id=++op,this.leftSE=e,e.segment=this,e.otherSE=n,this.rightSE=n,n.segment=this,n.otherSE=e,this.rings=r,this.windings=i}return Se(t,[{key:"replaceRightSE",value:function(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var e=this.leftSE.point.y,n=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e<n?e:n},ur:{x:this.rightSE.point.x,y:e>n?e:n}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}},{key:"comparePoint",value:function(e){if(this.isAnEndpoint(e))return 0;var n=this.leftSE.point,r=this.rightSE.point,i=this.vector();if(n.x===r.x)return e.x===n.x?0:e.x<n.x?1:-1;var o=(e.y-n.y)/i.y,s=n.x+o*i.x;if(e.x===s)return 0;var a=(e.x-n.x)/i.x,u=n.y+a*i.y;return e.y===u?0:e.y<u?-1:1}},{key:"getIntersection",value:function(e){var n=this.bbox(),r=e.bbox(),i=Ds(n,r);if(i===null)return null;var o=this.leftSE.point,s=this.rightSE.point,a=e.leftSE.point,u=e.rightSE.point,l=Yi(n,a)&&this.comparePoint(a)===0,c=Yi(r,o)&&e.comparePoint(o)===0,p=Yi(n,u)&&this.comparePoint(u)===0,h=Yi(r,s)&&e.comparePoint(s)===0;if(c&&l)return h&&!p?s:!h&&p?u:null;if(c)return p&&o.x===u.x&&o.y===u.y?null:o;if(l)return h&&s.x===a.x&&s.y===a.y?null:a;if(h&&p)return null;if(h)return s;if(p)return u;var g=ip(o,this.vector(),a,e.vector());return g===null||!Yi(i,g)?null:eo.round(g.x,g.y)}},{key:"split",value:function(e){var n=[],r=e.events!==void 0,i=new Yn(e,!0),o=new Yn(e,!1),s=this.rightSE;this.replaceRightSE(o),n.push(o),n.push(i);var a=new t(i,s,this.rings.slice(),this.windings.slice());return Yn.comparePoints(a.leftSE.point,a.rightSE.point)>0&&a.swapEvents(),Yn.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),r&&(i.checkForConsuming(),o.checkForConsuming()),n}},{key:"swapEvents",value:function(){var e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var n=0,r=this.windings.length;n<r;n++)this.windings[n]*=-1}},{key:"consume",value:function(e){for(var n=this,r=e;n.consumedBy;)n=n.consumedBy;for(;r.consumedBy;)r=r.consumedBy;var i=t.compare(n,r);if(i!==0){if(i>0){var o=n;n=r,r=o}if(n.prev===r){var s=n;n=r,r=s}for(var a=0,u=r.rings.length;a<u;a++){var l=r.rings[a],c=r.windings[a],p=n.rings.indexOf(l);p===-1?(n.rings.push(l),n.windings.push(c)):n.windings[p]+=c}r.rings=null,r.windings=null,r.consumedBy=n,r.leftSE.consumedBy=n.leftSE,r.rightSE.consumedBy=n.rightSE}}},{key:"prevInResult",value:function(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}},{key:"beforeState",value:function(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{var e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState()}return this._beforeState}},{key:"afterState",value:function(){if(this._afterState!==void 0)return this._afterState;var e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};for(var n=this._afterState.rings,r=this._afterState.windings,i=this._afterState.multiPolys,o=0,s=this.rings.length;o<s;o++){var a=this.rings[o],u=this.windings[o],l=n.indexOf(a);l===-1?(n.push(a),r.push(u)):r[l]+=u}for(var c=[],p=[],h=0,g=n.length;h<g;h++)if(r[h]!==0){var f=n[h],m=f.poly;if(p.indexOf(m)===-1)if(f.isExterior)c.push(m);else{p.indexOf(m)===-1&&p.push(m);var y=c.indexOf(f.poly);y!==-1&&c.splice(y,1)}}for(var v=0,x=c.length;v<x;v++){var I=c[v].multiPoly;i.indexOf(I)===-1&&i.push(I)}return this._afterState}},{key:"isInResult",value:function(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;var e=this.beforeState().multiPolys,n=this.afterState().multiPolys;switch(Ln.type){case"union":{var r=e.length===0,i=n.length===0;this._isInResult=r!==i;break}case"intersection":{var o,s;e.length<n.length?(o=e.length,s=n.length):(o=n.length,s=e.length),this._isInResult=s===Ln.numMultiPolys&&o<s;break}case"xor":{var a=Math.abs(e.length-n.length);this._isInResult=a%2===1;break}case"difference":{var u=function(l){return l.length===1&&l[0].isSubject};this._isInResult=u(e)!==u(n);break}default:throw new Error("Unrecognized operation type found ".concat(Ln.type))}return this._isInResult}}],[{key:"fromRing",value:function(e,n,r){var i,o,s,a=Yn.comparePoints(e,n);if(a<0)i=e,o=n,s=1;else if(a>0)i=n,o=e,s=-1;else throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));var u=new Yn(i,!0),l=new Yn(o,!1);return new t(u,l,[r],[s])}}]),t}(),Ga=function(){function t(e,n,r){if(xn(this,t),!Array.isArray(e)||e.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=n,this.isExterior=r,this.segments=[],typeof e[0][0]!="number"||typeof e[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var i=eo.round(e[0][0],e[0][1]);this.bbox={ll:{x:i.x,y:i.y},ur:{x:i.x,y:i.y}};for(var o=i,s=1,a=e.length;s<a;s++){if(typeof e[s][0]!="number"||typeof e[s][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var u=eo.round(e[s][0],e[s][1]);u.x===o.x&&u.y===o.y||(this.segments.push(Uo.fromRing(o,u,this)),u.x<this.bbox.ll.x&&(this.bbox.ll.x=u.x),u.y<this.bbox.ll.y&&(this.bbox.ll.y=u.y),u.x>this.bbox.ur.x&&(this.bbox.ur.x=u.x),u.y>this.bbox.ur.y&&(this.bbox.ur.y=u.y),o=u)}(i.x!==o.x||i.y!==o.y)&&this.segments.push(Uo.fromRing(o,i,this))}return Se(t,[{key:"getSweepEvents",value:function(){for(var e=[],n=0,r=this.segments.length;n<r;n++){var i=this.segments[n];e.push(i.leftSE),e.push(i.rightSE)}return e}}]),t}(),sp=function(){function t(e,n){if(xn(this,t),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Ga(e[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(var r=1,i=e.length;r<i;r++){var o=new Ga(e[r],this,!1);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.interiorRings.push(o)}this.multiPoly=n}return Se(t,[{key:"getSweepEvents",value:function(){for(var e=this.exteriorRing.getSweepEvents(),n=0,r=this.interiorRings.length;n<r;n++)for(var i=this.interiorRings[n].getSweepEvents(),o=0,s=i.length;o<s;o++)e.push(i[o]);return e}}]),t}(),ka=function(){function t(e,n){if(xn(this,t),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof e[0][0][0]=="number"&&(e=[e])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var r=0,i=e.length;r<i;r++){var o=new sp(e[r],this);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.polys.push(o)}this.isSubject=n}return Se(t,[{key:"getSweepEvents",value:function(){for(var e=[],n=0,r=this.polys.length;n<r;n++)for(var i=this.polys[n].getSweepEvents(),o=0,s=i.length;o<s;o++)e.push(i[o]);return e}}]),t}(),ap=function(){Se(t,null,[{key:"factory",value:function(e){for(var n=[],r=0,i=e.length;r<i;r++){var o=e[r];if(!(!o.isInResult()||o.ringOut)){for(var s=null,a=o.leftSE,u=o.rightSE,l=[a],c=a.point,p=[];s=a,a=u,l.push(a),a.point!==c;)for(;;){var h=a.getAvailableLinkedEvents();if(h.length===0){var g=l[0].point,f=l[l.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(g.x,",")+" ".concat(g.y,"]. Last matching segment found ends at")+" [".concat(f.x,", ").concat(f.y,"]."))}if(h.length===1){u=h[0].otherSE;break}for(var m=null,y=0,v=p.length;y<v;y++)if(p[y].point===a.point){m=y;break}if(m!==null){var x=p.splice(m)[0],I=l.splice(x.index);I.unshift(I[0].otherSE),n.push(new t(I.reverse()));continue}p.push({index:l.length,point:a.point});var C=a.getLeftmostComparator(s);u=h.sort(C)[0].otherSE;break}n.push(new t(l))}}return n}}]);function t(e){xn(this,t),this.events=e;for(var n=0,r=e.length;n<r;n++)e[n].segment.ringOut=this;this.poly=null}return Se(t,[{key:"getGeom",value:function(){for(var e=this.events[0].point,n=[e],r=1,i=this.events.length-1;r<i;r++){var o=this.events[r].point,s=this.events[r+1].point;Da(o,e,s)!==0&&(n.push(o),e=o)}if(n.length===1)return null;var a=n[0],u=n[1];Da(a,e,u)===0&&n.shift(),n.push(n[0]);for(var l=this.isExteriorRing()?1:-1,c=this.isExteriorRing()?0:n.length-1,p=this.isExteriorRing()?n.length:-1,h=[],g=c;g!=p;g+=l)h.push([n[g].x,n[g].y]);return h}},{key:"isExteriorRing",value:function(){if(this._isExteriorRing===void 0){var e=this.enclosingRing();this._isExteriorRing=e?!e.isExteriorRing():!0}return this._isExteriorRing}},{key:"enclosingRing",value:function(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}},{key:"_calcEnclosingRing",value:function(){for(var e=this.events[0],n=1,r=this.events.length;n<r;n++){var i=this.events[n];Yn.compare(e,i)>0&&(e=i)}for(var o=e.segment.prevInResult(),s=o?o.prevInResult():null;;){if(!o)return null;if(!s)return o.ringOut;if(s.ringOut!==o.ringOut)return s.ringOut.enclosingRing()!==o.ringOut?o.ringOut:o.ringOut.enclosingRing();o=s.prevInResult(),s=o?o.prevInResult():null}}}]),t}(),qa=function(){function t(e){xn(this,t),this.exteriorRing=e,e.poly=this,this.interiorRings=[]}return Se(t,[{key:"addInterior",value:function(e){this.interiorRings.push(e),e.poly=this}},{key:"getGeom",value:function(){var e=[this.exteriorRing.getGeom()];if(e[0]===null)return null;for(var n=0,r=this.interiorRings.length;n<r;n++){var i=this.interiorRings[n].getGeom();i!==null&&e.push(i)}return e}}]),t}(),up=function(){function t(e){xn(this,t),this.rings=e,this.polys=this._composePolys(e)}return Se(t,[{key:"getGeom",value:function(){for(var e=[],n=0,r=this.polys.length;n<r;n++){var i=this.polys[n].getGeom();i!==null&&e.push(i)}return e}},{key:"_composePolys",value:function(e){for(var n=[],r=0,i=e.length;r<i;r++){var o=e[r];if(!o.poly)if(o.isExteriorRing())n.push(new qa(o));else{var s=o.enclosingRing();s.poly||n.push(new qa(s)),s.poly.addInterior(o)}}return n}}]),t}(),lp=function(){function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Uo.compare;xn(this,t),this.queue=e,this.tree=new Xs(n),this.segments=[]}return Se(t,[{key:"process",value:function(e){var n=e.segment,r=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(n),r;var i=e.isLeft?this.tree.insert(n):this.tree.find(n);if(!i)throw new Error("Unable to find segment #".concat(n.id," ")+"[".concat(n.leftSE.point.x,", ").concat(n.leftSE.point.y,"] -> ")+"[".concat(n.rightSE.point.x,", ").concat(n.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var o=i,s=i,a=void 0,u=void 0;a===void 0;)o=this.tree.prev(o),o===null?a=null:o.key.consumedBy===void 0&&(a=o.key);for(;u===void 0;)s=this.tree.next(s),s===null?u=null:s.key.consumedBy===void 0&&(u=s.key);if(e.isLeft){var l=null;if(a){var c=a.getIntersection(n);if(c!==null&&(n.isAnEndpoint(c)||(l=c),!a.isAnEndpoint(c)))for(var p=this._splitSafely(a,c),h=0,g=p.length;h<g;h++)r.push(p[h])}var f=null;if(u){var m=u.getIntersection(n);if(m!==null&&(n.isAnEndpoint(m)||(f=m),!u.isAnEndpoint(m)))for(var y=this._splitSafely(u,m),v=0,x=y.length;v<x;v++)r.push(y[v])}if(l!==null||f!==null){var I=null;if(l===null)I=f;else if(f===null)I=l;else{var C=Yn.comparePoints(l,f);I=C<=0?l:f}this.queue.remove(n.rightSE),r.push(n.rightSE);for(var P=n.split(I),D=0,S=P.length;D<S;D++)r.push(P[D])}r.length>0?(this.tree.remove(n),r.push(e)):(this.segments.push(n),n.prev=a)}else{if(a&&u){var T=a.getIntersection(u);if(T!==null){if(!a.isAnEndpoint(T))for(var w=this._splitSafely(a,T),A=0,X=w.length;A<X;A++)r.push(w[A]);if(!u.isAnEndpoint(T))for(var k=this._splitSafely(u,T),pt=0,N=k.length;pt<N;pt++)r.push(k[pt])}}this.tree.remove(n)}return r}},{key:"_splitSafely",value:function(e,n){this.tree.remove(e);var r=e.rightSE;this.queue.remove(r);var i=e.split(n);return i.push(r),e.consumedBy===void 0&&this.tree.insert(e),i}}]),t}(),Ba=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,cp=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,pp=function(){function t(){xn(this,t)}return Se(t,[{key:"run",value:function(e,n,r){Ln.type=e,eo.reset();for(var i=[new ka(n,!0)],o=0,s=r.length;o<s;o++)i.push(new ka(r[o],!1));if(Ln.numMultiPolys=i.length,Ln.type==="difference")for(var a=i[0],u=1;u<i.length;)Ds(i[u].bbox,a.bbox)!==null?u++:i.splice(u,1);if(Ln.type==="intersection"){for(var l=0,c=i.length;l<c;l++)for(var p=i[l],h=l+1,g=i.length;h<g;h++)if(Ds(p.bbox,i[h].bbox)===null)return[]}for(var f=new Xs(Yn.compare),m=0,y=i.length;m<y;m++)for(var v=i[m].getSweepEvents(),x=0,I=v.length;x<I;x++)if(f.insert(v[x]),f.size>Ba)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var C=new lp(f),P=f.size,D=f.pop();D;){var S=D.key;if(f.size===P){var T=S.segment;throw new Error("Unable to pop() ".concat(S.isLeft?"left":"right"," SweepEvent ")+"[".concat(S.point.x,", ").concat(S.point.y,"] from segment #").concat(T.id," ")+"[".concat(T.leftSE.point.x,", ").concat(T.leftSE.point.y,"] -> ")+"[".concat(T.rightSE.point.x,", ").concat(T.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(f.size>Ba)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(C.segments.length>cp)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var w=C.process(S),A=0,X=w.length;A<X;A++){var k=w[A];k.consumedBy===void 0&&f.insert(k)}P=f.size,D=f.pop()}eo.reset();var pt=ap.factory(C.segments),N=new up(pt);return N.getGeom()}}]),t}(),Ln=new pp,hp=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Ln.run("union",t,n)},fp=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Ln.run("intersection",t,n)},gp=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Ln.run("xor",t,n)},dp=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Ln.run("difference",t,n)},xu={union:hp,intersection:fp,xor:gp,difference:dp},Ne=63710088e-1,Iu={centimeters:Ne*100,centimetres:Ne*100,degrees:Ne/111325,feet:Ne*3.28084,inches:Ne*39.37,kilometers:Ne/1e3,kilometres:Ne/1e3,meters:Ne,metres:Ne,miles:Ne/1609.344,millimeters:Ne*1e3,millimetres:Ne*1e3,nauticalmiles:Ne/1852,radians:1,yards:Ne*1.0936};function ts(t,e,n){n===void 0&&(n={});var r={type:"Feature"};return(n.id===0||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=e||{},r.geometry=t,r}function mp(t,e,n){if(n===void 0&&(n={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!za(t[0])||!za(t[1]))throw new Error("coordinates must contain numbers");var r={type:"Point",coordinates:t};return ts(r,e,n)}function Nu(t,e,n){n===void 0&&(n={});for(var r=0,i=t;r<i.length;r++){var o=i[r];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<o[o.length-1].length;s++)if(o[o.length-1][s]!==o[0][s])throw new Error("First and last Position are not equivalent.")}var a={type:"Polygon",coordinates:t};return ts(a,e,n)}function Fs(t,e){e===void 0&&(e={});var n={type:"FeatureCollection"};return e.id&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.features=t,n}function bu(t,e,n){n===void 0&&(n={});var r={type:"MultiPolygon",coordinates:t};return ts(r,e,n)}function yp(t,e){e===void 0&&(e="kilometers");var n=Iu[e];if(!n)throw new Error(e+" units is invalid");return t*n}function _p(t,e){e===void 0&&(e="kilometers");var n=Iu[e];if(!n)throw new Error(e+" units is invalid");return t/n}function za(t){return!isNaN(t)&&t!==null&&!Array.isArray(t)}function Vo(t){return t.type==="Feature"?t.geometry:t}function vp(t,e,n){n===void 0&&(n={});var r=Vo(t),i=Vo(e),o=xu.union(r.coordinates,i.coordinates);return o.length===0?null:o.length===1?Nu(o[0],n.properties):bu(o,n.properties)}function Cu(t,e,n){if(t!==null)for(var r,i,o,s,a,u,l,c=0,p=0,h,g=t.type,f=g==="FeatureCollection",m=g==="Feature",y=f?t.features.length:1,v=0;v<y;v++){l=f?t.features[v].geometry:m?t.geometry:t,h=l?l.type==="GeometryCollection":!1,a=h?l.geometries.length:1;for(var x=0;x<a;x++){var I=0,C=0;if(s=h?l.geometries[x]:l,s!==null){u=s.coordinates;var P=s.type;switch(c=n&&(P==="Polygon"||P==="MultiPolygon")?1:0,P){case null:break;case"Point":if(e(u,p,v,I,C)===!1)return!1;p++,I++;break;case"LineString":case"MultiPoint":for(r=0;r<u.length;r++){if(e(u[r],p,v,I,C)===!1)return!1;p++,P==="MultiPoint"&&I++}P==="LineString"&&I++;break;case"Polygon":case"MultiLineString":for(r=0;r<u.length;r++){for(i=0;i<u[r].length-c;i++){if(e(u[r][i],p,v,I,C)===!1)return!1;p++}P==="MultiLineString"&&I++,P==="Polygon"&&C++}P==="Polygon"&&I++;break;case"MultiPolygon":for(r=0;r<u.length;r++){for(C=0,i=0;i<u[r].length;i++){for(o=0;o<u[r][i].length-c;o++){if(e(u[r][i][o],p,v,I,C)===!1)return!1;p++}C++}I++}break;case"GeometryCollection":for(r=0;r<s.geometries.length;r++)if(Cu(s.geometries[r],e,n)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Ua(t,e){if(t.type==="Feature")e(t,0);else if(t.type==="FeatureCollection")for(var n=0;n<t.features.length&&e(t.features[n],n)!==!1;n++);}function Lu(t,e){var n,r,i,o,s,a,u,l,c,p,h=0,g=t.type==="FeatureCollection",f=t.type==="Feature",m=g?t.features.length:1;for(n=0;n<m;n++){for(a=g?t.features[n].geometry:f?t.geometry:t,l=g?t.features[n].properties:f?t.properties:{},c=g?t.features[n].bbox:f?t.bbox:void 0,p=g?t.features[n].id:f?t.id:void 0,u=a?a.type==="GeometryCollection":!1,s=u?a.geometries.length:1,i=0;i<s;i++){if(o=u?a.geometries[i]:a,o===null){if(e(null,h,l,c,p)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(o,h,l,c,p)===!1)return!1;break}case"GeometryCollection":{for(r=0;r<o.geometries.length;r++)if(e(o.geometries[r],h,l,c,p)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}h++}}function Gs(t){var e=[1/0,1/0,-1/0,-1/0];return Cu(t,function(n){e[0]>n[0]&&(e[0]=n[0]),e[1]>n[1]&&(e[1]=n[1]),e[2]<n[0]&&(e[2]=n[0]),e[3]<n[1]&&(e[3]=n[1])}),e}Gs.default=Gs;function Ep(t,e){e===void 0&&(e={});var n=Gs(t),r=(n[0]+n[2])/2,i=(n[1]+n[3])/2;return mp([r,i],e.properties,e)}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(t){if(this===void 0||this===null)throw new TypeError(this+" is not an object");var e=Object(this),n=Math.max(Math.min(e.length,9007199254740991),0)||0,r=1 in arguments&&parseInt(Number(arguments[1]),10)||0;r=r<0?Math.max(n+r,0):Math.min(r,n);var i=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:n;for(i=i<0?Math.max(n+arguments[2],0):Math.min(i,n);r<i;)e[r]=t,++r;return e},writable:!0});Number.isFinite=Number.isFinite||function(t){return typeof t=="number"&&isFinite(t)};Number.isInteger=Number.isInteger||function(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t};Number.parseFloat=Number.parseFloat||parseFloat;Number.isNaN=Number.isNaN||function(t){return t!==t};Math.trunc=Math.trunc||function(t){return t<0?Math.ceil(t):Math.floor(t)};var Wr=function(){};Wr.prototype.interfaces_=function(){return[]};Wr.prototype.getClass=function(){return Wr};Wr.prototype.equalsWithTolerance=function(t,e,n){return Math.abs(t-e)<=n};var ft=function(t){function e(n){t.call(this,n),this.name="IllegalArgumentException",this.message=n,this.stack=new t().stack}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),U=function(){},Su={MAX_VALUE:{configurable:!0}};U.isNaN=function(t){return Number.isNaN(t)};U.doubleToLongBits=function(t){return t};U.longBitsToDouble=function(t){return t};U.isInfinite=function(t){return!Number.isFinite(t)};Su.MAX_VALUE.get=function(){return Number.MAX_VALUE};Object.defineProperties(U,Su);var Be=function(){},es=function(){},Ei=function(){};function ze(){}var d=function t(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)this.x=0,this.y=0,this.z=t.NULL_ORDINATE;else if(arguments.length===1){var e=arguments[0];this.x=e.x,this.y=e.y,this.z=e.z}else arguments.length===2?(this.x=arguments[0],this.y=arguments[1],this.z=t.NULL_ORDINATE):arguments.length===3&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},ai={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};d.prototype.setOrdinate=function(t,e){switch(t){case d.X:this.x=e;break;case d.Y:this.y=e;break;case d.Z:this.z=e;break;default:throw new ft("Invalid ordinate index: "+t)}};d.prototype.equals2D=function(){if(arguments.length===1){var t=arguments[0];return!(this.x!==t.x||this.y!==t.y)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return!(!Wr.equalsWithTolerance(this.x,e.x,n)||!Wr.equalsWithTolerance(this.y,e.y,n))}};d.prototype.getOrdinate=function(t){switch(t){case d.X:return this.x;case d.Y:return this.y;case d.Z:return this.z}throw new ft("Invalid ordinate index: "+t)};d.prototype.equals3D=function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||U.isNaN(this.z))&&U.isNaN(t.z)};d.prototype.equals=function(t){return t instanceof d?this.equals2D(t):!1};d.prototype.equalInZ=function(t,e){return Wr.equalsWithTolerance(this.z,t.z,e)};d.prototype.compareTo=function(t){var e=t;return this.x<e.x?-1:this.x>e.x?1:this.y<e.y?-1:this.y>e.y?1:0};d.prototype.clone=function(){};d.prototype.copy=function(){return new d(this)};d.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"};d.prototype.distance3D=function(t){var e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return Math.sqrt(e*e+n*n+r*r)};d.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)};d.prototype.hashCode=function(){var t=17;return t=37*t+d.hashCode(this.x),t=37*t+d.hashCode(this.y),t};d.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z};d.prototype.interfaces_=function(){return[Be,es,ze]};d.prototype.getClass=function(){return d};d.hashCode=function(){if(arguments.length===1){var t=arguments[0],e=U.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}};ai.DimensionalComparator.get=function(){return ar};ai.serialVersionUID.get=function(){return 6683108902428367e3};ai.NULL_ORDINATE.get=function(){return U.NaN};ai.X.get=function(){return 0};ai.Y.get=function(){return 1};ai.Z.get=function(){return 2};Object.defineProperties(d,ai);var ar=function(t){if(this._dimensionsToTest=2,arguments.length!==0&&arguments.length===1){var e=arguments[0];if(e!==2&&e!==3)throw new ft("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}};ar.prototype.compare=function(t,e){var n=t,r=e,i=ar.compare(n.x,r.x);if(i!==0)return i;var o=ar.compare(n.y,r.y);if(o!==0)return o;if(this._dimensionsToTest<=2)return 0;var s=ar.compare(n.z,r.z);return s};ar.prototype.interfaces_=function(){return[Ei]};ar.prototype.getClass=function(){return ar};ar.compare=function(t,e){return t<e?-1:t>e?1:U.isNaN(t)?U.isNaN(e)?0:-1:U.isNaN(e)?1:0};var xi=function(){};xi.prototype.create=function(){};xi.prototype.interfaces_=function(){return[]};xi.prototype.getClass=function(){return xi};var _=function(){},yo={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};_.prototype.interfaces_=function(){return[]};_.prototype.getClass=function(){return _};_.toLocationSymbol=function(t){switch(t){case _.EXTERIOR:return"e";case _.BOUNDARY:return"b";case _.INTERIOR:return"i";case _.NONE:return"-"}throw new ft("Unknown location value: "+t)};yo.INTERIOR.get=function(){return 0};yo.BOUNDARY.get=function(){return 1};yo.EXTERIOR.get=function(){return 2};yo.NONE.get=function(){return-1};Object.defineProperties(_,yo);var z=function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1},we=function(){},wu={LOG_10:{configurable:!0}};we.prototype.interfaces_=function(){return[]};we.prototype.getClass=function(){return we};we.log10=function(t){var e=Math.log(t);return U.isInfinite(e)||U.isNaN(e)?e:e/we.LOG_10};we.min=function(t,e,n,r){var i=t;return e<i&&(i=e),n<i&&(i=n),r<i&&(i=r),i};we.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1],n=arguments[2];return t<e?e:t>n?n:t}else if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var r=arguments[0],i=arguments[1],o=arguments[2];return r<i?i:r>o?o:r}};we.wrap=function(t,e){return t<0?e- -t%e:t%e};we.max=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],n=arguments[2],r=t;return e>r&&(r=e),n>r&&(r=n),r}else if(arguments.length===4){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],u=i;return o>u&&(u=o),s>u&&(u=s),a>u&&(u=a),u}};we.average=function(t,e){return(t+e)/2};wu.LOG_10.get=function(){return Math.log(10)};Object.defineProperties(we,wu);var In=function(t){this.str=t};In.prototype.append=function(t){this.str+=t};In.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)};In.prototype.toString=function(t){return this.str};var pn=function(t){this.value=t};pn.prototype.intValue=function(){return this.value};pn.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0};pn.isNaN=function(t){return Number.isNaN(t)};var no=function(){};no.isWhitespace=function(t){return t<=32&&t>=0||t===127};no.toUpperCase=function(t){return t.toUpperCase()};var E=function t(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var e=arguments[0];this.init(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.init(n)}else if(typeof arguments[0]=="string"){var r=arguments[0];t.call(this,t.parse(r))}}else if(arguments.length===2){var i=arguments[0],o=arguments[1];this.init(i,o)}},Qe={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};E.prototype.le=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<=t._lo};E.prototype.extractSignificantDigits=function(t,e){var n=this.abs(),r=E.magnitude(n._hi),i=E.TEN.pow(r);n=n.divide(i),n.gt(E.TEN)?(n=n.divide(E.TEN),r+=1):n.lt(E.ONE)&&(n=n.multiply(E.TEN),r-=1);for(var o=r+1,s=new In,a=E.MAX_PRINT_DIGITS-1,u=0;u<=a;u++){t&&u===o&&s.append(".");var l=Math.trunc(n._hi);if(l<0)break;var c=!1,p=0;l>9?(c=!0,p="9"):p="0"+l,s.append(p),n=n.subtract(E.valueOf(l)).multiply(E.TEN),c&&n.selfAdd(E.TEN);var h=!0,g=E.magnitude(n._hi);if(g<0&&Math.abs(g)>=a-u&&(h=!1),!h)break}return e[0]=r,s.toString()};E.prototype.sqr=function(){return this.multiply(this)};E.prototype.doubleValue=function(){return this._hi+this._lo};E.prototype.subtract=function(){if(arguments[0]instanceof E){var t=arguments[0];return this.add(t.negate())}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.add(-e)}};E.prototype.equals=function(){if(arguments.length===1){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}};E.prototype.isZero=function(){return this._hi===0&&this._lo===0};E.prototype.selfSubtract=function(){if(arguments[0]instanceof E){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}};E.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null};E.prototype.min=function(t){return this.le(t)?this:t};E.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof E){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.selfDivide(e,0)}}else if(arguments.length===2){var n=arguments[0],r=arguments[1],i=null,o=null,s=null,a=null,u=null,l=null,c=null,p=null;return u=this._hi/n,l=E.SPLIT*u,i=l-u,p=E.SPLIT*n,i=l-i,o=u-i,s=p-n,c=u*n,s=p-s,a=n-s,p=i*s-c+i*a+o*s+o*a,l=(this._hi-c-p+this._lo-u*r)/n,p=u+l,this._hi=p,this._lo=u-p+l,this}};E.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"};E.prototype.divide=function(){if(arguments[0]instanceof E){var t=arguments[0],e=null,n=null,r=null,i=null,o=null,s=null,a=null,u=null;o=this._hi/t._hi,s=E.SPLIT*o,e=s-o,u=E.SPLIT*t._hi,e=s-e,n=o-e,r=u-t._hi,a=o*t._hi,r=u-r,i=t._hi-r,u=e*r-a+e*i+n*r+n*i,s=(this._hi-a-u+this._lo-o*t._lo)/t._hi,u=o+s;var l=u,c=o-u+s;return new E(l,c)}else if(typeof arguments[0]=="number"){var p=arguments[0];return U.isNaN(p)?E.createNaN():E.copy(this).selfDivide(p,0)}};E.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo};E.prototype.pow=function(t){if(t===0)return E.valueOf(1);var e=new E(this),n=E.valueOf(1),r=Math.abs(t);if(r>1)for(;r>0;)r%2===1&&n.selfMultiply(e),r/=2,r>0&&(e=e.sqr());else n=e;return t<0?n.reciprocal():n};E.prototype.ceil=function(){if(this.isNaN())return E.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new E(t,e)};E.prototype.compareTo=function(t){var e=t;return this._hi<e._hi?-1:this._hi>e._hi?1:this._lo<e._lo?-1:this._lo>e._lo?1:0};E.prototype.rint=function(){if(this.isNaN())return this;var t=this.add(.5);return t.floor()};E.prototype.setValue=function(){if(arguments[0]instanceof E){var t=arguments[0];return this.init(t),this}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.init(e),this}};E.prototype.max=function(t){return this.ge(t)?this:t};E.prototype.sqrt=function(){if(this.isZero())return E.valueOf(0);if(this.isNegative())return E.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=E.valueOf(e),r=this.subtract(n.sqr()),i=r._hi*(t*.5);return n.add(i)};E.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof E){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0],n=null,r=null,i=null,o=null,s=null,a=null;return i=this._hi+e,s=i-this._hi,o=i-s,o=e-s+(this._hi-o),a=o+this._lo,n=i+a,r=a+(i-n),this._hi=n+r,this._lo=r+(n-this._hi),this}}else if(arguments.length===2){var u=arguments[0],l=arguments[1],c=null,p=null,h=null,g=null,f=null,m=null,y=null,v=null;f=this._hi+u,h=this._lo+l,y=f-this._hi,v=h-this._lo,m=f-y,g=h-v,m=u-y+(this._hi-m),g=l-v+(this._lo-g),y=m+h,c=f+y,p=y+(f-c),y=g+p;var x=c+y,I=y+(c-x);return this._hi=x,this._lo=I,this}};E.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof E){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.selfMultiply(e,0)}}else if(arguments.length===2){var n=arguments[0],r=arguments[1],i=null,o=null,s=null,a=null,u=null,l=null;u=E.SPLIT*this._hi,i=u-this._hi,l=E.SPLIT*n,i=u-i,o=this._hi-i,s=l-n,u=this._hi*n,s=l-s,a=n-s,l=i*s-u+i*a+o*s+o*a+(this._hi*r+this._lo*n);var c=u+l;i=u-c;var p=l+i;return this._hi=c,this._lo=p,this}};E.prototype.selfSqr=function(){return this.selfMultiply(this)};E.prototype.floor=function(){if(this.isNaN())return E.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new E(t,e)};E.prototype.negate=function(){return this.isNaN()?this:new E(-this._hi,-this._lo)};E.prototype.clone=function(){};E.prototype.multiply=function(){if(arguments[0]instanceof E){var t=arguments[0];return t.isNaN()?E.createNaN():E.copy(this).selfMultiply(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return U.isNaN(e)?E.createNaN():E.copy(this).selfMultiply(e,0)}};E.prototype.isNaN=function(){return U.isNaN(this._hi)};E.prototype.intValue=function(){return Math.trunc(this._hi)};E.prototype.toString=function(){var t=E.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()};E.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!0,e),r=e[0]+1,i=n;if(n.charAt(0)===".")i="0"+n;else if(r<0)i="0."+E.stringOfChar("0",-r)+n;else if(n.indexOf(".")===-1){var o=r-n.length,s=E.stringOfChar("0",o);i=n+s+".0"}return this.isNegative()?"-"+i:i};E.prototype.reciprocal=function(){var t=null,e=null,n=null,r=null,i=null,o=null,s=null,a=null;i=1/this._hi,o=E.SPLIT*i,t=o-i,a=E.SPLIT*this._hi,t=o-t,e=i-t,n=a-this._hi,s=i*this._hi,n=a-n,r=this._hi-n,a=t*n-s+t*r+e*n+e*r,o=(1-s-a-i*this._lo)/this._hi;var u=i+o,l=i-u+o;return new E(u,l)};E.prototype.toSciNotation=function(){if(this.isZero())return E.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!1,e),r=E.SCI_NOT_EXPONENT_CHAR+e[0];if(n.charAt(0)==="0")throw new Error("Found leading zero: "+n);var i="";n.length>1&&(i=n.substring(1));var o=n.charAt(0)+"."+i;return this.isNegative()?"-"+o+r:o+r};E.prototype.abs=function(){return this.isNaN()?E.NaN:this.isNegative()?this.negate():new E(this)};E.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0};E.prototype.lt=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<t._lo};E.prototype.add=function(){if(arguments[0]instanceof E){var t=arguments[0];return E.copy(this).selfAdd(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return E.copy(this).selfAdd(e)}};E.prototype.init=function(){if(arguments.length===1){if(typeof arguments[0]=="number"){var t=arguments[0];this._hi=t,this._lo=0}else if(arguments[0]instanceof E){var e=arguments[0];this._hi=e._hi,this._lo=e._lo}}else if(arguments.length===2){var n=arguments[0],r=arguments[1];this._hi=n,this._lo=r}};E.prototype.gt=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>t._lo};E.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0};E.prototype.trunc=function(){return this.isNaN()?E.NaN:this.isPositive()?this.floor():this.ceil()};E.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0};E.prototype.interfaces_=function(){return[ze,Be,es]};E.prototype.getClass=function(){return E};E.sqr=function(t){return E.valueOf(t).selfMultiply(t)};E.valueOf=function(){if(typeof arguments[0]=="string"){var t=arguments[0];return E.parse(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return new E(e)}};E.sqrt=function(t){return E.valueOf(t).sqrt()};E.parse=function(t){for(var e=0,n=t.length;no.isWhitespace(t.charAt(e));)e++;var r=!1;if(e<n){var i=t.charAt(e);(i==="-"||i==="+")&&(e++,i==="-"&&(r=!0))}for(var o=new E,s=0,a=0,u=0;!(e>=n);){var l=t.charAt(e);if(e++,no.isDigit(l)){var c=l-"0";o.selfMultiply(E.TEN),o.selfAdd(c),s++;continue}if(l==="."){a=s;continue}if(l==="e"||l==="E"){var p=t.substring(e);try{u=pn.parseInt(p)}catch(y){throw y instanceof Error?new Error("Invalid exponent "+p+" in string "+t):y}finally{}break}throw new Error("Unexpected character '"+l+"' at position "+e+" in string "+t)}var h=o,g=s-a-u;if(g===0)h=o;else if(g>0){var f=E.TEN.pow(g);h=o.divide(f)}else if(g<0){var m=E.TEN.pow(-g);h=o.multiply(m)}return r?h.negate():h};E.createNaN=function(){return new E(U.NaN,U.NaN)};E.copy=function(t){return new E(t)};E.magnitude=function(t){var e=Math.abs(t),n=Math.log(e)/Math.log(10),r=Math.trunc(Math.floor(n)),i=Math.pow(10,r);return i*10<=e&&(r+=1),r};E.stringOfChar=function(t,e){for(var n=new In,r=0;r<e;r++)n.append(t);return n.toString()};Qe.PI.get=function(){return new E(3.141592653589793,12246467991473532e-32)};Qe.TWO_PI.get=function(){return new E(6.283185307179586,24492935982947064e-32)};Qe.PI_2.get=function(){return new E(1.5707963267948966,6123233995736766e-32)};Qe.E.get=function(){return new E(2.718281828459045,14456468917292502e-32)};Qe.NaN.get=function(){return new E(U.NaN,U.NaN)};Qe.EPS.get=function(){return 123259516440783e-46};Qe.SPLIT.get=function(){return 134217729};Qe.MAX_PRINT_DIGITS.get=function(){return 32};Qe.TEN.get=function(){return E.valueOf(10)};Qe.ONE.get=function(){return E.valueOf(1)};Qe.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"};Qe.SCI_NOT_ZERO.get=function(){return"0.0E0"};Object.defineProperties(E,Qe);var he=function(){},Tu={DP_SAFE_EPSILON:{configurable:!0}};he.prototype.interfaces_=function(){return[]};he.prototype.getClass=function(){return he};he.orientationIndex=function(t,e,n){var r=he.orientationIndexFilter(t,e,n);if(r<=1)return r;var i=E.valueOf(e.x).selfAdd(-t.x),o=E.valueOf(e.y).selfAdd(-t.y),s=E.valueOf(n.x).selfAdd(-e.x),a=E.valueOf(n.y).selfAdd(-e.y);return i.selfMultiply(a).selfSubtract(o.selfMultiply(s)).signum()};he.signOfDet2x2=function(t,e,n,r){var i=t.multiply(r).selfSubtract(e.multiply(n));return i.signum()};he.intersection=function(t,e,n,r){var i=E.valueOf(r.y).selfSubtract(n.y).selfMultiply(E.valueOf(e.x).selfSubtract(t.x)),o=E.valueOf(r.x).selfSubtract(n.x).selfMultiply(E.valueOf(e.y).selfSubtract(t.y)),s=i.subtract(o),a=E.valueOf(r.x).selfSubtract(n.x).selfMultiply(E.valueOf(t.y).selfSubtract(n.y)),u=E.valueOf(r.y).selfSubtract(n.y).selfMultiply(E.valueOf(t.x).selfSubtract(n.x)),l=a.subtract(u),c=l.selfDivide(s).doubleValue(),p=E.valueOf(t.x).selfAdd(E.valueOf(e.x).selfSubtract(t.x).selfMultiply(c)).doubleValue(),h=E.valueOf(e.x).selfSubtract(t.x).selfMultiply(E.valueOf(t.y).selfSubtract(n.y)),g=E.valueOf(e.y).selfSubtract(t.y).selfMultiply(E.valueOf(t.x).selfSubtract(n.x)),f=h.subtract(g),m=f.selfDivide(s).doubleValue(),y=E.valueOf(n.y).selfAdd(E.valueOf(r.y).selfSubtract(n.y).selfMultiply(m)).doubleValue();return new d(p,y)};he.orientationIndexFilter=function(t,e,n){var r=null,i=(t.x-n.x)*(e.y-n.y),o=(t.y-n.y)*(e.x-n.x),s=i-o;if(i>0){if(o<=0)return he.signum(s);r=i+o}else if(i<0){if(o>=0)return he.signum(s);r=-i-o}else return he.signum(s);var a=he.DP_SAFE_EPSILON*r;return s>=a||-s>=a?he.signum(s):2};he.signum=function(t){return t>0?1:t<0?-1:0};Tu.DP_SAFE_EPSILON.get=function(){return 1e-15};Object.defineProperties(he,Tu);var Z=function(){},_o={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};_o.X.get=function(){return 0};_o.Y.get=function(){return 1};_o.Z.get=function(){return 2};_o.M.get=function(){return 3};Z.prototype.setOrdinate=function(t,e,n){};Z.prototype.size=function(){};Z.prototype.getOrdinate=function(t,e){};Z.prototype.getCoordinate=function(){};Z.prototype.getCoordinateCopy=function(t){};Z.prototype.getDimension=function(){};Z.prototype.getX=function(t){};Z.prototype.clone=function(){};Z.prototype.expandEnvelope=function(t){};Z.prototype.copy=function(){};Z.prototype.getY=function(t){};Z.prototype.toCoordinateArray=function(){};Z.prototype.interfaces_=function(){return[es]};Z.prototype.getClass=function(){return Z};Object.defineProperties(Z,_o);var Ru=function(){},zi=function(t){function e(){t.call(this,"Projective point not representable on the Cartesian plane.")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ru),$t=function(){};$t.arraycopy=function(t,e,n,r,i){for(var o=0,s=e;s<e+i;s++)n[r+o]=t[s],o++};$t.getProperty=function(t){return{"line.separator":`
|
|
23
|
-
`}[t]};var $e=function t(){if(this.x=null,this.y=null,this.w=null,arguments.length===0)this.x=0,this.y=0,this.w=1;else if(arguments.length===1){var e=arguments[0];this.x=e.x,this.y=e.y,this.w=1}else if(arguments.length===2){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var n=arguments[0],r=arguments[1];this.x=n,this.y=r,this.w=1}else if(arguments[0]instanceof t&&arguments[1]instanceof t){var i=arguments[0],o=arguments[1];this.x=i.y*o.w-o.y*i.w,this.y=o.x*i.w-i.x*o.w,this.w=i.x*o.y-o.x*i.y}else if(arguments[0]instanceof d&&arguments[1]instanceof d){var s=arguments[0],a=arguments[1];this.x=s.y-a.y,this.y=a.x-s.x,this.w=s.x*a.y-a.x*s.y}}else if(arguments.length===3){var u=arguments[0],l=arguments[1],c=arguments[2];this.x=u,this.y=l,this.w=c}else if(arguments.length===4){var p=arguments[0],h=arguments[1],g=arguments[2],f=arguments[3],m=p.y-h.y,y=h.x-p.x,v=p.x*h.y-h.x*p.y,x=g.y-f.y,I=f.x-g.x,C=g.x*f.y-f.x*g.y;this.x=y*C-I*v,this.y=x*v-m*C,this.w=m*I-x*y}};$e.prototype.getY=function(){var t=this.y/this.w;if(U.isNaN(t)||U.isInfinite(t))throw new zi;return t};$e.prototype.getX=function(){var t=this.x/this.w;if(U.isNaN(t)||U.isInfinite(t))throw new zi;return t};$e.prototype.getCoordinate=function(){var t=new d;return t.x=this.getX(),t.y=this.getY(),t};$e.prototype.interfaces_=function(){return[]};$e.prototype.getClass=function(){return $e};$e.intersection=function(t,e,n,r){var i=t.y-e.y,o=e.x-t.x,s=t.x*e.y-e.x*t.y,a=n.y-r.y,u=r.x-n.x,l=n.x*r.y-r.x*n.y,c=o*l-u*s,p=a*s-i*l,h=i*u-a*o,g=c/h,f=p/h;if(U.isNaN(g)||U.isInfinite(g)||U.isNaN(f)||U.isInfinite(f))throw new zi;return new d(g,f)};var F=function t(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,arguments.length===0)this.init();else if(arguments.length===1){if(arguments[0]instanceof d){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof t){var n=arguments[0];this.init(n)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.init(r.x,i.x,r.y,i.y)}else if(arguments.length===4){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3];this.init(o,s,a,u)}},Ou={serialVersionUID:{configurable:!0}};F.prototype.getArea=function(){return this.getWidth()*this.getHeight()};F.prototype.equals=function(t){if(!(t instanceof F))return!1;var e=t;return this.isNull()?e.isNull():this._maxx===e.getMaxX()&&this._maxy===e.getMaxY()&&this._minx===e.getMinX()&&this._miny===e.getMinY()};F.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new F;var e=this._minx>t._minx?this._minx:t._minx,n=this._miny>t._miny?this._miny:t._miny,r=this._maxx<t._maxx?this._maxx:t._maxx,i=this._maxy<t._maxy?this._maxy:t._maxy;return new F(e,r,n,i)};F.prototype.isNull=function(){return this._maxx<this._minx};F.prototype.getMaxX=function(){return this._maxx};F.prototype.covers=function(){if(arguments.length===1){if(arguments[0]instanceof d){var t=arguments[0];return this.covers(t.x,t.y)}else if(arguments[0]instanceof F){var e=arguments[0];return this.isNull()||e.isNull()?!1:e.getMinX()>=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy}}else if(arguments.length===2){var n=arguments[0],r=arguments[1];return this.isNull()?!1:n>=this._minx&&n<=this._maxx&&r>=this._miny&&r<=this._maxy}};F.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof F){var t=arguments[0];return this.isNull()||t.isNull()?!1:!(t._minx>this._maxx||t._maxx<this._minx||t._miny>this._maxy||t._maxy<this._miny)}else if(arguments[0]instanceof d){var e=arguments[0];return this.intersects(e.x,e.y)}}else if(arguments.length===2){var n=arguments[0],r=arguments[1];return this.isNull()?!1:!(n>this._maxx||n<this._minx||r>this._maxy||r<this._miny)}};F.prototype.getMinY=function(){return this._miny};F.prototype.getMinX=function(){return this._minx};F.prototype.expandToInclude=function(){if(arguments.length===1){if(arguments[0]instanceof d){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof F){var e=arguments[0];if(e.isNull())return null;this.isNull()?(this._minx=e.getMinX(),this._maxx=e.getMaxX(),this._miny=e.getMinY(),this._maxy=e.getMaxY()):(e._minx<this._minx&&(this._minx=e._minx),e._maxx>this._maxx&&(this._maxx=e._maxx),e._miny<this._miny&&(this._miny=e._miny),e._maxy>this._maxy&&(this._maxy=e._maxy))}}else if(arguments.length===2){var n=arguments[0],r=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=r,this._maxy=r):(n<this._minx&&(this._minx=n),n>this._maxx&&(this._maxx=n),r<this._miny&&(this._miny=r),r>this._maxy&&(this._maxy=r))}};F.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e};F.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx};F.prototype.compareTo=function(t){var e=t;return this.isNull()?e.isNull()?0:-1:e.isNull()?1:this._minx<e._minx?-1:this._minx>e._minx?1:this._miny<e._miny?-1:this._miny>e._miny?1:this._maxx<e._maxx?-1:this._maxx>e._maxx?1:this._maxy<e._maxy?-1:this._maxy>e._maxy?1:0};F.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)};F.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"};F.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1};F.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny};F.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e};F.prototype.expandBy=function(){if(arguments.length===1){var t=arguments[0];this.expandBy(t,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=n,this._maxy+=n,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}};F.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof F){var t=arguments[0];return this.covers(t)}else if(arguments[0]instanceof d){var e=arguments[0];return this.covers(e)}}else if(arguments.length===2){var n=arguments[0],r=arguments[1];return this.covers(n,r)}};F.prototype.centre=function(){return this.isNull()?null:new d((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)};F.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof d){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof F){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(arguments.length===2){var n=arguments[0],r=arguments[1];this.init(n.x,r.x,n.y,r.y)}else if(arguments.length===4){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];i<o?(this._minx=i,this._maxx=o):(this._minx=o,this._maxx=i),s<a?(this._miny=s,this._maxy=a):(this._miny=a,this._maxy=s)}};F.prototype.getMaxY=function(){return this._maxy};F.prototype.distance=function(t){if(this.intersects(t))return 0;var e=0;this._maxx<t._minx?e=t._minx-this._maxx:this._minx>t._maxx&&(e=this._minx-t._maxx);var n=0;return this._maxy<t._miny?n=t._miny-this._maxy:this._miny>t._maxy&&(n=this._miny-t._maxy),e===0?n:n===0?e:Math.sqrt(e*e+n*n)};F.prototype.hashCode=function(){var t=17;return t=37*t+d.hashCode(this._minx),t=37*t+d.hashCode(this._maxx),t=37*t+d.hashCode(this._miny),t=37*t+d.hashCode(this._maxy),t};F.prototype.interfaces_=function(){return[Be,ze]};F.prototype.getClass=function(){return F};F.intersects=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],n=arguments[2];return n.x>=(t.x<e.x?t.x:e.x)&&n.x<=(t.x>e.x?t.x:e.x)&&n.y>=(t.y<e.y?t.y:e.y)&&n.y<=(t.y>e.y?t.y:e.y)}else if(arguments.length===4){var r=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3],a=Math.min(o.x,s.x),u=Math.max(o.x,s.x),l=Math.min(r.x,i.x),c=Math.max(r.x,i.x);return!(l>u||c<a||(a=Math.min(o.y,s.y),u=Math.max(o.y,s.y),l=Math.min(r.y,i.y),c=Math.max(r.y,i.y),l>u)||c<a)}};Ou.serialVersionUID.get=function(){return 5873921885273102e3};Object.defineProperties(F,Ou);var rn={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,emptyTypeStr:/^\s*(\w+)\s*EMPTY\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/},ns=function(t){this.geometryFactory=t||new j};ns.prototype.read=function(t){var e,n,r;t=t.replace(/[\n\r]/g," ");var i=rn.typeStr.exec(t);if(t.search("EMPTY")!==-1&&(i=rn.emptyTypeStr.exec(t),i[2]=void 0),i&&(n=i[1].toLowerCase(),r=i[2],_i[n]&&(e=_i[n].apply(this,[r]))),e===void 0)throw new Error("Could not parse WKT "+t);return e};ns.prototype.write=function(t){return this.extractGeometry(t)};ns.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!Xn[e])return null;var n=e.toUpperCase(),r;return t.isEmpty()?r=n+" EMPTY":r=n+"("+Xn[e].apply(this,[t])+")",r};var Xn={coordinate:function(t){return t.x+" "+t.y},point:function(t){return Xn.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=this,n=[],r=0,i=t._geometries.length;r<i;++r)n.push("("+Xn.point.apply(e,[t._geometries[r]])+")");return n.join(",")},linestring:function(t){for(var e=this,n=[],r=0,i=t._points._coordinates.length;r<i;++r)n.push(Xn.coordinate.apply(e,[t._points._coordinates[r]]));return n.join(",")},linearring:function(t){for(var e=this,n=[],r=0,i=t._points._coordinates.length;r<i;++r)n.push(Xn.coordinate.apply(e,[t._points._coordinates[r]]));return n.join(",")},multilinestring:function(t){for(var e=this,n=[],r=0,i=t._geometries.length;r<i;++r)n.push("("+Xn.linestring.apply(e,[t._geometries[r]])+")");return n.join(",")},polygon:function(t){var e=this,n=[];n.push("("+Xn.linestring.apply(this,[t._shell])+")");for(var r=0,i=t._holes.length;r<i;++r)n.push("("+Xn.linestring.apply(e,[t._holes[r]])+")");return n.join(",")},multipolygon:function(t){for(var e=this,n=[],r=0,i=t._geometries.length;r<i;++r)n.push("("+Xn.polygon.apply(e,[t._geometries[r]])+")");return n.join(",")},geometrycollection:function(t){for(var e=this,n=[],r=0,i=t._geometries.length;r<i;++r)n.push(e.extractGeometry(t._geometries[r]));return n.join(",")}},_i={point:function(t){if(t===void 0)return this.geometryFactory.createPoint();var e=t.trim().split(rn.spaces);return this.geometryFactory.createPoint(new d(Number.parseFloat(e[0]),Number.parseFloat(e[1])))},multipoint:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiPoint();for(var n,r=t.trim().split(","),i=[],o=0,s=r.length;o<s;++o)n=r[o].replace(rn.trimParens,"$1"),i.push(_i.point.apply(e,[n]));return this.geometryFactory.createMultiPoint(i)},linestring:function(t){if(t===void 0)return this.geometryFactory.createLineString();for(var e=t.trim().split(","),n=[],r,i=0,o=e.length;i<o;++i)r=e[i].trim().split(rn.spaces),n.push(new d(Number.parseFloat(r[0]),Number.parseFloat(r[1])));return this.geometryFactory.createLineString(n)},linearring:function(t){if(t===void 0)return this.geometryFactory.createLinearRing();for(var e=t.trim().split(","),n=[],r,i=0,o=e.length;i<o;++i)r=e[i].trim().split(rn.spaces),n.push(new d(Number.parseFloat(r[0]),Number.parseFloat(r[1])));return this.geometryFactory.createLinearRing(n)},multilinestring:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiLineString();for(var n,r=t.trim().split(rn.parenComma),i=[],o=0,s=r.length;o<s;++o)n=r[o].replace(rn.trimParens,"$1"),i.push(_i.linestring.apply(e,[n]));return this.geometryFactory.createMultiLineString(i)},polygon:function(t){var e=this;if(t===void 0)return this.geometryFactory.createPolygon();for(var n,r,i,o=t.trim().split(rn.parenComma),s,a=[],u=0,l=o.length;u<l;++u)n=o[u].replace(rn.trimParens,"$1"),r=_i.linestring.apply(e,[n]),i=e.geometryFactory.createLinearRing(r._points),u===0?s=i:a.push(i);return this.geometryFactory.createPolygon(s,a)},multipolygon:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiPolygon();for(var n,r=t.trim().split(rn.doubleParenComma),i=[],o=0,s=r.length;o<s;++o)n=r[o].replace(rn.trimParens,"$1"),i.push(_i.polygon.apply(e,[n]));return this.geometryFactory.createMultiPolygon(i)},geometrycollection:function(t){var e=this;if(t===void 0)return this.geometryFactory.createGeometryCollection();t=t.replace(/,\s*([A-Za-z])/g,"|$1");for(var n=t.trim().split("|"),r=[],i=0,o=n.length;i<o;++i)r.push(e.read(n[i]));return this.geometryFactory.createGeometryCollection(r)}},je=function(t){this.parser=new ns(t)};je.prototype.write=function(t){return this.parser.write(t)};je.toLineString=function(t,e){if(arguments.length!==2)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"};var Kn=function(t){function e(n){t.call(this,n),this.name="RuntimeException",this.message=n,this.stack=new t().stack}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),$o=function(t){function e(){if(t.call(this),arguments.length===0)t.call(this);else if(arguments.length===1){var n=arguments[0];t.call(this,n)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Kn),$=function(){};$.prototype.interfaces_=function(){return[]};$.prototype.getClass=function(){return $};$.shouldNeverReachHere=function(){if(arguments.length===0)$.shouldNeverReachHere(null);else if(arguments.length===1){var t=arguments[0];throw new $o("Should never reach here"+(t!==null?": "+t:""))}};$.isTrue=function(){var t,e;if(arguments.length===1)t=arguments[0],$.isTrue(t,null);else if(arguments.length===2&&(t=arguments[0],e=arguments[1],!t))throw e===null?new $o:new $o(e)};$.equals=function(){var t,e,n;if(arguments.length===2)t=arguments[0],e=arguments[1],$.equals(t,e,null);else if(arguments.length===3&&(t=arguments[0],e=arguments[1],n=arguments[2],!e.equals(t)))throw new $o("Expected "+t+" but encountered "+e+(n!==null?": "+n:""))};var gt=function(){this._result=null,this._inputLines=Array(2).fill().map(function(){return Array(2)}),this._intPt=new Array(2).fill(null),this._intLineIndex=null,this._isProper=null,this._pa=null,this._pb=null,this._precisionModel=null,this._intPt[0]=new d,this._intPt[1]=new d,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},ui={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};gt.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]};gt.prototype.getTopologySummary=function(){var t=new In;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()};gt.prototype.computeIntersection=function(t,e,n,r){this._inputLines[0][0]=t,this._inputLines[0][1]=e,this._inputLines[1][0]=n,this._inputLines[1][1]=r,this._result=this.computeIntersect(t,e,n,r)};gt.prototype.getIntersectionNum=function(){return this._result};gt.prototype.computeIntLineIndex=function(){if(arguments.length===0)this._intLineIndex===null&&(this._intLineIndex=Array(2).fill().map(function(){return Array(2)}),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(arguments.length===1){var t=arguments[0],e=this.getEdgeDistance(t,0),n=this.getEdgeDistance(t,1);e>n?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}};gt.prototype.isProper=function(){return this.hasIntersection()&&this._isProper};gt.prototype.setPrecisionModel=function(t){this._precisionModel=t};gt.prototype.isInteriorIntersection=function(){var t=this;if(arguments.length===0)return!!(this.isInteriorIntersection(0)||this.isInteriorIntersection(1));if(arguments.length===1){for(var e=arguments[0],n=0;n<this._result;n++)if(!(t._intPt[n].equals2D(t._inputLines[e][0])||t._intPt[n].equals2D(t._inputLines[e][1])))return!0;return!1}};gt.prototype.getIntersection=function(t){return this._intPt[t]};gt.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper};gt.prototype.hasIntersection=function(){return this._result!==gt.NO_INTERSECTION};gt.prototype.getEdgeDistance=function(t,e){var n=gt.computeEdgeDistance(this._intPt[e],this._inputLines[t][0],this._inputLines[t][1]);return n};gt.prototype.isCollinear=function(){return this._result===gt.COLLINEAR_INTERSECTION};gt.prototype.toString=function(){return je.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+je.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()};gt.prototype.getEndpoint=function(t,e){return this._inputLines[t][e]};gt.prototype.isIntersection=function(t){for(var e=this,n=0;n<this._result;n++)if(e._intPt[n].equals2D(t))return!0;return!1};gt.prototype.getIntersectionAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]};gt.prototype.interfaces_=function(){return[]};gt.prototype.getClass=function(){return gt};gt.computeEdgeDistance=function(t,e,n){var r=Math.abs(n.x-e.x),i=Math.abs(n.y-e.y),o=-1;if(t.equals(e))o=0;else if(t.equals(n))r>i?o=r:o=i;else{var s=Math.abs(t.x-e.x),a=Math.abs(t.y-e.y);r>i?o=s:o=a,o===0&&!t.equals(e)&&(o=Math.max(s,a))}return $.isTrue(!(o===0&&!t.equals(e)),"Bad distance calculation"),o};gt.nonRobustComputeEdgeDistance=function(t,e,n){var r=t.x-e.x,i=t.y-e.y,o=Math.sqrt(r*r+i*i);return $.isTrue(!(o===0&&!t.equals(e)),"Invalid distance calculation"),o};ui.DONT_INTERSECT.get=function(){return 0};ui.DO_INTERSECT.get=function(){return 1};ui.COLLINEAR.get=function(){return 2};ui.NO_INTERSECTION.get=function(){return 0};ui.POINT_INTERSECTION.get=function(){return 1};ui.COLLINEAR_INTERSECTION.get=function(){return 2};Object.defineProperties(gt,ui);var Xr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isInSegmentEnvelopes=function(n){var r=new F(this._inputLines[0][0],this._inputLines[0][1]),i=new F(this._inputLines[1][0],this._inputLines[1][1]);return r.contains(n)&&i.contains(n)},e.prototype.computeIntersection=function(){if(arguments.length===3){var n=arguments[0],r=arguments[1],i=arguments[2];if(this._isProper=!1,F.intersects(r,i,n)&&M.orientationIndex(r,i,n)===0&&M.orientationIndex(i,r,n)===0)return this._isProper=!0,(n.equals(r)||n.equals(i))&&(this._isProper=!1),this._result=t.POINT_INTERSECTION,null;this._result=t.NO_INTERSECTION}else return t.prototype.computeIntersection.apply(this,arguments)},e.prototype.normalizeToMinimum=function(n,r,i,o,s){s.x=this.smallestInAbsValue(n.x,r.x,i.x,o.x),s.y=this.smallestInAbsValue(n.y,r.y,i.y,o.y),n.x-=s.x,n.y-=s.y,r.x-=s.x,r.y-=s.y,i.x-=s.x,i.y-=s.y,o.x-=s.x,o.y-=s.y},e.prototype.safeHCoordinateIntersection=function(n,r,i,o){var s=null;try{s=$e.intersection(n,r,i,o)}catch(a){if(a instanceof zi)s=e.nearestEndpoint(n,r,i,o);else throw a}finally{}return s},e.prototype.intersection=function(n,r,i,o){var s=this.intersectionWithNormalization(n,r,i,o);return this.isInSegmentEnvelopes(s)||(s=new d(e.nearestEndpoint(n,r,i,o))),this._precisionModel!==null&&this._precisionModel.makePrecise(s),s},e.prototype.smallestInAbsValue=function(n,r,i,o){var s=n,a=Math.abs(s);return Math.abs(r)<a&&(s=r,a=Math.abs(r)),Math.abs(i)<a&&(s=i,a=Math.abs(i)),Math.abs(o)<a&&(s=o),s},e.prototype.checkDD=function(n,r,i,o,s){var a=he.intersection(n,r,i,o),u=this.isInSegmentEnvelopes(a);$t.out.println("DD in env = "+u+" --------------------- "+a),s.distance(a)>1e-4&&$t.out.println("Distance = "+s.distance(a))},e.prototype.intersectionWithNormalization=function(n,r,i,o){var s=new d(n),a=new d(r),u=new d(i),l=new d(o),c=new d;this.normalizeToEnvCentre(s,a,u,l,c);var p=this.safeHCoordinateIntersection(s,a,u,l);return p.x+=c.x,p.y+=c.y,p},e.prototype.computeCollinearIntersection=function(n,r,i,o){var s=F.intersects(n,r,i),a=F.intersects(n,r,o),u=F.intersects(i,o,n),l=F.intersects(i,o,r);return s&&a?(this._intPt[0]=i,this._intPt[1]=o,t.COLLINEAR_INTERSECTION):u&&l?(this._intPt[0]=n,this._intPt[1]=r,t.COLLINEAR_INTERSECTION):s&&u?(this._intPt[0]=i,this._intPt[1]=n,i.equals(n)&&!a&&!l?t.POINT_INTERSECTION:t.COLLINEAR_INTERSECTION):s&&l?(this._intPt[0]=i,this._intPt[1]=r,i.equals(r)&&!a&&!u?t.POINT_INTERSECTION:t.COLLINEAR_INTERSECTION):a&&u?(this._intPt[0]=o,this._intPt[1]=n,o.equals(n)&&!s&&!l?t.POINT_INTERSECTION:t.COLLINEAR_INTERSECTION):a&&l?(this._intPt[0]=o,this._intPt[1]=r,o.equals(r)&&!s&&!u?t.POINT_INTERSECTION:t.COLLINEAR_INTERSECTION):t.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(n,r,i,o,s){var a=n.x<r.x?n.x:r.x,u=n.y<r.y?n.y:r.y,l=n.x>r.x?n.x:r.x,c=n.y>r.y?n.y:r.y,p=i.x<o.x?i.x:o.x,h=i.y<o.y?i.y:o.y,g=i.x>o.x?i.x:o.x,f=i.y>o.y?i.y:o.y,m=a>p?a:p,y=l<g?l:g,v=u>h?u:h,x=c<f?c:f,I=(m+y)/2,C=(v+x)/2;s.x=I,s.y=C,n.x-=s.x,n.y-=s.y,r.x-=s.x,r.y-=s.y,i.x-=s.x,i.y-=s.y,o.x-=s.x,o.y-=s.y},e.prototype.computeIntersect=function(n,r,i,o){if(this._isProper=!1,!F.intersects(n,r,i,o))return t.NO_INTERSECTION;var s=M.orientationIndex(n,r,i),a=M.orientationIndex(n,r,o);if(s>0&&a>0||s<0&&a<0)return t.NO_INTERSECTION;var u=M.orientationIndex(i,o,n),l=M.orientationIndex(i,o,r);if(u>0&&l>0||u<0&&l<0)return t.NO_INTERSECTION;var c=s===0&&a===0&&u===0&&l===0;return c?this.computeCollinearIntersection(n,r,i,o):(s===0||a===0||u===0||l===0?(this._isProper=!1,n.equals2D(i)||n.equals2D(o)?this._intPt[0]=n:r.equals2D(i)||r.equals2D(o)?this._intPt[0]=r:s===0?this._intPt[0]=new d(i):a===0?this._intPt[0]=new d(o):u===0?this._intPt[0]=new d(n):l===0&&(this._intPt[0]=new d(r))):(this._isProper=!0,this._intPt[0]=this.intersection(n,r,i,o)),t.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(n,r,i,o){var s=n,a=M.distancePointLine(n,i,o),u=M.distancePointLine(r,i,o);return u<a&&(a=u,s=r),u=M.distancePointLine(i,n,r),u<a&&(a=u,s=i),u=M.distancePointLine(o,n,r),u<a&&(a=u,s=o),s},e}(gt),Hr=function(){};Hr.prototype.interfaces_=function(){return[]};Hr.prototype.getClass=function(){return Hr};Hr.orientationIndex=function(t,e,n){var r=e.x-t.x,i=e.y-t.y,o=n.x-e.x,s=n.y-e.y;return Hr.signOfDet2x2(r,i,o,s)};Hr.signOfDet2x2=function(t,e,n,r){var i=null,o=null,s=null;if(i=1,t===0||r===0)return e===0||n===0?0:e>0?n>0?-i:i:n>0?i:-i;if(e===0||n===0)return r>0?t>0?i:-i:t>0?-i:i;if(e>0?r>0?e<=r||(i=-i,o=t,t=n,n=o,o=e,e=r,r=o):e<=-r?(i=-i,n=-n,r=-r):(o=t,t=-n,n=o,o=e,e=-r,r=o):r>0?-e<=r?(i=-i,t=-t,e=-e):(o=-t,t=n,n=o,o=-e,e=r,r=o):e>=r?(t=-t,e=-e,n=-n,r=-r):(i=-i,o=-t,t=-n,n=o,o=-e,e=-r,r=o),t>0)if(n>0){if(!(t<=n))return i}else return i;else{if(n>0)return-i;if(t>=n)i=-i,t=-t,n=-n;else return-i}for(;;){if(s=Math.floor(n/t),n=n-s*t,r=r-s*e,r<0)return-i;if(r>e)return i;if(t>n+n){if(e<r+r)return i}else{if(e>r+r)return-i;n=t-n,r=e-r,i=-i}if(r===0)return n===0?0:-i;if(n===0||(s=Math.floor(t/n),t=t-s*n,e=e-s*r,e<0))return i;if(e>r)return-i;if(n>t+t){if(r<e+e)return-i}else{if(r>e+e)return i;t=n-t,e=r-e,i=-i}if(e===0)return t===0?0:i;if(t===0)return-i}};var ln=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};ln.prototype.countSegment=function(t,e){if(t.x<this._p.x&&e.x<this._p.x)return null;if(this._p.x===e.x&&this._p.y===e.y)return this._isPointOnSegment=!0,null;if(t.y===this._p.y&&e.y===this._p.y){var n=t.x,r=e.x;return n>r&&(n=e.x,r=t.x),this._p.x>=n&&this._p.x<=r&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var i=t.x-this._p.x,o=t.y-this._p.y,s=e.x-this._p.x,a=e.y-this._p.y,u=Hr.signOfDet2x2(i,o,s,a);if(u===0)return this._isPointOnSegment=!0,null;a<o&&(u=-u),u>0&&this._crossingCount++}};ln.prototype.isPointInPolygon=function(){return this.getLocation()!==_.EXTERIOR};ln.prototype.getLocation=function(){return this._isPointOnSegment?_.BOUNDARY:this._crossingCount%2===1?_.INTERIOR:_.EXTERIOR};ln.prototype.isOnSegment=function(){return this._isPointOnSegment};ln.prototype.interfaces_=function(){return[]};ln.prototype.getClass=function(){return ln};ln.locatePointInRing=function(){if(arguments[0]instanceof d&&z(arguments[1],Z)){for(var t=arguments[0],e=arguments[1],n=new ln(t),r=new d,i=new d,o=1;o<e.size();o++)if(e.getCoordinate(o,r),e.getCoordinate(o-1,i),n.countSegment(r,i),n.isOnSegment())return n.getLocation();return n.getLocation()}else if(arguments[0]instanceof d&&arguments[1]instanceof Array){for(var s=arguments[0],a=arguments[1],u=new ln(s),l=1;l<a.length;l++){var c=a[l],p=a[l-1];if(u.countSegment(c,p),u.isOnSegment())return u.getLocation()}return u.getLocation()}};var M=function(){},li={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};M.prototype.interfaces_=function(){return[]};M.prototype.getClass=function(){return M};M.orientationIndex=function(t,e,n){return he.orientationIndex(t,e,n)};M.signedArea=function(){if(arguments[0]instanceof Array){var t=arguments[0];if(t.length<3)return 0;for(var e=0,n=t[0].x,r=1;r<t.length-1;r++){var i=t[r].x-n,o=t[r+1].y,s=t[r-1].y;e+=i*(s-o)}return e/2}else if(z(arguments[0],Z)){var a=arguments[0],u=a.size();if(u<3)return 0;var l=new d,c=new d,p=new d;a.getCoordinate(0,c),a.getCoordinate(1,p);var h=c.x;p.x-=h;for(var g=0,f=1;f<u-1;f++)l.y=c.y,c.x=p.x,c.y=p.y,a.getCoordinate(f+1,p),p.x-=h,g+=c.x*(l.y-p.y);return g/2}};M.distanceLineLine=function(t,e,n,r){if(t.equals(e))return M.distancePointLine(t,n,r);if(n.equals(r))return M.distancePointLine(r,t,e);var i=!1;if(!F.intersects(t,e,n,r))i=!0;else{var o=(e.x-t.x)*(r.y-n.y)-(e.y-t.y)*(r.x-n.x);if(o===0)i=!0;else{var s=(t.y-n.y)*(r.x-n.x)-(t.x-n.x)*(r.y-n.y),a=(t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y),u=a/o,l=s/o;(l<0||l>1||u<0||u>1)&&(i=!0)}}return i?we.min(M.distancePointLine(t,n,r),M.distancePointLine(e,n,r),M.distancePointLine(n,t,e),M.distancePointLine(r,t,e)):0};M.isPointInRing=function(t,e){return M.locatePointInRing(t,e)!==_.EXTERIOR};M.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,r=new d;t.getCoordinate(0,r);for(var i=r.x,o=r.y,s=1;s<e;s++){t.getCoordinate(s,r);var a=r.x,u=r.y,l=a-i,c=u-o;n+=Math.sqrt(l*l+c*c),i=a,o=u}return n};M.isCCW=function(t){var e=t.length-1;if(e<3)throw new ft("Ring has fewer than 4 points, so orientation cannot be determined");for(var n=t[0],r=0,i=1;i<=e;i++){var o=t[i];o.y>n.y&&(n=o,r=i)}var s=r;do s=s-1,s<0&&(s=e);while(t[s].equals2D(n)&&s!==r);var a=r;do a=(a+1)%e;while(t[a].equals2D(n)&&a!==r);var u=t[s],l=t[a];if(u.equals2D(n)||l.equals2D(n)||u.equals2D(l))return!1;var c=M.computeOrientation(u,n,l),p=!1;return c===0?p=u.x>l.x:p=c>0,p};M.locatePointInRing=function(t,e){return ln.locatePointInRing(t,e)};M.distancePointLinePerpendicular=function(t,e,n){var r=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),i=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/r;return Math.abs(i)*Math.sqrt(r)};M.computeOrientation=function(t,e,n){return M.orientationIndex(t,e,n)};M.distancePointLine=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];if(e.length===0)throw new ft("Line array must contain at least one vertex");for(var n=t.distance(e[0]),r=0;r<e.length-1;r++){var i=M.distancePointLine(t,e[r],e[r+1]);i<n&&(n=i)}return n}else if(arguments.length===3){var o=arguments[0],s=arguments[1],a=arguments[2];if(s.x===a.x&&s.y===a.y)return o.distance(s);var u=(a.x-s.x)*(a.x-s.x)+(a.y-s.y)*(a.y-s.y),l=((o.x-s.x)*(a.x-s.x)+(o.y-s.y)*(a.y-s.y))/u;if(l<=0)return o.distance(s);if(l>=1)return o.distance(a);var c=((s.y-o.y)*(a.x-s.x)-(s.x-o.x)*(a.y-s.y))/u;return Math.abs(c)*Math.sqrt(u)}};M.isOnLine=function(t,e){for(var n=new Xr,r=1;r<e.length;r++){var i=e[r-1],o=e[r];if(n.computeIntersection(t,i,o),n.hasIntersection())return!0}return!1};li.CLOCKWISE.get=function(){return-1};li.RIGHT.get=function(){return M.CLOCKWISE};li.COUNTERCLOCKWISE.get=function(){return 1};li.LEFT.get=function(){return M.COUNTERCLOCKWISE};li.COLLINEAR.get=function(){return 0};li.STRAIGHT.get=function(){return M.COLLINEAR};Object.defineProperties(M,li);var Jn=function(){};Jn.prototype.filter=function(t){};Jn.prototype.interfaces_=function(){return[]};Jn.prototype.getClass=function(){return Jn};var B=function(){var t=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=t,this._SRID=t.getSRID()},qn={serialVersionUID:{configurable:!0},SORTINDEX_POINT:{configurable:!0},SORTINDEX_MULTIPOINT:{configurable:!0},SORTINDEX_LINESTRING:{configurable:!0},SORTINDEX_LINEARRING:{configurable:!0},SORTINDEX_MULTILINESTRING:{configurable:!0},SORTINDEX_POLYGON:{configurable:!0},SORTINDEX_MULTIPOLYGON:{configurable:!0},SORTINDEX_GEOMETRYCOLLECTION:{configurable:!0},geometryChangedFilter:{configurable:!0}};B.prototype.isGeometryCollection=function(){return this.getSortIndex()===B.SORTINDEX_GEOMETRYCOLLECTION};B.prototype.getFactory=function(){return this._factory};B.prototype.getGeometryN=function(t){return this};B.prototype.getArea=function(){return 0};B.prototype.isRectangle=function(){return!1};B.prototype.equals=function(){if(arguments[0]instanceof B){var t=arguments[0];return t===null?!1:this.equalsTopo(t)}else if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof B))return!1;var n=e;return this.equalsExact(n)}};B.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)};B.prototype.geometryChanged=function(){this.apply(B.geometryChangedFilter)};B.prototype.geometryChangedAction=function(){this._envelope=null};B.prototype.equalsNorm=function(t){return t===null?!1:this.norm().equalsExact(t.norm())};B.prototype.getLength=function(){return 0};B.prototype.getNumGeometries=function(){return 1};B.prototype.compareTo=function(){if(arguments.length===1){var t=arguments[0],e=t;return this.getSortIndex()!==e.getSortIndex()?this.getSortIndex()-e.getSortIndex():this.isEmpty()&&e.isEmpty()?0:this.isEmpty()?-1:e.isEmpty()?1:this.compareToSameClass(t)}else if(arguments.length===2){var n=arguments[0],r=arguments[1];return this.getSortIndex()!==n.getSortIndex()?this.getSortIndex()-n.getSortIndex():this.isEmpty()&&n.isEmpty()?0:this.isEmpty()?-1:n.isEmpty()?1:this.compareToSameClass(n,r)}};B.prototype.getUserData=function(){return this._userData};B.prototype.getSRID=function(){return this._SRID};B.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())};B.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===B.SORTINDEX_GEOMETRYCOLLECTION)throw new ft("This method does not support GeometryCollection arguments")};B.prototype.equal=function(t,e,n){return n===0?t.equals(e):t.distance(e)<=n};B.prototype.norm=function(){var t=this.copy();return t.normalize(),t};B.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()};B.prototype.getEnvelopeInternal=function(){return this._envelope===null&&(this._envelope=this.computeEnvelopeInternal()),new F(this._envelope)};B.prototype.setSRID=function(t){this._SRID=t};B.prototype.setUserData=function(t){this._userData=t};B.prototype.compare=function(t,e){for(var n=t.iterator(),r=e.iterator();n.hasNext()&&r.hasNext();){var i=n.next(),o=r.next(),s=i.compareTo(o);if(s!==0)return s}return n.hasNext()?1:r.hasNext()?-1:0};B.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()};B.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===B.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===B.SORTINDEX_MULTIPOINT||this.getSortIndex()===B.SORTINDEX_MULTILINESTRING||this.getSortIndex()===B.SORTINDEX_MULTIPOLYGON};B.prototype.interfaces_=function(){return[es,Be,ze]};B.prototype.getClass=function(){return B};B.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1};B.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(t[e]===null)return!0;return!1};qn.serialVersionUID.get=function(){return 8763622679187377e3};qn.SORTINDEX_POINT.get=function(){return 0};qn.SORTINDEX_MULTIPOINT.get=function(){return 1};qn.SORTINDEX_LINESTRING.get=function(){return 2};qn.SORTINDEX_LINEARRING.get=function(){return 3};qn.SORTINDEX_MULTILINESTRING.get=function(){return 4};qn.SORTINDEX_POLYGON.get=function(){return 5};qn.SORTINDEX_MULTIPOLYGON.get=function(){return 6};qn.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7};qn.geometryChangedFilter.get=function(){return js};Object.defineProperties(B,qn);var js=function(){};js.interfaces_=function(){return[Jn]};js.filter=function(t){t.geometryChangedAction()};var Rn=function(){};Rn.prototype.filter=function(t){};Rn.prototype.interfaces_=function(){return[]};Rn.prototype.getClass=function(){return Rn};var Ge=function(){},rr={Mod2BoundaryNodeRule:{configurable:!0},EndPointBoundaryNodeRule:{configurable:!0},MultiValentEndPointBoundaryNodeRule:{configurable:!0},MonoValentEndPointBoundaryNodeRule:{configurable:!0},MOD2_BOUNDARY_RULE:{configurable:!0},ENDPOINT_BOUNDARY_RULE:{configurable:!0},MULTIVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},MONOVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},OGC_SFS_BOUNDARY_RULE:{configurable:!0}};Ge.prototype.isInBoundary=function(t){};Ge.prototype.interfaces_=function(){return[]};Ge.prototype.getClass=function(){return Ge};rr.Mod2BoundaryNodeRule.get=function(){return Ii};rr.EndPointBoundaryNodeRule.get=function(){return Ni};rr.MultiValentEndPointBoundaryNodeRule.get=function(){return bi};rr.MonoValentEndPointBoundaryNodeRule.get=function(){return Ci};rr.MOD2_BOUNDARY_RULE.get=function(){return new Ii};rr.ENDPOINT_BOUNDARY_RULE.get=function(){return new Ni};rr.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new bi};rr.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new Ci};rr.OGC_SFS_BOUNDARY_RULE.get=function(){return Ge.MOD2_BOUNDARY_RULE};Object.defineProperties(Ge,rr);var Ii=function(){};Ii.prototype.isInBoundary=function(t){return t%2===1};Ii.prototype.interfaces_=function(){return[Ge]};Ii.prototype.getClass=function(){return Ii};var Ni=function(){};Ni.prototype.isInBoundary=function(t){return t>0};Ni.prototype.interfaces_=function(){return[Ge]};Ni.prototype.getClass=function(){return Ni};var bi=function(){};bi.prototype.isInBoundary=function(t){return t>1};bi.prototype.interfaces_=function(){return[Ge]};bi.prototype.getClass=function(){return bi};var Ci=function(){};Ci.prototype.isInBoundary=function(t){return t===1};Ci.prototype.interfaces_=function(){return[Ge]};Ci.prototype.getClass=function(){return Ci};var Pt=function(){};Pt.prototype.add=function(){};Pt.prototype.addAll=function(){};Pt.prototype.isEmpty=function(){};Pt.prototype.iterator=function(){};Pt.prototype.size=function(){};Pt.prototype.toArray=function(){};Pt.prototype.remove=function(){};function Ys(t){this.message=t||""}Ys.prototype=new Error;Ys.prototype.name="IndexOutOfBoundsException";var Ui=function(){};Ui.prototype.hasNext=function(){};Ui.prototype.next=function(){};Ui.prototype.remove=function(){};var Xe=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(){},e.prototype.set=function(){},e.prototype.isEmpty=function(){},e}(Pt);function Vi(t){this.message=t||""}Vi.prototype=new Error;Vi.prototype.name="NoSuchElementException";var O=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof Pt&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.ensureCapacity=function(){},e.prototype.interfaces_=function(){return[t,Pt]},e.prototype.add=function(n){return arguments.length===1?this.array_.push(n):this.array_.splice(arguments[0],arguments[1]),!0},e.prototype.clear=function(){this.array_=[]},e.prototype.addAll=function(n){for(var r=this,i=n.iterator();i.hasNext();)r.add(i.next());return!0},e.prototype.set=function(n,r){var i=this.array_[n];return this.array_[n]=r,i},e.prototype.iterator=function(){return new xp(this)},e.prototype.get=function(n){if(n<0||n>=this.size())throw new Ys;return this.array_[n]},e.prototype.isEmpty=function(){return this.array_.length===0},e.prototype.size=function(){return this.array_.length},e.prototype.toArray=function(){for(var n=this,r=[],i=0,o=this.array_.length;i<o;i++)r.push(n.array_[i]);return r},e.prototype.remove=function(n){for(var r=this,i=!1,o=0,s=this.array_.length;o<s;o++)if(r.array_[o]===n){r.array_.splice(o,1),i=!0;break}return i},e}(Xe),xp=function(t){function e(n){t.call(this),this.arrayList_=n,this.position_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new Vi;return this.arrayList_.get(this.position_++)},e.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},e.prototype.set=function(n){return this.arrayList_.set(this.position_-1,n)},e.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},e}(Ui),vo=function(t){function e(){if(t.call(this),arguments.length!==0){if(arguments.length===1){var r=arguments[0];this.ensureCapacity(r.length),this.add(r,!0)}else if(arguments.length===2){var i=arguments[0],o=arguments[1];this.ensureCapacity(i.length),this.add(i,o)}}}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={coordArrayType:{configurable:!0}};return n.coordArrayType.get=function(){return new Array(0).fill(null)},e.prototype.getCoordinate=function(r){return this.get(r)},e.prototype.addAll=function(){var r=this;if(arguments.length===2){for(var i=arguments[0],o=arguments[1],s=!1,a=i.iterator();a.hasNext();)r.add(a.next(),o),s=!0;return s}else return t.prototype.addAll.apply(this,arguments)},e.prototype.clone=function(){for(var r=this,i=t.prototype.clone.call(this),o=0;o<this.size();o++)i.add(o,r.get(o).copy());return i},e.prototype.toCoordinateArray=function(){return this.toArray(e.coordArrayType)},e.prototype.add=function(){var r=this;if(arguments.length===1){var i=arguments[0];t.prototype.add.call(this,i)}else if(arguments.length===2){if(arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var o=arguments[0],s=arguments[1];return this.add(o,s,!0),!0}else if(arguments[0]instanceof d&&typeof arguments[1]=="boolean"){var a=arguments[0],u=arguments[1];if(!u&&this.size()>=1){var l=this.get(this.size()-1);if(l.equals2D(a))return null}t.prototype.add.call(this,a)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var c=arguments[0],p=arguments[1];return this.add(c,p),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var h=arguments[0],g=arguments[1],f=arguments[2];if(f)for(var m=0;m<h.length;m++)r.add(h[m],g);else for(var y=h.length-1;y>=0;y--)r.add(h[y],g);return!0}else if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof d){var v=arguments[0],x=arguments[1],I=arguments[2];if(!I){var C=this.size();if(C>0){if(v>0){var P=this.get(v-1);if(P.equals2D(x))return null}if(v<C){var D=this.get(v);if(D.equals2D(x))return null}}}t.prototype.add.call(this,v,x)}}else if(arguments.length===4){var S=arguments[0],T=arguments[1],w=arguments[2],A=arguments[3],X=1;w>A&&(X=-1);for(var k=w;k!==A;k+=X)r.add(S[k],T);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new d(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,n),e}(O),Y=function(){},rs={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};rs.ForwardComparator.get=function(){return ro};rs.BidirectionalComparator.get=function(){return Li};rs.coordArrayType.get=function(){return new Array(0).fill(null)};Y.prototype.interfaces_=function(){return[]};Y.prototype.getClass=function(){return Y};Y.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))};Y.ptNotInList=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(Y.indexOf(r,e)<0)return r}return null};Y.scroll=function(t,e){var n=Y.indexOf(e,t);if(n<0)return null;var r=new Array(t.length).fill(null);$t.arraycopy(t,n,r,0,t.length-n),$t.arraycopy(t,0,r,t.length-n,n),$t.arraycopy(r,0,t,0,t.length)};Y.equals=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];if(t===e)return!0;if(t===null||e===null||t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].equals(e[n]))return!1;return!0}else if(arguments.length===3){var r=arguments[0],i=arguments[1],o=arguments[2];if(r===i)return!0;if(r===null||i===null||r.length!==i.length)return!1;for(var s=0;s<r.length;s++)if(o.compare(r[s],i[s])!==0)return!1;return!0}};Y.intersection=function(t,e){for(var n=new vo,r=0;r<t.length;r++)e.intersects(t[r])&&n.add(t[r],!0);return n.toCoordinateArray()};Y.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1};Y.removeRepeatedPoints=function(t){if(!Y.hasRepeatedPoints(t))return t;var e=new vo(t,!1);return e.toCoordinateArray()};Y.reverse=function(t){for(var e=t.length-1,n=Math.trunc(e/2),r=0;r<=n;r++){var i=t[r];t[r]=t[e-r],t[e-r]=i}};Y.removeNull=function(t){for(var e=0,n=0;n<t.length;n++)t[n]!==null&&e++;var r=new Array(e).fill(null);if(e===0)return r;for(var i=0,o=0;o<t.length;o++)t[o]!==null&&(r[i++]=t[o]);return r};Y.copyDeep=function(){if(arguments.length===1){for(var t=arguments[0],e=new Array(t.length).fill(null),n=0;n<t.length;n++)e[n]=new d(t[n]);return e}else if(arguments.length===5)for(var r=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4],u=0;u<a;u++)o[s+u]=new d(r[i+u])};Y.isEqualReversed=function(t,e){for(var n=0;n<t.length;n++){var r=t[n],i=e[t.length-n-1];if(r.compareTo(i)!==0)return!1}return!0};Y.envelope=function(t){for(var e=new F,n=0;n<t.length;n++)e.expandToInclude(t[n]);return e};Y.toCoordinateArray=function(t){return t.toArray(Y.coordArrayType)};Y.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]};Y.indexOf=function(t,e){for(var n=0;n<e.length;n++)if(t.equals(e[n]))return n;return-1};Y.increasingDirection=function(t){for(var e=0;e<Math.trunc(t.length/2);e++){var n=t.length-1-e,r=t[e].compareTo(t[n]);if(r!==0)return r}return 1};Y.compare=function(t,e){for(var n=0;n<t.length&&n<e.length;){var r=t[n].compareTo(e[n]);if(r!==0)return r;n++}return n<e.length?-1:n<t.length?1:0};Y.minCoordinate=function(t){for(var e=null,n=0;n<t.length;n++)(e===null||e.compareTo(t[n])>0)&&(e=t[n]);return e};Y.extract=function(t,e,n){e=we.clamp(e,0,t.length),n=we.clamp(n,-1,t.length);var r=n-e+1;n<0&&(r=0),e>=t.length&&(r=0),n<e&&(r=0);var i=new Array(r).fill(null);if(r===0)return i;for(var o=0,s=e;s<=n;s++)i[o++]=t[s];return i};Object.defineProperties(Y,rs);var ro=function(){};ro.prototype.compare=function(t,e){var n=t,r=e;return Y.compare(n,r)};ro.prototype.interfaces_=function(){return[Ei]};ro.prototype.getClass=function(){return ro};var Li=function(){};Li.prototype.compare=function(t,e){var n=t,r=e;if(n.length<r.length)return-1;if(n.length>r.length)return 1;if(n.length===0)return 0;var i=Y.compare(n,r),o=Y.isEqualReversed(n,r);return o?0:i};Li.prototype.OLDcompare=function(t,e){var n=t,r=e;if(n.length<r.length)return-1;if(n.length>r.length)return 1;if(n.length===0)return 0;for(var i=Y.increasingDirection(n),o=Y.increasingDirection(r),s=i>0?0:n.length-1,a=o>0?0:n.length-1,u=0;u<n.length;u++){var l=n[s].compareTo(r[a]);if(l!==0)return l;s+=i,a+=o}return 0};Li.prototype.interfaces_=function(){return[Ei]};Li.prototype.getClass=function(){return Li};var ci=function(){};ci.prototype.get=function(){};ci.prototype.put=function(){};ci.prototype.size=function(){};ci.prototype.values=function(){};ci.prototype.entrySet=function(){};var Ip=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(ci);function Eo(t){this.message=t||""}Eo.prototype=new Error;Eo.prototype.name="OperationNotSupported";function is(){}is.prototype=new Pt;is.prototype.contains=function(){};var Ws=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof Pt&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contains=function(n){for(var r=this,i=0,o=this.array_.length;i<o;i++){var s=r.array_[i];if(s===n)return!0}return!1},e.prototype.add=function(n){return this.contains(n)?!1:(this.array_.push(n),!0)},e.prototype.addAll=function(n){for(var r=this,i=n.iterator();i.hasNext();)r.add(i.next());return!0},e.prototype.remove=function(n){throw new Error},e.prototype.size=function(){return this.array_.length},e.prototype.isEmpty=function(){return this.array_.length===0},e.prototype.toArray=function(){for(var n=this,r=[],i=0,o=this.array_.length;i<o;i++)r.push(n.array_[i]);return r},e.prototype.iterator=function(){return new Np(this)},e}(is),Np=function(t){function e(n){t.call(this),this.hashSet_=n,this.position_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new Vi;return this.hashSet_.array_[this.position_++]},e.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},e.prototype.remove=function(){throw new Eo},e}(Ui),Wn=0,br=1;function Va(t){return t===null?Wn:t.color}function at(t){return t===null?null:t.parent}function $n(t,e){t!==null&&(t.color=e)}function bs(t){return t===null?null:t.left}function $a(t){return t===null?null:t.right}function Jt(){this.root_=null,this.size_=0}Jt.prototype=new Ip;Jt.prototype.get=function(t){for(var e=this.root_;e!==null;){var n=t.compareTo(e.key);if(n<0)e=e.left;else if(n>0)e=e.right;else return e.value}return null};Jt.prototype.put=function(t,e){if(this.root_===null)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:Wn,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var n=this.root_,r,i;do if(r=n,i=t.compareTo(n.key),i<0)n=n.left;else if(i>0)n=n.right;else{var o=n.value;return n.value=e,o}while(n!==null);var s={key:t,left:null,right:null,value:e,parent:r,color:Wn,getValue:function(){return this.value},getKey:function(){return this.key}};return i<0?r.left=s:r.right=s,this.fixAfterInsertion(s),this.size_++,null};Jt.prototype.fixAfterInsertion=function(t){var e=this;for(t.color=br;t!=null&&t!==this.root_&&t.parent.color===br;)if(at(t)===bs(at(at(t)))){var n=$a(at(at(t)));Va(n)===br?($n(at(t),Wn),$n(n,Wn),$n(at(at(t)),br),t=at(at(t))):(t===$a(at(t))&&(t=at(t),e.rotateLeft(t)),$n(at(t),Wn),$n(at(at(t)),br),e.rotateRight(at(at(t))))}else{var r=bs(at(at(t)));Va(r)===br?($n(at(t),Wn),$n(r,Wn),$n(at(at(t)),br),t=at(at(t))):(t===bs(at(t))&&(t=at(t),e.rotateRight(t)),$n(at(t),Wn),$n(at(at(t)),br),e.rotateLeft(at(at(t))))}this.root_.color=Wn};Jt.prototype.values=function(){var t=new O,e=this.getFirstEntry();if(e!==null)for(t.add(e.value);(e=Jt.successor(e))!==null;)t.add(e.value);return t};Jt.prototype.entrySet=function(){var t=new Ws,e=this.getFirstEntry();if(e!==null)for(t.add(e);(e=Jt.successor(e))!==null;)t.add(e);return t};Jt.prototype.rotateLeft=function(t){if(t!=null){var e=t.right;t.right=e.left,e.left!=null&&(e.left.parent=t),e.parent=t.parent,t.parent===null?this.root_=e:t.parent.left===t?t.parent.left=e:t.parent.right=e,e.left=t,t.parent=e}};Jt.prototype.rotateRight=function(t){if(t!=null){var e=t.left;t.left=e.right,e.right!=null&&(e.right.parent=t),e.parent=t.parent,t.parent===null?this.root_=e:t.parent.right===t?t.parent.right=e:t.parent.left=e,e.right=t,t.parent=e}};Jt.prototype.getFirstEntry=function(){var t=this.root_;if(t!=null)for(;t.left!=null;)t=t.left;return t};Jt.successor=function(t){if(t===null)return null;if(t.right!==null){for(var e=t.right;e.left!==null;)e=e.left;return e}else{for(var n=t.parent,r=t;n!==null&&r===n.right;)r=n,n=n.parent;return n}};Jt.prototype.size=function(){return this.size_};var io=function(){};io.prototype.interfaces_=function(){return[]};io.prototype.getClass=function(){return io};function Pu(){}Pu.prototype=new is;function hn(){this.array_=[],arguments[0]instanceof Pt&&this.addAll(arguments[0])}hn.prototype=new Pu;hn.prototype.contains=function(t){for(var e=this,n=0,r=this.array_.length;n<r;n++){var i=e.array_[n];if(i.compareTo(t)===0)return!0}return!1};hn.prototype.add=function(t){var e=this;if(this.contains(t))return!1;for(var n=0,r=this.array_.length;n<r;n++){var i=e.array_[n];if(i.compareTo(t)===1)return e.array_.splice(n,0,t),!0}return this.array_.push(t),!0};hn.prototype.addAll=function(t){for(var e=this,n=t.iterator();n.hasNext();)e.add(n.next());return!0};hn.prototype.remove=function(t){throw new Eo};hn.prototype.size=function(){return this.array_.length};hn.prototype.isEmpty=function(){return this.array_.length===0};hn.prototype.toArray=function(){for(var t=this,e=[],n=0,r=this.array_.length;n<r;n++)e.push(t.array_[n]);return e};hn.prototype.iterator=function(){return new os(this)};var os=function(t){this.treeSet_=t,this.position_=0};os.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new Vi;return this.treeSet_.array_[this.position_++]};os.prototype.hasNext=function(){return this.position_<this.treeSet_.size()};os.prototype.remove=function(){throw new Eo};var wr=function(){};wr.sort=function(){var t=arguments[0],e,n,r,i;if(arguments.length===1)i=function(s,a){return s.compareTo(a)},t.sort(i);else if(arguments.length===2)r=arguments[1],i=function(s,a){return r.compare(s,a)},t.sort(i);else if(arguments.length===3){n=t.slice(arguments[1],arguments[2]),n.sort();var o=t.slice(0,arguments[1]).concat(n,t.slice(arguments[2],t.length));for(t.splice(0,t.length),e=0;e<o.length;e++)t.push(o[e])}else if(arguments.length===4)for(n=t.slice(arguments[1],arguments[2]),r=arguments[3],i=function(s,a){return r.compare(s,a)},n.sort(i),o=t.slice(0,arguments[1]).concat(n,t.slice(arguments[2],t.length)),t.splice(0,t.length),e=0;e<o.length;e++)t.push(o[e])};wr.asList=function(t){for(var e=new O,n=0,r=t.length;n<r;n++)e.add(t[n]);return e};var K=function(){},tn={P:{configurable:!0},L:{configurable:!0},A:{configurable:!0},FALSE:{configurable:!0},TRUE:{configurable:!0},DONTCARE:{configurable:!0},SYM_FALSE:{configurable:!0},SYM_TRUE:{configurable:!0},SYM_DONTCARE:{configurable:!0},SYM_P:{configurable:!0},SYM_L:{configurable:!0},SYM_A:{configurable:!0}};tn.P.get=function(){return 0};tn.L.get=function(){return 1};tn.A.get=function(){return 2};tn.FALSE.get=function(){return-1};tn.TRUE.get=function(){return-2};tn.DONTCARE.get=function(){return-3};tn.SYM_FALSE.get=function(){return"F"};tn.SYM_TRUE.get=function(){return"T"};tn.SYM_DONTCARE.get=function(){return"*"};tn.SYM_P.get=function(){return"0"};tn.SYM_L.get=function(){return"1"};tn.SYM_A.get=function(){return"2"};K.prototype.interfaces_=function(){return[]};K.prototype.getClass=function(){return K};K.toDimensionSymbol=function(t){switch(t){case K.FALSE:return K.SYM_FALSE;case K.TRUE:return K.SYM_TRUE;case K.DONTCARE:return K.SYM_DONTCARE;case K.P:return K.SYM_P;case K.L:return K.SYM_L;case K.A:return K.SYM_A}throw new ft("Unknown dimension value: "+t)};K.toDimensionValue=function(t){switch(no.toUpperCase(t)){case K.SYM_FALSE:return K.FALSE;case K.SYM_TRUE:return K.TRUE;case K.SYM_DONTCARE:return K.DONTCARE;case K.SYM_P:return K.P;case K.SYM_L:return K.L;case K.SYM_A:return K.A}throw new ft("Unknown dimension symbol: "+t)};Object.defineProperties(K,tn);var fn=function(){};fn.prototype.filter=function(t){};fn.prototype.interfaces_=function(){return[]};fn.prototype.getClass=function(){return fn};var Ye=function(){};Ye.prototype.filter=function(t,e){};Ye.prototype.isDone=function(){};Ye.prototype.isGeometryChanged=function(){};Ye.prototype.interfaces_=function(){return[]};Ye.prototype.getClass=function(){return Ye};var ae=function(t){function e(r,i){if(t.call(this,i),this._geometries=r||[],t.hasNullElements(this._geometries))throw new ft("geometries must not contain null elements")}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){for(var r=this,i=new F,o=0;o<this._geometries.length;o++)i.expandToInclude(r._geometries[o].getEnvelopeInternal());return i},e.prototype.getGeometryN=function(r){return this._geometries[r]},e.prototype.getSortIndex=function(){return t.SORTINDEX_GEOMETRYCOLLECTION},e.prototype.getCoordinates=function(){for(var r=this,i=new Array(this.getNumPoints()).fill(null),o=-1,s=0;s<this._geometries.length;s++)for(var a=r._geometries[s].getCoordinates(),u=0;u<a.length;u++)o++,i[o]=a[u];return i},e.prototype.getArea=function(){for(var r=this,i=0,o=0;o<this._geometries.length;o++)i+=r._geometries[o].getArea();return i},e.prototype.equalsExact=function(){var r=this;if(arguments.length===2){var i=arguments[0],o=arguments[1];if(!this.isEquivalentClass(i))return!1;var s=i;if(this._geometries.length!==s._geometries.length)return!1;for(var a=0;a<this._geometries.length;a++)if(!r._geometries[a].equalsExact(s._geometries[a],o))return!1;return!0}else return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var r=this,i=0;i<this._geometries.length;i++)r._geometries[i].normalize();wr.sort(this._geometries)},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},e.prototype.getBoundaryDimension=function(){for(var r=this,i=K.FALSE,o=0;o<this._geometries.length;o++)i=Math.max(i,r._geometries[o].getBoundaryDimension());return i},e.prototype.getDimension=function(){for(var r=this,i=K.FALSE,o=0;o<this._geometries.length;o++)i=Math.max(i,r._geometries[o].getDimension());return i},e.prototype.getLength=function(){for(var r=this,i=0,o=0;o<this._geometries.length;o++)i+=r._geometries[o].getLength();return i},e.prototype.getNumPoints=function(){for(var r=this,i=0,o=0;o<this._geometries.length;o++)i+=r._geometries[o].getNumPoints();return i},e.prototype.getNumGeometries=function(){return this._geometries.length},e.prototype.reverse=function(){for(var r=this,i=this._geometries.length,o=new Array(i).fill(null),s=0;s<this._geometries.length;s++)o[s]=r._geometries[s].reverse();return this.getFactory().createGeometryCollection(o)},e.prototype.compareToSameClass=function(){var r=this;if(arguments.length===1){var i=arguments[0],o=new hn(wr.asList(this._geometries)),s=new hn(wr.asList(i._geometries));return this.compare(o,s)}else if(arguments.length===2){for(var a=arguments[0],u=arguments[1],l=a,c=this.getNumGeometries(),p=l.getNumGeometries(),h=0;h<c&&h<p;){var g=r.getGeometryN(h),f=l.getGeometryN(h),m=g.compareToSameClass(f,u);if(m!==0)return m;h++}return h<c?1:h<p?-1:0}},e.prototype.apply=function(){var r=this;if(z(arguments[0],Rn))for(var i=arguments[0],o=0;o<this._geometries.length;o++)r._geometries[o].apply(i);else if(z(arguments[0],Ye)){var s=arguments[0];if(this._geometries.length===0)return null;for(var a=0;a<this._geometries.length&&(r._geometries[a].apply(s),!s.isDone());a++);s.isGeometryChanged()&&this.geometryChanged()}else if(z(arguments[0],fn)){var u=arguments[0];u.filter(this);for(var l=0;l<this._geometries.length;l++)r._geometries[l].apply(u)}else if(z(arguments[0],Jn)){var c=arguments[0];c.filter(this);for(var p=0;p<this._geometries.length;p++)r._geometries[p].apply(c)}},e.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),$.shouldNeverReachHere(),null},e.prototype.clone=function(){var r=this,i=t.prototype.clone.call(this);i._geometries=new Array(this._geometries.length).fill(null);for(var o=0;o<this._geometries.length;o++)i._geometries[o]=r._geometries[o].clone();return i},e.prototype.getGeometryType=function(){return"GeometryCollection"},e.prototype.copy=function(){for(var r=this,i=new Array(this._geometries.length).fill(null),o=0;o<i.length;o++)i[o]=r._geometries[o].copy();return new e(i,this._factory)},e.prototype.isEmpty=function(){for(var r=this,i=0;i<this._geometries.length;i++)if(!r._geometries[i].isEmpty())return!1;return!0},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-5694727726395021e3},Object.defineProperties(e,n),e}(B),Mr=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return B.SORTINDEX_MULTILINESTRING},e.prototype.equalsExact=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.isEquivalentClass(r)?t.prototype.equalsExact.call(this,r,i):!1}else return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?K.FALSE:0},e.prototype.isClosed=function(){var r=this;if(this.isEmpty())return!1;for(var i=0;i<this._geometries.length;i++)if(!r._geometries[i].isClosed())return!1;return!0},e.prototype.getDimension=function(){return 1},e.prototype.reverse=function(){for(var r=this,i=this._geometries.length,o=new Array(i).fill(null),s=0;s<this._geometries.length;s++)o[i-1-s]=r._geometries[s].reverse();return this.getFactory().createMultiLineString(o)},e.prototype.getBoundary=function(){return new De(this).getBoundary()},e.prototype.getGeometryType=function(){return"MultiLineString"},e.prototype.copy=function(){for(var r=this,i=new Array(this._geometries.length).fill(null),o=0;o<i.length;o++)i[o]=r._geometries[o].copy();return new e(i,this._factory)},e.prototype.interfaces_=function(){return[io]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 8166665132445434e3},Object.defineProperties(e,n),e}(ae),De=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,arguments.length===1){var t=arguments[0],e=Ge.MOD2_BOUNDARY_RULE;this._geom=t,this._geomFact=t.getFactory(),this._bnRule=e}else if(arguments.length===2){var n=arguments[0],r=arguments[1];this._geom=n,this._geomFact=n.getFactory(),this._bnRule=r}};De.prototype.boundaryMultiLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var e=this.computeBoundaryCoordinates(t);return e.length===1?this._geomFact.createPoint(e[0]):this._geomFact.createMultiPointFromCoords(e)};De.prototype.getBoundary=function(){return this._geom instanceof _t?this.boundaryLineString(this._geom):this._geom instanceof Mr?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()};De.prototype.boundaryLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();if(t.isClosed()){var e=this._bnRule.isInBoundary(2);return e?t.getStartPoint():this._geomFact.createMultiPoint()}return this._geomFact.createMultiPoint([t.getStartPoint(),t.getEndPoint()])};De.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()};De.prototype.computeBoundaryCoordinates=function(t){var e=this,n=new O;this._endpointMap=new Jt;for(var r=0;r<t.getNumGeometries();r++){var i=t.getGeometryN(r);i.getNumPoints()!==0&&(e.addEndpoint(i.getCoordinateN(0)),e.addEndpoint(i.getCoordinateN(i.getNumPoints()-1)))}for(var o=this._endpointMap.entrySet().iterator();o.hasNext();){var s=o.next(),a=s.getValue(),u=a.count;e._bnRule.isInBoundary(u)&&n.add(s.getKey())}return Y.toCoordinateArray(n)};De.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);e===null&&(e=new Xo,this._endpointMap.put(t,e)),e.count++};De.prototype.interfaces_=function(){return[]};De.prototype.getClass=function(){return De};De.getBoundary=function(){if(arguments.length===1){var t=arguments[0],e=new De(t);return e.getBoundary()}else if(arguments.length===2){var n=arguments[0],r=arguments[1],i=new De(n,r);return i.getBoundary()}};var Xo=function(){this.count=null};Xo.prototype.interfaces_=function(){return[]};Xo.prototype.getClass=function(){return Xo};function bp(){}function Cp(){}var Lp=function(){};function Sp(){}function wp(){}function Tp(){}var Ae=function(){},Hs={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};Ae.prototype.interfaces_=function(){return[]};Ae.prototype.getClass=function(){return Ae};Ae.chars=function(t,e){for(var n=new Array(e).fill(null),r=0;r<e;r++)n[r]=t;return String(n)};Ae.getStackTrace=function(){if(arguments.length===1){var t=arguments[0],e=new Sp,n=new bp;return t.printStackTrace(n),e.toString()}else if(arguments.length===2){var r=arguments[0],i=arguments[1],o="";new Cp(Ae.getStackTrace(r));for(var s=new Tp,a=0;a<i;a++)try{o+=s.readLine()+Ae.NEWLINE}catch(u){if(u instanceof wp)$.shouldNeverReachHere();else throw u}finally{}return o}};Ae.split=function(t,e){for(var n=e.length,r=new O,i=""+t,o=i.indexOf(e);o>=0;){var s=i.substring(0,o);r.add(s),i=i.substring(o+n),o=i.indexOf(e)}i.length>0&&r.add(i);for(var a=new Array(r.size()).fill(null),u=0;u<a.length;u++)a[u]=r.get(u);return a};Ae.toString=function(){if(arguments.length===1){var t=arguments[0];return Ae.SIMPLE_ORDINATE_FORMAT.format(t)}};Ae.spaces=function(t){return Ae.chars(" ",t)};Hs.NEWLINE.get=function(){return $t.getProperty("line.separator")};Hs.SIMPLE_ORDINATE_FORMAT.get=function(){return new Lp};Object.defineProperties(Ae,Hs);var bt=function(){};bt.prototype.interfaces_=function(){return[]};bt.prototype.getClass=function(){return bt};bt.copyCoord=function(t,e,n,r){for(var i=Math.min(t.getDimension(),n.getDimension()),o=0;o<i;o++)n.setOrdinate(r,o,t.getOrdinate(e,o))};bt.isRing=function(t){var e=t.size();return e===0?!0:e<=3?!1:t.getOrdinate(0,Z.X)===t.getOrdinate(e-1,Z.X)&&t.getOrdinate(0,Z.Y)===t.getOrdinate(e-1,Z.Y)};bt.isEqual=function(t,e){var n=t.size(),r=e.size();if(n!==r)return!1;for(var i=Math.min(t.getDimension(),e.getDimension()),o=0;o<n;o++)for(var s=0;s<i;s++){var a=t.getOrdinate(o,s),u=e.getOrdinate(o,s);if(t.getOrdinate(o,s)!==e.getOrdinate(o,s)&&!(U.isNaN(a)&&U.isNaN(u)))return!1}return!0};bt.extend=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();if(bt.copy(e,0,r,0,i),i>0)for(var o=i;o<n;o++)bt.copy(e,i-1,r,o,1);return r};bt.reverse=function(t){for(var e=t.size()-1,n=Math.trunc(e/2),r=0;r<=n;r++)bt.swap(t,r,e-r)};bt.swap=function(t,e,n){if(e===n)return null;for(var r=0;r<t.getDimension();r++){var i=t.getOrdinate(e,r);t.setOrdinate(e,r,t.getOrdinate(n,r)),t.setOrdinate(n,r,i)}};bt.copy=function(t,e,n,r,i){for(var o=0;o<i;o++)bt.copyCoord(t,e+o,n,r+o)};bt.toString=function(){if(arguments.length===1){var t=arguments[0],e=t.size();if(e===0)return"()";var n=t.getDimension(),r=new In;r.append("(");for(var i=0;i<e;i++){i>0&&r.append(" ");for(var o=0;o<n;o++)o>0&&r.append(","),r.append(Ae.toString(t.getOrdinate(i,o)))}return r.append(")"),r.toString()}};bt.ensureValidRing=function(t,e){var n=e.size();if(n===0)return e;if(n<=3)return bt.createClosedRing(t,e,4);var r=e.getOrdinate(0,Z.X)===e.getOrdinate(n-1,Z.X)&&e.getOrdinate(0,Z.Y)===e.getOrdinate(n-1,Z.Y);return r?e:bt.createClosedRing(t,e,n+1)};bt.createClosedRing=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();bt.copy(e,0,r,0,i);for(var o=i;o<n;o++)bt.copy(e,0,r,o,1);return r};var _t=function(t){function e(r,i){t.call(this,i),this._points=null,this.init(r)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new F:this._points.expandEnvelope(new F)},e.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},e.prototype.getSortIndex=function(){return t.SORTINDEX_LINESTRING},e.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},e.prototype.equalsExact=function(){var r=this;if(arguments.length===2){var i=arguments[0],o=arguments[1];if(!this.isEquivalentClass(i))return!1;var s=i;if(this._points.size()!==s._points.size())return!1;for(var a=0;a<this._points.size();a++)if(!r.equal(r._points.getCoordinate(a),s._points.getCoordinate(a),o))return!1;return!0}else return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var r=this,i=0;i<Math.trunc(this._points.size()/2);i++){var o=r._points.size()-1-i;if(!r._points.getCoordinate(i).equals(r._points.getCoordinate(o)))return r._points.getCoordinate(i).compareTo(r._points.getCoordinate(o))>0&&bt.reverse(r._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?K.FALSE:0},e.prototype.isClosed=function(){return this.isEmpty()?!1:this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},e.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},e.prototype.getDimension=function(){return 1},e.prototype.getLength=function(){return M.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var r=this._points.copy();bt.reverse(r);var i=this.getFactory().createLineString(r);return i},e.prototype.compareToSameClass=function(){var r=this;if(arguments.length===1){for(var i=arguments[0],o=i,s=0,a=0;s<this._points.size()&&a<o._points.size();){var u=r._points.getCoordinate(s).compareTo(o._points.getCoordinate(a));if(u!==0)return u;s++,a++}return s<this._points.size()?1:a<o._points.size()?-1:0}else if(arguments.length===2){var l=arguments[0],c=arguments[1],p=l;return c.compare(this._points,p._points)}},e.prototype.apply=function(){var r=this;if(z(arguments[0],Rn))for(var i=arguments[0],o=0;o<this._points.size();o++)i.filter(r._points.getCoordinate(o));else if(z(arguments[0],Ye)){var s=arguments[0];if(this._points.size()===0)return null;for(var a=0;a<this._points.size()&&(s.filter(r._points,a),!s.isDone());a++);s.isGeometryChanged()&&this.geometryChanged()}else if(z(arguments[0],fn)){var u=arguments[0];u.filter(this)}else if(z(arguments[0],Jn)){var l=arguments[0];l.filter(this)}},e.prototype.getBoundary=function(){return new De(this).getBoundary()},e.prototype.isEquivalentClass=function(r){return r instanceof e},e.prototype.clone=function(){var r=t.prototype.clone.call(this);return r._points=this._points.clone(),r},e.prototype.getCoordinateN=function(r){return this._points.getCoordinate(r)},e.prototype.getGeometryType=function(){return"LineString"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._points},e.prototype.isEmpty=function(){return this._points.size()===0},e.prototype.init=function(r){if(r===null&&(r=this.getFactory().getCoordinateSequenceFactory().create([])),r.size()===1)throw new ft("Invalid number of points in LineString (found "+r.size()+" - must be 0 or >= 2)");this._points=r},e.prototype.isCoordinate=function(r){for(var i=this,o=0;o<this._points.size();o++)if(i._points.getCoordinate(o).equals(r))return!0;return!1},e.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},e.prototype.getPointN=function(r){return this.getFactory().createPoint(this._points.getCoordinate(r))},e.prototype.interfaces_=function(){return[io]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(e,n),e}(B),oo=function(){};oo.prototype.interfaces_=function(){return[]};oo.prototype.getClass=function(){return oo};var _e=function(t){function e(r,i){t.call(this,i),this._coordinates=r||null,this.init(this._coordinates)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new F;var r=new F;return r.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),r},e.prototype.getSortIndex=function(){return t.SORTINDEX_POINT},e.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},e.prototype.equalsExact=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.isEquivalentClass(r)?this.isEmpty()&&r.isEmpty()?!0:this.isEmpty()!==r.isEmpty()?!1:this.equal(r.getCoordinate(),this.getCoordinate(),i):!1}else return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){},e.prototype.getCoordinate=function(){return this._coordinates.size()!==0?this._coordinates.getCoordinate(0):null},e.prototype.getBoundaryDimension=function(){return K.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getNumPoints=function(){return this.isEmpty()?0:1},e.prototype.reverse=function(){return this.copy()},e.prototype.getX=function(){if(this.getCoordinate()===null)throw new Error("getX called on empty Point");return this.getCoordinate().x},e.prototype.compareToSameClass=function(){if(arguments.length===1){var r=arguments[0],i=r;return this.getCoordinate().compareTo(i.getCoordinate())}else if(arguments.length===2){var o=arguments[0],s=arguments[1],a=o;return s.compare(this._coordinates,a._coordinates)}},e.prototype.apply=function(){if(z(arguments[0],Rn)){var r=arguments[0];if(this.isEmpty())return null;r.filter(this.getCoordinate())}else if(z(arguments[0],Ye)){var i=arguments[0];if(this.isEmpty())return null;i.filter(this._coordinates,0),i.isGeometryChanged()&&this.geometryChanged()}else if(z(arguments[0],fn)){var o=arguments[0];o.filter(this)}else if(z(arguments[0],Jn)){var s=arguments[0];s.filter(this)}},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.clone=function(){var r=t.prototype.clone.call(this);return r._coordinates=this._coordinates.clone(),r},e.prototype.getGeometryType=function(){return"Point"},e.prototype.copy=function(){return new e(this._coordinates.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._coordinates},e.prototype.getY=function(){if(this.getCoordinate()===null)throw new Error("getY called on empty Point");return this.getCoordinate().y},e.prototype.isEmpty=function(){return this._coordinates.size()===0},e.prototype.init=function(r){r===null&&(r=this.getFactory().getCoordinateSequenceFactory().create([])),$.isTrue(r.size()<=1),this._coordinates=r},e.prototype.isSimple=function(){return!0},e.prototype.interfaces_=function(){return[oo]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 4902022702746615e3},Object.defineProperties(e,n),e}(B),hr=function(){};hr.prototype.interfaces_=function(){return[]};hr.prototype.getClass=function(){return hr};var Ft=function(t){function e(r,i,o){if(t.call(this,o),this._shell=null,this._holes=null,r===null&&(r=this.getFactory().createLinearRing()),i===null&&(i=[]),t.hasNullElements(i))throw new ft("holes must not contain null elements");if(r.isEmpty()&&t.hasNonEmptyElements(i))throw new ft("shell is empty but holes are not");this._shell=r,this._holes=i}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},e.prototype.getSortIndex=function(){return t.SORTINDEX_POLYGON},e.prototype.getCoordinates=function(){var r=this;if(this.isEmpty())return[];for(var i=new Array(this.getNumPoints()).fill(null),o=-1,s=this._shell.getCoordinates(),a=0;a<s.length;a++)o++,i[o]=s[a];for(var u=0;u<this._holes.length;u++)for(var l=r._holes[u].getCoordinates(),c=0;c<l.length;c++)o++,i[o]=l[c];return i},e.prototype.getArea=function(){var r=this,i=0;i+=Math.abs(M.signedArea(this._shell.getCoordinateSequence()));for(var o=0;o<this._holes.length;o++)i-=Math.abs(M.signedArea(r._holes[o].getCoordinateSequence()));return i},e.prototype.isRectangle=function(){if(this.getNumInteriorRing()!==0||this._shell===null||this._shell.getNumPoints()!==5)return!1;for(var r=this._shell.getCoordinateSequence(),i=this.getEnvelopeInternal(),o=0;o<5;o++){var s=r.getX(o);if(!(s===i.getMinX()||s===i.getMaxX()))return!1;var a=r.getY(o);if(!(a===i.getMinY()||a===i.getMaxY()))return!1}for(var u=r.getX(0),l=r.getY(0),c=1;c<=4;c++){var p=r.getX(c),h=r.getY(c),g=p!==u,f=h!==l;if(g===f)return!1;u=p,l=h}return!0},e.prototype.equalsExact=function(){var r=this;if(arguments.length===2){var i=arguments[0],o=arguments[1];if(!this.isEquivalentClass(i))return!1;var s=i,a=this._shell,u=s._shell;if(!a.equalsExact(u,o)||this._holes.length!==s._holes.length)return!1;for(var l=0;l<this._holes.length;l++)if(!r._holes[l].equalsExact(s._holes[l],o))return!1;return!0}else return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){var r=this;if(arguments.length===0){this.normalize(this._shell,!0);for(var i=0;i<this._holes.length;i++)r.normalize(r._holes[i],!1);wr.sort(this._holes)}else if(arguments.length===2){var o=arguments[0],s=arguments[1];if(o.isEmpty())return null;var a=new Array(o.getCoordinates().length-1).fill(null);$t.arraycopy(o.getCoordinates(),0,a,0,a.length);var u=Y.minCoordinate(o.getCoordinates());Y.scroll(a,u),$t.arraycopy(a,0,o.getCoordinates(),0,a.length),o.getCoordinates()[a.length]=a[0],M.isCCW(o.getCoordinates())===s&&Y.reverse(o.getCoordinates())}},e.prototype.getCoordinate=function(){return this._shell.getCoordinate()},e.prototype.getNumInteriorRing=function(){return this._holes.length},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.getLength=function(){var r=this,i=0;i+=this._shell.getLength();for(var o=0;o<this._holes.length;o++)i+=r._holes[o].getLength();return i},e.prototype.getNumPoints=function(){for(var r=this,i=this._shell.getNumPoints(),o=0;o<this._holes.length;o++)i+=r._holes[o].getNumPoints();return i},e.prototype.reverse=function(){var r=this,i=this.copy();i._shell=this._shell.copy().reverse(),i._holes=new Array(this._holes.length).fill(null);for(var o=0;o<this._holes.length;o++)i._holes[o]=r._holes[o].copy().reverse();return i},e.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},e.prototype.compareToSameClass=function(){var r=this;if(arguments.length===1){var i=arguments[0],o=this._shell,s=i._shell;return o.compareToSameClass(s)}else if(arguments.length===2){var a=arguments[0],u=arguments[1],l=a,c=this._shell,p=l._shell,h=c.compareToSameClass(p,u);if(h!==0)return h;for(var g=this.getNumInteriorRing(),f=l.getNumInteriorRing(),m=0;m<g&&m<f;){var y=r.getInteriorRingN(m),v=l.getInteriorRingN(m),x=y.compareToSameClass(v,u);if(x!==0)return x;m++}return m<g?1:m<f?-1:0}},e.prototype.apply=function(r){var i=this;if(z(r,Rn)){this._shell.apply(r);for(var o=0;o<this._holes.length;o++)i._holes[o].apply(r)}else if(z(r,Ye)){if(this._shell.apply(r),!r.isDone())for(var s=0;s<this._holes.length&&(i._holes[s].apply(r),!r.isDone());s++);r.isGeometryChanged()&&this.geometryChanged()}else if(z(r,fn))r.filter(this);else if(z(r,Jn)){r.filter(this),this._shell.apply(r);for(var a=0;a<this._holes.length;a++)i._holes[a].apply(r)}},e.prototype.getBoundary=function(){var r=this;if(this.isEmpty())return this.getFactory().createMultiLineString();var i=new Array(this._holes.length+1).fill(null);i[0]=this._shell;for(var o=0;o<this._holes.length;o++)i[o+1]=r._holes[o];return i.length<=1?this.getFactory().createLinearRing(i[0].getCoordinateSequence()):this.getFactory().createMultiLineString(i)},e.prototype.clone=function(){var r=this,i=t.prototype.clone.call(this);i._shell=this._shell.clone(),i._holes=new Array(this._holes.length).fill(null);for(var o=0;o<this._holes.length;o++)i._holes[o]=r._holes[o].clone();return i},e.prototype.getGeometryType=function(){return"Polygon"},e.prototype.copy=function(){for(var r=this,i=this._shell.copy(),o=new Array(this._holes.length).fill(null),s=0;s<o.length;s++)o[s]=r._holes[s].copy();return new e(i,o,this._factory)},e.prototype.getExteriorRing=function(){return this._shell},e.prototype.isEmpty=function(){return this._shell.isEmpty()},e.prototype.getInteriorRingN=function(r){return this._holes[r]},e.prototype.interfaces_=function(){return[hr]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(e,n),e}(B),Si=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return B.SORTINDEX_MULTIPOINT},e.prototype.isValid=function(){return!0},e.prototype.equalsExact=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.isEquivalentClass(r)?t.prototype.equalsExact.call(this,r,i):!1}else return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getCoordinate=function(){if(arguments.length===1){var r=arguments[0];return this._geometries[r].getCoordinate()}else return t.prototype.getCoordinate.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return K.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.getGeometryType=function(){return"MultiPoint"},e.prototype.copy=function(){for(var r=this,i=new Array(this._geometries.length).fill(null),o=0;o<i.length;o++)i[o]=r._geometries[o].copy();return new e(i,this._factory)},e.prototype.interfaces_=function(){return[oo]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-8048474874175356e3},Object.defineProperties(e,n),e}(ae),On=function(t){function e(r,i){r instanceof d&&i instanceof j&&(r=i.getCoordinateSequenceFactory().create(r)),t.call(this,r,i),this.validateConstruction()}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return B.SORTINDEX_LINEARRING},e.prototype.getBoundaryDimension=function(){return K.FALSE},e.prototype.isClosed=function(){return this.isEmpty()?!0:t.prototype.isClosed.call(this)},e.prototype.reverse=function(){var r=this._points.copy();bt.reverse(r);var i=this.getFactory().createLinearRing(r);return i},e.prototype.validateConstruction=function(){if(!this.isEmpty()&&!t.prototype.isClosed.call(this))throw new ft("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<e.MINIMUM_VALID_SIZE)throw new ft("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},e.prototype.getGeometryType=function(){return"LinearRing"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.MINIMUM_VALID_SIZE.get=function(){return 4},n.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(e,n),e}(_t),wn=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return B.SORTINDEX_MULTIPOLYGON},e.prototype.equalsExact=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.isEquivalentClass(r)?t.prototype.equalsExact.call(this,r,i):!1}else return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.reverse=function(){for(var r=this,i=this._geometries.length,o=new Array(i).fill(null),s=0;s<this._geometries.length;s++)o[s]=r._geometries[s].reverse();return this.getFactory().createMultiPolygon(o)},e.prototype.getBoundary=function(){var r=this;if(this.isEmpty())return this.getFactory().createMultiLineString();for(var i=new O,o=0;o<this._geometries.length;o++)for(var s=r._geometries[o],a=s.getBoundary(),u=0;u<a.getNumGeometries();u++)i.add(a.getGeometryN(u));var l=new Array(i.size()).fill(null);return this.getFactory().createMultiLineString(i.toArray(l))},e.prototype.getGeometryType=function(){return"MultiPolygon"},e.prototype.copy=function(){for(var r=this,i=new Array(this._geometries.length).fill(null),o=0;o<i.length;o++)i[o]=r._geometries[o].copy();return new e(i,this._factory)},e.prototype.interfaces_=function(){return[hr]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(e,n),e}(ae),ke=function(t){this._factory=t||null,this._isUserDataCopied=!1},ss={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};ke.prototype.setCopyUserData=function(t){this._isUserDataCopied=t};ke.prototype.edit=function(t,e){if(t===null)return null;var n=this.editInternal(t,e);return this._isUserDataCopied&&n.setUserData(t.getUserData()),n};ke.prototype.editInternal=function(t,e){return this._factory===null&&(this._factory=t.getFactory()),t instanceof ae?this.editGeometryCollection(t,e):t instanceof Ft?this.editPolygon(t,e):t instanceof _e?e.edit(t,this._factory):t instanceof _t?e.edit(t,this._factory):($.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)};ke.prototype.editGeometryCollection=function(t,e){for(var n=this,r=e.edit(t,this._factory),i=new O,o=0;o<r.getNumGeometries();o++){var s=n.edit(r.getGeometryN(o),e);s===null||s.isEmpty()||i.add(s)}return r.getClass()===Si?this._factory.createMultiPoint(i.toArray([])):r.getClass()===Mr?this._factory.createMultiLineString(i.toArray([])):r.getClass()===wn?this._factory.createMultiPolygon(i.toArray([])):this._factory.createGeometryCollection(i.toArray([]))};ke.prototype.editPolygon=function(t,e){var n=this,r=e.edit(t,this._factory);if(r===null&&(r=this._factory.createPolygon(null)),r.isEmpty())return r;var i=this.edit(r.getExteriorRing(),e);if(i===null||i.isEmpty())return this._factory.createPolygon();for(var o=new O,s=0;s<r.getNumInteriorRing();s++){var a=n.edit(r.getInteriorRingN(s),e);a===null||a.isEmpty()||o.add(a)}return this._factory.createPolygon(i,o.toArray([]))};ke.prototype.interfaces_=function(){return[]};ke.prototype.getClass=function(){return ke};ke.GeometryEditorOperation=function(){};ss.NoOpGeometryOperation.get=function(){return so};ss.CoordinateOperation.get=function(){return ao};ss.CoordinateSequenceOperation.get=function(){return uo};Object.defineProperties(ke,ss);var so=function(){};so.prototype.edit=function(t,e){return t};so.prototype.interfaces_=function(){return[ke.GeometryEditorOperation]};so.prototype.getClass=function(){return so};var ao=function(){};ao.prototype.edit=function(t,e){var n=this.editCoordinates(t.getCoordinates(),t);return n===null?t:t instanceof On?e.createLinearRing(n):t instanceof _t?e.createLineString(n):t instanceof _e?n.length>0?e.createPoint(n[0]):e.createPoint():t};ao.prototype.interfaces_=function(){return[ke.GeometryEditorOperation]};ao.prototype.getClass=function(){return ao};var uo=function(){};uo.prototype.edit=function(t,e){return t instanceof On?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof _t?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof _e?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t};uo.prototype.interfaces_=function(){return[ke.GeometryEditorOperation]};uo.prototype.getClass=function(){return uo};var xt=function(){var t=this;if(this._dimension=3,this._coordinates=null,arguments.length===1){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var e=arguments[0];this._coordinates=new Array(e).fill(null);for(var n=0;n<e;n++)t._coordinates[n]=new d}else if(z(arguments[0],Z)){var r=arguments[0];if(r===null)return this._coordinates=new Array(0).fill(null),null;this._dimension=r.getDimension(),this._coordinates=new Array(r.size()).fill(null);for(var i=0;i<this._coordinates.length;i++)t._coordinates[i]=r.getCoordinateCopy(i)}}else if(arguments.length===2){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var o=arguments[0],s=arguments[1];this._coordinates=o,this._dimension=s,o===null&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var a=arguments[0],u=arguments[1];this._coordinates=new Array(a).fill(null),this._dimension=u;for(var l=0;l<a;l++)t._coordinates[l]=new d}}},Mu={serialVersionUID:{configurable:!0}};xt.prototype.setOrdinate=function(t,e,n){switch(e){case Z.X:this._coordinates[t].x=n;break;case Z.Y:this._coordinates[t].y=n;break;case Z.Z:this._coordinates[t].z=n;break;default:throw new ft("invalid ordinateIndex")}};xt.prototype.size=function(){return this._coordinates.length};xt.prototype.getOrdinate=function(t,e){switch(e){case Z.X:return this._coordinates[t].x;case Z.Y:return this._coordinates[t].y;case Z.Z:return this._coordinates[t].z}return U.NaN};xt.prototype.getCoordinate=function(){if(arguments.length===1){var t=arguments[0];return this._coordinates[t]}else if(arguments.length===2){var e=arguments[0],n=arguments[1];n.x=this._coordinates[e].x,n.y=this._coordinates[e].y,n.z=this._coordinates[e].z}};xt.prototype.getCoordinateCopy=function(t){return new d(this._coordinates[t])};xt.prototype.getDimension=function(){return this._dimension};xt.prototype.getX=function(t){return this._coordinates[t].x};xt.prototype.clone=function(){for(var t=this,e=new Array(this.size()).fill(null),n=0;n<this._coordinates.length;n++)e[n]=t._coordinates[n].clone();return new xt(e,this._dimension)};xt.prototype.expandEnvelope=function(t){for(var e=this,n=0;n<this._coordinates.length;n++)t.expandToInclude(e._coordinates[n]);return t};xt.prototype.copy=function(){for(var t=this,e=new Array(this.size()).fill(null),n=0;n<this._coordinates.length;n++)e[n]=t._coordinates[n].copy();return new xt(e,this._dimension)};xt.prototype.toString=function(){var t=this;if(this._coordinates.length>0){var e=new In(17*this._coordinates.length);e.append("("),e.append(this._coordinates[0]);for(var n=1;n<this._coordinates.length;n++)e.append(", "),e.append(t._coordinates[n]);return e.append(")"),e.toString()}else return"()"};xt.prototype.getY=function(t){return this._coordinates[t].y};xt.prototype.toCoordinateArray=function(){return this._coordinates};xt.prototype.interfaces_=function(){return[Z,ze]};xt.prototype.getClass=function(){return xt};Mu.serialVersionUID.get=function(){return-0xcb44a778db18e00};Object.defineProperties(xt,Mu);var Pn=function(){},Zs={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};Pn.prototype.readResolve=function(){return Pn.instance()};Pn.prototype.create=function(){if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return new xt(t)}else if(z(arguments[0],Z)){var e=arguments[0];return new xt(e)}}else if(arguments.length===2){var n=arguments[0],r=arguments[1];return r>3&&(r=3),r<2?new xt(n):new xt(n,r)}};Pn.prototype.interfaces_=function(){return[xi,ze]};Pn.prototype.getClass=function(){return Pn};Pn.instance=function(){return Pn.instanceObject};Zs.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00};Zs.instanceObject.get=function(){return new Pn};Object.defineProperties(Pn,Zs);var Du=function(t){function e(){t.call(this),this.map_=new Map}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(n){return this.map_.get(n)||null},e.prototype.put=function(n,r){return this.map_.set(n,r),r},e.prototype.values=function(){for(var n=new O,r=this.map_.values(),i=r.next();!i.done;)n.add(i.value),i=r.next();return n},e.prototype.entrySet=function(){var n=new Ws;return this.map_.entries().forEach(function(r){return n.add(r)}),n},e.prototype.size=function(){return this.map_.size()},e}(ci),Q=function t(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=t.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof gn){var e=arguments[0];this._modelType=e,e===t.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var n=arguments[0];this._modelType=t.FIXED,this.setScale(n)}else if(arguments[0]instanceof t){var r=arguments[0];this._modelType=r._modelType,this._scale=r._scale}}},Ks={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};Q.prototype.equals=function(t){if(!(t instanceof Q))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale};Q.prototype.compareTo=function(t){var e=t,n=this.getMaximumSignificantDigits(),r=e.getMaximumSignificantDigits();return new pn(n).compareTo(new pn(r))};Q.prototype.getScale=function(){return this._scale};Q.prototype.isFloating=function(){return this._modelType===Q.FLOATING||this._modelType===Q.FLOATING_SINGLE};Q.prototype.getType=function(){return this._modelType};Q.prototype.toString=function(){var t="UNKNOWN";return this._modelType===Q.FLOATING?t="Floating":this._modelType===Q.FLOATING_SINGLE?t="Floating-Single":this._modelType===Q.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t};Q.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var t=arguments[0];if(U.isNaN(t))return t;if(this._modelType===Q.FLOATING_SINGLE){var e=t;return e}return this._modelType===Q.FIXED?Math.round(t*this._scale)/this._scale:t}else if(arguments[0]instanceof d){var n=arguments[0];if(this._modelType===Q.FLOATING)return null;n.x=this.makePrecise(n.x),n.y=this.makePrecise(n.y)}};Q.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===Q.FLOATING?t=16:this._modelType===Q.FLOATING_SINGLE?t=6:this._modelType===Q.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t};Q.prototype.setScale=function(t){this._scale=Math.abs(t)};Q.prototype.interfaces_=function(){return[ze,Be]};Q.prototype.getClass=function(){return Q};Q.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e};Ks.serialVersionUID.get=function(){return 7777263578777804e3};Ks.maximumPreciseValue.get=function(){return 9007199254740992};Object.defineProperties(Q,Ks);var gn=function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)},Js={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};gn.prototype.readResolve=function(){return gn.nameToTypeMap.get(this._name)};gn.prototype.toString=function(){return this._name};gn.prototype.interfaces_=function(){return[ze]};gn.prototype.getClass=function(){return gn};Js.serialVersionUID.get=function(){return-552860263173159e4};Js.nameToTypeMap.get=function(){return new Du};Object.defineProperties(gn,Js);Q.Type=gn;Q.FIXED=new gn("FIXED");Q.FLOATING=new gn("FLOATING");Q.FLOATING_SINGLE=new gn("FLOATING SINGLE");var j=function t(){this._precisionModel=new Q,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?z(arguments[0],xi)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof Q&&(this._precisionModel=arguments[0]):arguments.length===2?(this._precisionModel=arguments[0],this._SRID=arguments[1]):arguments.length===3&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},Au={serialVersionUID:{configurable:!0}};j.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new d(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new d(t.getMinX(),t.getMinY()),new d(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new d(t.getMinX(),t.getMinY()),new d(t.getMinX(),t.getMaxY()),new d(t.getMaxX(),t.getMaxY()),new d(t.getMaxX(),t.getMinY()),new d(t.getMinX(),t.getMinY())]),null)};j.prototype.createLineString=function(t){if(t){if(t instanceof Array)return new _t(this.getCoordinateSequenceFactory().create(t),this);if(z(t,Z))return new _t(t,this)}else return new _t(this.getCoordinateSequenceFactory().create([]),this)};j.prototype.createMultiLineString=function(){if(arguments.length===0)return new Mr(null,this);if(arguments.length===1){var t=arguments[0];return new Mr(t,this)}};j.prototype.buildGeometry=function(t){for(var e=null,n=!1,r=!1,i=t.iterator();i.hasNext();){var o=i.next(),s=o.getClass();e===null&&(e=s),s!==e&&(n=!0),o.isGeometryCollectionOrDerived()&&(r=!0)}if(e===null)return this.createGeometryCollection();if(n||r)return this.createGeometryCollection(j.toGeometryArray(t));var a=t.iterator().next(),u=t.size()>1;if(u){if(a instanceof Ft)return this.createMultiPolygon(j.toPolygonArray(t));if(a instanceof _t)return this.createMultiLineString(j.toLineStringArray(t));if(a instanceof _e)return this.createMultiPoint(j.toPointArray(t));$.shouldNeverReachHere("Unhandled class: "+a.getClass().getName())}return a};j.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(t!==null?this.getCoordinateSequenceFactory().create(t):null)};j.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof d){var t=arguments[0];return this.createPoint(t!==null?this.getCoordinateSequenceFactory().create([t]):null)}else if(z(arguments[0],Z)){var e=arguments[0];return new _e(e,this)}}};j.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory};j.prototype.createPolygon=function(){if(arguments.length===0)return new Ft(null,null,this);if(arguments.length===1){if(z(arguments[0],Z)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}else if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}else if(arguments[0]instanceof On){var n=arguments[0];return this.createPolygon(n,null)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];return new Ft(r,i,this)}};j.prototype.getSRID=function(){return this._SRID};j.prototype.createGeometryCollection=function(){if(arguments.length===0)return new ae(null,this);if(arguments.length===1){var t=arguments[0];return new ae(t,this)}};j.prototype.createGeometry=function(t){var e=new ke(this);return e.edit(t,{edit:function(){if(arguments.length===2){var n=arguments[0];return this._coordinateSequenceFactory.create(n)}}})};j.prototype.getPrecisionModel=function(){return this._precisionModel};j.prototype.createLinearRing=function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(t!==null?this.getCoordinateSequenceFactory().create(t):null)}else if(z(arguments[0],Z)){var e=arguments[0];return new On(e,this)}}};j.prototype.createMultiPolygon=function(){if(arguments.length===0)return new wn(null,this);if(arguments.length===1){var t=arguments[0];return new wn(t,this)}};j.prototype.createMultiPoint=function(){var t=this;if(arguments.length===0)return new Si(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return new Si(e,this)}else if(arguments[0]instanceof Array){var n=arguments[0];return this.createMultiPoint(n!==null?this.getCoordinateSequenceFactory().create(n):null)}else if(z(arguments[0],Z)){var r=arguments[0];if(r===null)return this.createMultiPoint(new Array(0).fill(null));for(var i=new Array(r.size()).fill(null),o=0;o<r.size();o++){var s=t.getCoordinateSequenceFactory().create(1,r.getDimension());bt.copy(r,o,s,0,1),i[o]=t.createPoint(s)}return this.createMultiPoint(i)}}};j.prototype.interfaces_=function(){return[ze]};j.prototype.getClass=function(){return j};j.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)};j.toGeometryArray=function(t){if(t===null)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)};j.getDefaultCoordinateSequenceFactory=function(){return Pn.instance()};j.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)};j.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)};j.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)};j.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)};j.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)};j.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)};j.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)};Au.serialVersionUID.get=function(){return-6820524753094096e3};Object.defineProperties(j,Au);var Rp=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],as=function(t){this.geometryFactory=t||new j};as.prototype.read=function(t){var e;typeof t=="string"?e=JSON.parse(t):e=t;var n=e.type;if(!sn[n])throw new Error("Unknown GeoJSON type: "+e.type);return Rp.indexOf(n)!==-1?sn[n].apply(this,[e.coordinates]):n==="GeometryCollection"?sn[n].apply(this,[e.geometries]):sn[n].apply(this,[e])};as.prototype.write=function(t){var e=t.getGeometryType();if(!jn[e])throw new Error("Geometry is not supported");return jn[e].apply(this,[t])};var sn={Feature:function(t){var e={};for(var n in t)e[n]=t[n];if(t.geometry){var r=t.geometry.type;if(!sn[r])throw new Error("Unknown GeoJSON type: "+t.type);e.geometry=this.read(t.geometry)}return t.bbox&&(e.bbox=sn.bbox.apply(this,[t.bbox])),e},FeatureCollection:function(t){var e=this,n={};if(t.features){n.features=[];for(var r=0;r<t.features.length;++r)n.features.push(e.read(t.features[r]))}return t.bbox&&(n.bbox=this.parse.bbox.apply(this,[t.bbox])),n},coordinates:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(new d(r[0],r[1]))}return e},bbox:function(t){return this.geometryFactory.createLinearRing([new d(t[0],t[1]),new d(t[2],t[1]),new d(t[2],t[3]),new d(t[0],t[3]),new d(t[0],t[1])])},Point:function(t){var e=new d(t[0],t[1]);return this.geometryFactory.createPoint(e)},MultiPoint:function(t){for(var e=this,n=[],r=0;r<t.length;++r)n.push(sn.Point.apply(e,[t[r]]));return this.geometryFactory.createMultiPoint(n)},LineString:function(t){var e=sn.coordinates.apply(this,[t]);return this.geometryFactory.createLineString(e)},MultiLineString:function(t){for(var e=this,n=[],r=0;r<t.length;++r)n.push(sn.LineString.apply(e,[t[r]]));return this.geometryFactory.createMultiLineString(n)},Polygon:function(t){for(var e=this,n=sn.coordinates.apply(this,[t[0]]),r=this.geometryFactory.createLinearRing(n),i=[],o=1;o<t.length;++o){var s=t[o],a=sn.coordinates.apply(e,[s]),u=e.geometryFactory.createLinearRing(a);i.push(u)}return this.geometryFactory.createPolygon(r,i)},MultiPolygon:function(t){for(var e=this,n=[],r=0;r<t.length;++r){var i=t[r];n.push(sn.Polygon.apply(e,[i]))}return this.geometryFactory.createMultiPolygon(n)},GeometryCollection:function(t){for(var e=this,n=[],r=0;r<t.length;++r){var i=t[r];n.push(e.read(i))}return this.geometryFactory.createGeometryCollection(n)}},jn={coordinate:function(t){return[t.x,t.y]},Point:function(t){var e=jn.coordinate.apply(this,[t.getCoordinate()]);return{type:"Point",coordinates:e}},MultiPoint:function(t){for(var e=this,n=[],r=0;r<t._geometries.length;++r){var i=t._geometries[r],o=jn.Point.apply(e,[i]);n.push(o.coordinates)}return{type:"MultiPoint",coordinates:n}},LineString:function(t){for(var e=this,n=[],r=t.getCoordinates(),i=0;i<r.length;++i){var o=r[i];n.push(jn.coordinate.apply(e,[o]))}return{type:"LineString",coordinates:n}},MultiLineString:function(t){for(var e=this,n=[],r=0;r<t._geometries.length;++r){var i=t._geometries[r],o=jn.LineString.apply(e,[i]);n.push(o.coordinates)}return{type:"MultiLineString",coordinates:n}},Polygon:function(t){var e=this,n=[],r=jn.LineString.apply(this,[t._shell]);n.push(r.coordinates);for(var i=0;i<t._holes.length;++i){var o=t._holes[i],s=jn.LineString.apply(e,[o]);n.push(s.coordinates)}return{type:"Polygon",coordinates:n}},MultiPolygon:function(t){for(var e=this,n=[],r=0;r<t._geometries.length;++r){var i=t._geometries[r],o=jn.Polygon.apply(e,[i]);n.push(o.coordinates)}return{type:"MultiPolygon",coordinates:n}},GeometryCollection:function(t){for(var e=this,n=[],r=0;r<t._geometries.length;++r){var i=t._geometries[r],o=i.getGeometryType();n.push(jn[o].apply(e,[i]))}return{type:"GeometryCollection",geometries:n}}},Qs=function(t){this.geometryFactory=t||new j,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new as(this.geometryFactory)};Qs.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===Q.FIXED&&this.reducePrecision(e),e};Qs.prototype.reducePrecision=function(t){var e=this,n,r;if(t.coordinate)this.precisionModel.makePrecise(t.coordinate);else if(t.points)for(n=0,r=t.points.length;n<r;n++)e.precisionModel.makePrecise(t.points[n]);else if(t.geometries)for(n=0,r=t.geometries.length;n<r;n++)e.reducePrecision(t.geometries[n])};var Fu=function(){this.parser=new as(this.geometryFactory)};Fu.prototype.write=function(t){return this.parser.write(t)};var R=function(){},us={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};R.prototype.interfaces_=function(){return[]};R.prototype.getClass=function(){return R};R.opposite=function(t){return t===R.LEFT?R.RIGHT:t===R.RIGHT?R.LEFT:t};us.ON.get=function(){return 0};us.LEFT.get=function(){return 1};us.RIGHT.get=function(){return 2};Object.defineProperties(R,us);function ls(t){this.message=t||""}ls.prototype=new Error;ls.prototype.name="EmptyStackException";function Nn(){this.array_=[]}Nn.prototype=new Xe;Nn.prototype.add=function(t){return this.array_.push(t),!0};Nn.prototype.get=function(t){if(t<0||t>=this.size())throw new Error;return this.array_[t]};Nn.prototype.push=function(t){return this.array_.push(t),t};Nn.prototype.pop=function(t){if(this.array_.length===0)throw new ls;return this.array_.pop()};Nn.prototype.peek=function(){if(this.array_.length===0)throw new ls;return this.array_[this.array_.length-1]};Nn.prototype.empty=function(){return this.array_.length===0};Nn.prototype.isEmpty=function(){return this.empty()};Nn.prototype.search=function(t){return this.array_.indexOf(t)};Nn.prototype.size=function(){return this.array_.length};Nn.prototype.toArray=function(){for(var t=this,e=[],n=0,r=this.array_.length;n<r;n++)e.push(t.array_[n]);return e};var dn=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};dn.prototype.getCoordinate=function(){return this._minCoord};dn.prototype.getRightmostSide=function(t,e){var n=this.getRightmostSideOfSegment(t,e);return n<0&&(n=this.getRightmostSideOfSegment(t,e-1)),n<0&&(this._minCoord=null,this.checkForRightmostCoordinate(t)),n};dn.prototype.findRightmostEdgeAtVertex=function(){var t=this._minDe.getEdge().getCoordinates();$.isTrue(this._minIndex>0&&this._minIndex<t.length,"rightmost point expected to be interior vertex of edge");var e=t[this._minIndex-1],n=t[this._minIndex+1],r=M.computeOrientation(this._minCoord,n,e),i=!1;(e.y<this._minCoord.y&&n.y<this._minCoord.y&&r===M.COUNTERCLOCKWISE||e.y>this._minCoord.y&&n.y>this._minCoord.y&&r===M.CLOCKWISE)&&(i=!0),i&&(this._minIndex=this._minIndex-1)};dn.prototype.getRightmostSideOfSegment=function(t,e){var n=t.getEdge(),r=n.getCoordinates();if(e<0||e+1>=r.length||r[e].y===r[e+1].y)return-1;var i=R.LEFT;return r[e].y<r[e+1].y&&(i=R.RIGHT),i};dn.prototype.getEdge=function(){return this._orientedDe};dn.prototype.checkForRightmostCoordinate=function(t){for(var e=this,n=t.getEdge().getCoordinates(),r=0;r<n.length-1;r++)(e._minCoord===null||n[r].x>e._minCoord.x)&&(e._minDe=t,e._minIndex=r,e._minCoord=n[r])};dn.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode(),e=t.getEdges();this._minDe=e.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)};dn.prototype.findEdge=function(t){for(var e=this,n=t.iterator();n.hasNext();){var r=n.next();r.isForward()&&e.checkForRightmostCoordinate(r)}$.isTrue(this._minIndex!==0||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),this._minIndex===0?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe;var i=this.getRightmostSide(this._minDe,this._minIndex);i===R.LEFT&&(this._orientedDe=this._minDe.getSym())};dn.prototype.interfaces_=function(){return[]};dn.prototype.getClass=function(){return dn};var Qn=function(t){function e(n,r){t.call(this,e.msgWithCoord(n,r)),this.pt=r?new d(r):null,this.name="TopologyException"}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCoordinate=function(){return this.pt},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.msgWithCoord=function(n,r){return r?n:n+" [ "+r+" ]"},e}(Kn),cs=function(){this.array_=[]};cs.prototype.addLast=function(t){this.array_.push(t)};cs.prototype.removeFirst=function(){return this.array_.shift()};cs.prototype.isEmpty=function(){return this.array_.length===0};var ue=function(){this._finder=null,this._dirEdgeList=new O,this._nodes=new O,this._rightMostCoord=null,this._env=null,this._finder=new dn};ue.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.setVisited(!1)}};ue.prototype.getRightmostCoordinate=function(){return this._rightMostCoord};ue.prototype.computeNodeDepth=function(t){for(var e=this,n=null,r=t.getEdges().iterator();r.hasNext();){var i=r.next();if(i.isVisited()||i.getSym().isVisited()){n=i;break}}if(n===null)throw new Qn("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(n);for(var o=t.getEdges().iterator();o.hasNext();){var s=o.next();s.setVisited(!0),e.copySymDepths(s)}};ue.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(R.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)};ue.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()};ue.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(R.RIGHT)>=1&&e.getDepth(R.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}};ue.prototype.computeDepths=function(t){var e=this,n=new Ws,r=new cs,i=t.getNode();for(r.addLast(i),n.add(i),t.setVisited(!0);!r.isEmpty();){var o=r.removeFirst();n.add(o),e.computeNodeDepth(o);for(var s=o.getEdges().iterator();s.hasNext();){var a=s.next(),u=a.getSym();if(!u.isVisited()){var l=u.getNode();n.contains(l)||(r.addLast(l),n.add(l))}}}};ue.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0};ue.prototype.getEnvelope=function(){if(this._env===null){for(var t=new F,e=this._dirEdgeList.iterator();e.hasNext();)for(var n=e.next(),r=n.getEdge().getCoordinates(),i=0;i<r.length-1;i++)t.expandToInclude(r[i]);this._env=t}return this._env};ue.prototype.addReachable=function(t){var e=this,n=new Nn;for(n.add(t);!n.empty();){var r=n.pop();e.add(r,n)}};ue.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(R.LEFT,t.getDepth(R.RIGHT)),e.setDepth(R.RIGHT,t.getDepth(R.LEFT))};ue.prototype.add=function(t,e){var n=this;t.setVisited(!0),this._nodes.add(t);for(var r=t.getEdges().iterator();r.hasNext();){var i=r.next();n._dirEdgeList.add(i);var o=i.getSym(),s=o.getNode();s.isVisited()||e.push(s)}};ue.prototype.getNodes=function(){return this._nodes};ue.prototype.getDirectedEdges=function(){return this._dirEdgeList};ue.prototype.interfaces_=function(){return[Be]};ue.prototype.getClass=function(){return ue};var ut=function t(){var e=this;if(this.location=null,arguments.length===1){if(arguments[0]instanceof Array){var n=arguments[0];this.init(n.length)}else if(Number.isInteger(arguments[0])){var r=arguments[0];this.init(1),this.location[R.ON]=r}else if(arguments[0]instanceof t){var i=arguments[0];if(this.init(i.location.length),i!==null)for(var o=0;o<this.location.length;o++)e.location[o]=i.location[o]}}else if(arguments.length===3){var s=arguments[0],a=arguments[1],u=arguments[2];this.init(3),this.location[R.ON]=s,this.location[R.LEFT]=a,this.location[R.RIGHT]=u}};ut.prototype.setAllLocations=function(t){for(var e=this,n=0;n<this.location.length;n++)e.location[n]=t};ut.prototype.isNull=function(){for(var t=this,e=0;e<this.location.length;e++)if(t.location[e]!==_.NONE)return!1;return!0};ut.prototype.setAllLocationsIfNull=function(t){for(var e=this,n=0;n<this.location.length;n++)e.location[n]===_.NONE&&(e.location[n]=t)};ut.prototype.isLine=function(){return this.location.length===1};ut.prototype.merge=function(t){var e=this;if(t.location.length>this.location.length){var n=new Array(3).fill(null);n[R.ON]=this.location[R.ON],n[R.LEFT]=_.NONE,n[R.RIGHT]=_.NONE,this.location=n}for(var r=0;r<this.location.length;r++)e.location[r]===_.NONE&&r<t.location.length&&(e.location[r]=t.location[r])};ut.prototype.getLocations=function(){return this.location};ut.prototype.flip=function(){if(this.location.length<=1)return null;var t=this.location[R.LEFT];this.location[R.LEFT]=this.location[R.RIGHT],this.location[R.RIGHT]=t};ut.prototype.toString=function(){var t=new In;return this.location.length>1&&t.append(_.toLocationSymbol(this.location[R.LEFT])),t.append(_.toLocationSymbol(this.location[R.ON])),this.location.length>1&&t.append(_.toLocationSymbol(this.location[R.RIGHT])),t.toString()};ut.prototype.setLocations=function(t,e,n){this.location[R.ON]=t,this.location[R.LEFT]=e,this.location[R.RIGHT]=n};ut.prototype.get=function(t){return t<this.location.length?this.location[t]:_.NONE};ut.prototype.isArea=function(){return this.location.length>1};ut.prototype.isAnyNull=function(){for(var t=this,e=0;e<this.location.length;e++)if(t.location[e]===_.NONE)return!0;return!1};ut.prototype.setLocation=function(){if(arguments.length===1){var t=arguments[0];this.setLocation(R.ON,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this.location[e]=n}};ut.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(_.NONE)};ut.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]};ut.prototype.allPositionsEqual=function(t){for(var e=this,n=0;n<this.location.length;n++)if(e.location[n]!==t)return!1;return!0};ut.prototype.interfaces_=function(){return[]};ut.prototype.getClass=function(){return ut};var rt=function t(){if(this.elt=new Array(2).fill(null),arguments.length===1){if(Number.isInteger(arguments[0])){var e=arguments[0];this.elt[0]=new ut(e),this.elt[1]=new ut(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.elt[0]=new ut(n.elt[0]),this.elt[1]=new ut(n.elt[1])}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.elt[0]=new ut(_.NONE),this.elt[1]=new ut(_.NONE),this.elt[r].setLocation(i)}else if(arguments.length===3){var o=arguments[0],s=arguments[1],a=arguments[2];this.elt[0]=new ut(o,s,a),this.elt[1]=new ut(o,s,a)}else if(arguments.length===4){var u=arguments[0],l=arguments[1],c=arguments[2],p=arguments[3];this.elt[0]=new ut(_.NONE,_.NONE,_.NONE),this.elt[1]=new ut(_.NONE,_.NONE,_.NONE),this.elt[u].setLocations(l,c,p)}};rt.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t};rt.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)};rt.prototype.isNull=function(t){return this.elt[t].isNull()};rt.prototype.setAllLocationsIfNull=function(){if(arguments.length===1){var t=arguments[0];this.setAllLocationsIfNull(0,t),this.setAllLocationsIfNull(1,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this.elt[e].setAllLocationsIfNull(n)}};rt.prototype.isLine=function(t){return this.elt[t].isLine()};rt.prototype.merge=function(t){for(var e=this,n=0;n<2;n++)e.elt[n]===null&&t.elt[n]!==null?e.elt[n]=new ut(t.elt[n]):e.elt[n].merge(t.elt[n])};rt.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()};rt.prototype.getLocation=function(){if(arguments.length===1){var t=arguments[0];return this.elt[t].get(R.ON)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return this.elt[e].get(n)}};rt.prototype.toString=function(){var t=new In;return this.elt[0]!==null&&(t.append("A:"),t.append(this.elt[0].toString())),this.elt[1]!==null&&(t.append(" B:"),t.append(this.elt[1].toString())),t.toString()};rt.prototype.isArea=function(){if(arguments.length===0)return this.elt[0].isArea()||this.elt[1].isArea();if(arguments.length===1){var t=arguments[0];return this.elt[t].isArea()}};rt.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()};rt.prototype.setLocation=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(R.ON,e)}else if(arguments.length===3){var n=arguments[0],r=arguments[1],i=arguments[2];this.elt[n].setLocation(r,i)}};rt.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)};rt.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)};rt.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new ut(this.elt[t].location[0]))};rt.prototype.interfaces_=function(){return[]};rt.prototype.getClass=function(){return rt};rt.toLineLabel=function(t){for(var e=new rt(_.NONE),n=0;n<2;n++)e.setLocation(n,t.getLocation(n));return e};var Ot=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new O,this._pts=new O,this._label=new rt(_.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new O,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()};Ot.prototype.computeRing=function(){var t=this;if(this._ring!==null)return null;for(var e=new Array(this._pts.size()).fill(null),n=0;n<this._pts.size();n++)e[n]=t._pts.get(n);this._ring=this._geometryFactory.createLinearRing(e),this._isHole=M.isCCW(this._ring.getCoordinates())};Ot.prototype.isIsolated=function(){return this._label.getGeometryCount()===1};Ot.prototype.computePoints=function(t){var e=this;this._startDe=t;var n=t,r=!0;do{if(n===null)throw new Qn("Found null DirectedEdge");if(n.getEdgeRing()===e)throw new Qn("Directed Edge visited twice during ring-building at "+n.getCoordinate());e._edges.add(n);var i=n.getLabel();$.isTrue(i.isArea()),e.mergeLabel(i),e.addPoints(n.getEdge(),n.isForward(),r),r=!1,e.setEdgeRing(n,e),n=e.getNext(n)}while(n!==this._startDe)};Ot.prototype.getLinearRing=function(){return this._ring};Ot.prototype.getCoordinate=function(t){return this._pts.get(t)};Ot.prototype.computeMaxNodeDegree=function(){var t=this;this._maxNodeDegree=0;var e=this._startDe;do{var n=e.getNode(),r=n.getEdges().getOutgoingDegree(t);r>t._maxNodeDegree&&(t._maxNodeDegree=r),e=t.getNext(e)}while(e!==this._startDe);this._maxNodeDegree*=2};Ot.prototype.addPoints=function(t,e,n){var r=this,i=t.getCoordinates();if(e){var o=1;n&&(o=0);for(var s=o;s<i.length;s++)r._pts.add(i[s])}else{var a=i.length-2;n&&(a=i.length-1);for(var u=a;u>=0;u--)r._pts.add(i[u])}};Ot.prototype.isHole=function(){return this._isHole};Ot.prototype.setInResult=function(){var t=this._startDe;do t.getEdge().setInResult(!0),t=t.getNext();while(t!==this._startDe)};Ot.prototype.containsPoint=function(t){var e=this.getLinearRing(),n=e.getEnvelopeInternal();if(!n.contains(t)||!M.isPointInRing(t,e.getCoordinates()))return!1;for(var r=this._holes.iterator();r.hasNext();){var i=r.next();if(i.containsPoint(t))return!1}return!0};Ot.prototype.addHole=function(t){this._holes.add(t)};Ot.prototype.isShell=function(){return this._shell===null};Ot.prototype.getLabel=function(){return this._label};Ot.prototype.getEdges=function(){return this._edges};Ot.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree};Ot.prototype.getShell=function(){return this._shell};Ot.prototype.mergeLabel=function(){if(arguments.length===1){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(arguments.length===2){var e=arguments[0],n=arguments[1],r=e.getLocation(n,R.RIGHT);if(r===_.NONE)return null;if(this._label.getLocation(n)===_.NONE)return this._label.setLocation(n,r),null}};Ot.prototype.setShell=function(t){this._shell=t,t!==null&&t.addHole(this)};Ot.prototype.toPolygon=function(t){for(var e=this,n=new Array(this._holes.size()).fill(null),r=0;r<this._holes.size();r++)n[r]=e._holes.get(r).getLinearRing();var i=t.createPolygon(this.getLinearRing(),n);return i};Ot.prototype.interfaces_=function(){return[]};Ot.prototype.getClass=function(){return Ot};var Op=function(t){function e(){var n=arguments[0],r=arguments[1];t.call(this,n,r)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setEdgeRing=function(n,r){n.setMinEdgeRing(r)},e.prototype.getNext=function(n){return n.getNextMin()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ot),Pp=function(t){function e(){var n=arguments[0],r=arguments[1];t.call(this,n,r)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildMinimalRings=function(){var n=this,r=new O,i=this._startDe;do{if(i.getMinEdgeRing()===null){var o=new Op(i,n._geometryFactory);r.add(o)}i=i.getNext()}while(i!==this._startDe);return r},e.prototype.setEdgeRing=function(n,r){n.setEdgeRing(r)},e.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var n=this,r=this._startDe;do{var i=r.getNode();i.getEdges().linkMinimalDirectedEdges(n),r=r.getNext()}while(r!==this._startDe)},e.prototype.getNext=function(n){return n.getNext()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ot),Te=function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,arguments.length!==0&&arguments.length===1){var t=arguments[0];this._label=t}};Te.prototype.setVisited=function(t){this._isVisited=t};Te.prototype.setInResult=function(t){this._isInResult=t};Te.prototype.isCovered=function(){return this._isCovered};Te.prototype.isCoveredSet=function(){return this._isCoveredSet};Te.prototype.setLabel=function(t){this._label=t};Te.prototype.getLabel=function(){return this._label};Te.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0};Te.prototype.updateIM=function(t){$.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)};Te.prototype.isInResult=function(){return this._isInResult};Te.prototype.isVisited=function(){return this._isVisited};Te.prototype.interfaces_=function(){return[]};Te.prototype.getClass=function(){return Te};var ps=function(t){function e(){t.call(this),this._coord=null,this._edges=null;var n=arguments[0],r=arguments[1];this._coord=n,this._edges=r,this._label=new rt(0,_.NONE)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isIncidentEdgeInResult=function(){for(var n=this.getEdges().getEdges().iterator();n.hasNext();){var r=n.next();if(r.getEdge().isInResult())return!0}return!1},e.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},e.prototype.getCoordinate=function(){return this._coord},e.prototype.print=function(n){n.println("node "+this._coord+" lbl: "+this._label)},e.prototype.computeIM=function(n){},e.prototype.computeMergedLocation=function(n,r){var i=_.NONE;if(i=this._label.getLocation(r),!n.isNull(r)){var o=n.getLocation(r);i!==_.BOUNDARY&&(i=o)}return i},e.prototype.setLabel=function(){if(arguments.length===2){var n=arguments[0],r=arguments[1];this._label===null?this._label=new rt(n,r):this._label.setLocation(n,r)}else return t.prototype.setLabel.apply(this,arguments)},e.prototype.getEdges=function(){return this._edges},e.prototype.mergeLabel=function(){var n=this;if(arguments[0]instanceof e){var r=arguments[0];this.mergeLabel(r._label)}else if(arguments[0]instanceof rt)for(var i=arguments[0],o=0;o<2;o++){var s=n.computeMergedLocation(i,o),a=n._label.getLocation(o);a===_.NONE&&n._label.setLocation(o,s)}},e.prototype.add=function(n){this._edges.insert(n),n.setNode(this)},e.prototype.setLabelBoundary=function(n){if(this._label===null)return null;var r=_.NONE;this._label!==null&&(r=this._label.getLocation(n));var i=null;switch(r){case _.BOUNDARY:i=_.INTERIOR;break;case _.INTERIOR:i=_.BOUNDARY;break;default:i=_.BOUNDARY;break}this._label.setLocation(n,i)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Te),mn=function(){this.nodeMap=new Jt,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};mn.prototype.find=function(t){return this.nodeMap.get(t)};mn.prototype.addNode=function(){if(arguments[0]instanceof d){var t=arguments[0],e=this.nodeMap.get(t);return e===null&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}else if(arguments[0]instanceof ps){var n=arguments[0],r=this.nodeMap.get(n.getCoordinate());return r===null?(this.nodeMap.put(n.getCoordinate(),n),n):(r.mergeLabel(n),r)}};mn.prototype.print=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}};mn.prototype.iterator=function(){return this.nodeMap.values().iterator()};mn.prototype.values=function(){return this.nodeMap.values()};mn.prototype.getBoundaryNodes=function(t){for(var e=new O,n=this.iterator();n.hasNext();){var r=n.next();r.getLabel().getLocation(t)===_.BOUNDARY&&e.add(r)}return e};mn.prototype.add=function(t){var e=t.getCoordinate(),n=this.addNode(e);n.add(t)};mn.prototype.interfaces_=function(){return[]};mn.prototype.getClass=function(){return mn};var ot=function(){},xo={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};ot.prototype.interfaces_=function(){return[]};ot.prototype.getClass=function(){return ot};ot.isNorthern=function(t){return t===ot.NE||t===ot.NW};ot.isOpposite=function(t,e){if(t===e)return!1;var n=(t-e+4)%4;return n===2};ot.commonHalfPlane=function(t,e){if(t===e)return t;var n=(t-e+4)%4;if(n===2)return-1;var r=t<e?t:e,i=t>e?t:e;return r===0&&i===3?3:r};ot.isInHalfPlane=function(t,e){return e===ot.SE?t===ot.SE||t===ot.SW:t===e||t===e+1};ot.quadrant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];if(t===0&&e===0)throw new ft("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?ot.NE:ot.SE:e>=0?ot.NW:ot.SW}else if(arguments[0]instanceof d&&arguments[1]instanceof d){var n=arguments[0],r=arguments[1];if(r.x===n.x&&r.y===n.y)throw new ft("Cannot compute the quadrant for two identical points "+n);return r.x>=n.x?r.y>=n.y?ot.NE:ot.SE:r.y>=n.y?ot.NW:ot.SW}};xo.NE.get=function(){return 0};xo.NW.get=function(){return 1};xo.SW.get=function(){return 2};xo.SE.get=function(){return 3};Object.defineProperties(ot,xo);var Qt=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,arguments.length===1){var t=arguments[0];this._edge=t}else if(arguments.length===3){var e=arguments[0],n=arguments[1],r=arguments[2],i=null;this._edge=e,this.init(n,r),this._label=i}else if(arguments.length===4){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3];this._edge=o,this.init(s,a),this._label=u}};Qt.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:M.computeOrientation(t._p0,t._p1,this._p1)};Qt.prototype.getDy=function(){return this._dy};Qt.prototype.getCoordinate=function(){return this._p0};Qt.prototype.setNode=function(t){this._node=t};Qt.prototype.print=function(t){var e=Math.atan2(this._dy,this._dx),n=this.getClass().getName(),r=n.lastIndexOf("."),i=n.substring(r+1);t.print(" "+i+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label)};Qt.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)};Qt.prototype.getDirectedCoordinate=function(){return this._p1};Qt.prototype.getDx=function(){return this._dx};Qt.prototype.getLabel=function(){return this._label};Qt.prototype.getEdge=function(){return this._edge};Qt.prototype.getQuadrant=function(){return this._quadrant};Qt.prototype.getNode=function(){return this._node};Qt.prototype.toString=function(){var t=Math.atan2(this._dy,this._dx),e=this.getClass().getName(),n=e.lastIndexOf("."),r=e.substring(n+1);return" "+r+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+" "+this._label};Qt.prototype.computeLabel=function(t){};Qt.prototype.init=function(t,e){this._p0=t,this._p1=e,this._dx=e.x-t.x,this._dy=e.y-t.y,this._quadrant=ot.quadrant(this._dx,this._dy),$.isTrue(!(this._dx===0&&this._dy===0),"EdgeEnd with identical endpoints found")};Qt.prototype.interfaces_=function(){return[Be]};Qt.prototype.getClass=function(){return Qt};var ks=function(t){function e(){var n=arguments[0],r=arguments[1];if(t.call(this,n),this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999],this._isForward=r,r)this.init(n.getCoordinate(0),n.getCoordinate(1));else{var i=n.getNumPoints()-1;this.init(n.getCoordinate(i),n.getCoordinate(i-1))}this.computeDirectedLabel()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getNextMin=function(){return this._nextMin},e.prototype.getDepth=function(n){return this._depth[n]},e.prototype.setVisited=function(n){this._isVisited=n},e.prototype.computeDirectedLabel=function(){this._label=new rt(this._edge.getLabel()),this._isForward||this._label.flip()},e.prototype.getNext=function(){return this._next},e.prototype.setDepth=function(n,r){if(this._depth[n]!==-999&&this._depth[n]!==r)throw new Qn("assigned depths do not match",this.getCoordinate());this._depth[n]=r},e.prototype.isInteriorAreaEdge=function(){for(var n=this,r=!0,i=0;i<2;i++)n._label.isArea(i)&&n._label.getLocation(i,R.LEFT)===_.INTERIOR&&n._label.getLocation(i,R.RIGHT)===_.INTERIOR||(r=!1);return r},e.prototype.setNextMin=function(n){this._nextMin=n},e.prototype.print=function(n){t.prototype.print.call(this,n),n.print(" "+this._depth[R.LEFT]+"/"+this._depth[R.RIGHT]),n.print(" ("+this.getDepthDelta()+")"),this._isInResult&&n.print(" inResult")},e.prototype.setMinEdgeRing=function(n){this._minEdgeRing=n},e.prototype.isLineEdge=function(){var n=this._label.isLine(0)||this._label.isLine(1),r=!this._label.isArea(0)||this._label.allPositionsEqual(0,_.EXTERIOR),i=!this._label.isArea(1)||this._label.allPositionsEqual(1,_.EXTERIOR);return n&&r&&i},e.prototype.setEdgeRing=function(n){this._edgeRing=n},e.prototype.getMinEdgeRing=function(){return this._minEdgeRing},e.prototype.getDepthDelta=function(){var n=this._edge.getDepthDelta();return this._isForward||(n=-n),n},e.prototype.setInResult=function(n){this._isInResult=n},e.prototype.getSym=function(){return this._sym},e.prototype.isForward=function(){return this._isForward},e.prototype.getEdge=function(){return this._edge},e.prototype.printEdge=function(n){this.print(n),n.print(" "),this._isForward?this._edge.print(n):this._edge.printReverse(n)},e.prototype.setSym=function(n){this._sym=n},e.prototype.setVisitedEdge=function(n){this.setVisited(n),this._sym.setVisited(n)},e.prototype.setEdgeDepths=function(n,r){var i=this.getEdge().getDepthDelta();this._isForward||(i=-i);var o=1;n===R.LEFT&&(o=-1);var s=R.opposite(n),a=i*o,u=r+a;this.setDepth(n,r),this.setDepth(s,u)},e.prototype.getEdgeRing=function(){return this._edgeRing},e.prototype.isInResult=function(){return this._isInResult},e.prototype.setNext=function(n){this._next=n},e.prototype.isVisited=function(){return this._isVisited},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.depthFactor=function(n,r){return n===_.EXTERIOR&&r===_.INTERIOR?1:n===_.INTERIOR&&r===_.EXTERIOR?-1:0},e}(Qt),wi=function(){};wi.prototype.createNode=function(t){return new ps(t,null)};wi.prototype.interfaces_=function(){return[]};wi.prototype.getClass=function(){return wi};var dt=function(){if(this._edges=new O,this._nodes=null,this._edgeEndList=new O,arguments.length===0)this._nodes=new mn(new wi);else if(arguments.length===1){var t=arguments[0];this._nodes=new mn(t)}};dt.prototype.printEdges=function(t){var e=this;t.println("Edges:");for(var n=0;n<this._edges.size();n++){t.println("edge "+n+":");var r=e._edges.get(n);r.print(t),r.eiList.print(t)}};dt.prototype.find=function(t){return this._nodes.find(t)};dt.prototype.addNode=function(){if(arguments[0]instanceof ps){var t=arguments[0];return this._nodes.addNode(t)}else if(arguments[0]instanceof d){var e=arguments[0];return this._nodes.addNode(e)}};dt.prototype.getNodeIterator=function(){return this._nodes.iterator()};dt.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){var e=t.next();e.getEdges().linkResultDirectedEdges()}};dt.prototype.debugPrintln=function(t){$t.out.println(t)};dt.prototype.isBoundaryNode=function(t,e){var n=this._nodes.find(e);if(n===null)return!1;var r=n.getLabel();return r!==null&&r.getLocation(t)===_.BOUNDARY};dt.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){var e=t.next();e.getEdges().linkAllDirectedEdges()}};dt.prototype.matchInSameDirection=function(t,e,n,r){return t.equals(n)?M.computeOrientation(t,e,r)===M.COLLINEAR&&ot.quadrant(t,e)===ot.quadrant(n,r):!1};dt.prototype.getEdgeEnds=function(){return this._edgeEndList};dt.prototype.debugPrint=function(t){$t.out.print(t)};dt.prototype.getEdgeIterator=function(){return this._edges.iterator()};dt.prototype.findEdgeInSameDirection=function(t,e){for(var n=this,r=0;r<this._edges.size();r++){var i=n._edges.get(r),o=i.getCoordinates();if(n.matchInSameDirection(t,e,o[0],o[1])||n.matchInSameDirection(t,e,o[o.length-1],o[o.length-2]))return i}return null};dt.prototype.insertEdge=function(t){this._edges.add(t)};dt.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var n=e.next();if(n.getEdge()===t)return n}return null};dt.prototype.addEdges=function(t){for(var e=this,n=t.iterator();n.hasNext();){var r=n.next();e._edges.add(r);var i=new ks(r,!0),o=new ks(r,!1);i.setSym(o),o.setSym(i),e.add(i),e.add(o)}};dt.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)};dt.prototype.getNodes=function(){return this._nodes.values()};dt.prototype.findEdge=function(t,e){for(var n=this,r=0;r<this._edges.size();r++){var i=n._edges.get(r),o=i.getCoordinates();if(t.equals(o[0])&&e.equals(o[1]))return i}return null};dt.prototype.interfaces_=function(){return[]};dt.prototype.getClass=function(){return dt};dt.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.getEdges().linkResultDirectedEdges()}};var ve=function(){this._geometryFactory=null,this._shellList=new O;var t=arguments[0];this._geometryFactory=t};ve.prototype.sortShellsAndHoles=function(t,e,n){for(var r=t.iterator();r.hasNext();){var i=r.next();i.isHole()?n.add(i):e.add(i)}};ve.prototype.computePolygons=function(t){for(var e=this,n=new O,r=t.iterator();r.hasNext();){var i=r.next(),o=i.toPolygon(e._geometryFactory);n.add(o)}return n};ve.prototype.placeFreeHoles=function(t,e){for(var n=this,r=e.iterator();r.hasNext();){var i=r.next();if(i.getShell()===null){var o=n.findEdgeRingContaining(i,t);if(o===null)throw new Qn("unable to assign hole to a shell",i.getCoordinate(0));i.setShell(o)}}};ve.prototype.buildMinimalEdgeRings=function(t,e,n){for(var r=this,i=new O,o=t.iterator();o.hasNext();){var s=o.next();if(s.getMaxNodeDegree()>2){s.linkDirectedEdgesForMinimalEdgeRings();var a=s.buildMinimalRings(),u=r.findShell(a);u!==null?(r.placePolygonHoles(u,a),e.add(u)):n.addAll(a)}else i.add(s)}return i};ve.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();){var n=e.next();if(n.containsPoint(t))return!0}return!1};ve.prototype.buildMaximalEdgeRings=function(t){for(var e=this,n=new O,r=t.iterator();r.hasNext();){var i=r.next();if(i.isInResult()&&i.getLabel().isArea()&&i.getEdgeRing()===null){var o=new Pp(i,e._geometryFactory);n.add(o),o.setInResult()}}return n};ve.prototype.placePolygonHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();r.isHole()&&r.setShell(t)}};ve.prototype.getPolygons=function(){var t=this.computePolygons(this._shellList);return t};ve.prototype.findEdgeRingContaining=function(t,e){for(var n=t.getLinearRing(),r=n.getEnvelopeInternal(),i=n.getCoordinateN(0),o=null,s=null,a=e.iterator();a.hasNext();){var u=a.next(),l=u.getLinearRing(),c=l.getEnvelopeInternal();o!==null&&(s=o.getLinearRing().getEnvelopeInternal());var p=!1;c.contains(r)&&M.isPointInRing(i,l.getCoordinates())&&(p=!0),p&&(o===null||s.contains(c))&&(o=u)}return o};ve.prototype.findShell=function(t){for(var e=0,n=null,r=t.iterator();r.hasNext();){var i=r.next();i.isHole()||(n=i,e++)}return $.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n};ve.prototype.add=function(){if(arguments.length===1){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(arguments.length===2){var e=arguments[0],n=arguments[1];dt.linkResultDirectedEdges(n);var r=this.buildMaximalEdgeRings(e),i=new O,o=this.buildMinimalEdgeRings(r,this._shellList,i);this.sortShellsAndHoles(o,this._shellList,i),this.placeFreeHoles(this._shellList,i)}};ve.prototype.interfaces_=function(){return[]};ve.prototype.getClass=function(){return ve};var Ti=function(){};Ti.prototype.getBounds=function(){};Ti.prototype.interfaces_=function(){return[]};Ti.prototype.getClass=function(){return Ti};var We=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};We.prototype.getItem=function(){return this._item};We.prototype.getBounds=function(){return this._bounds};We.prototype.interfaces_=function(){return[Ti,ze]};We.prototype.getClass=function(){return We};var tr=function(){this._size=null,this._items=null,this._size=0,this._items=new O,this._items.add(null)};tr.prototype.poll=function(){if(this.isEmpty())return null;var t=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),t};tr.prototype.size=function(){return this._size};tr.prototype.reorder=function(t){for(var e=this,n=null,r=this._items.get(t);t*2<=this._size&&(n=t*2,n!==e._size&&e._items.get(n+1).compareTo(e._items.get(n))<0&&n++,e._items.get(n).compareTo(r)<0);t=n)e._items.set(t,e._items.get(n));this._items.set(t,r)};tr.prototype.clear=function(){this._size=0,this._items.clear()};tr.prototype.isEmpty=function(){return this._size===0};tr.prototype.add=function(t){var e=this;this._items.add(null),this._size+=1;var n=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(n/2)))<0;n/=2)e._items.set(n,e._items.get(Math.trunc(n/2)));this._items.set(n,t)};tr.prototype.interfaces_=function(){return[]};tr.prototype.getClass=function(){return tr};var fr=function(){};fr.prototype.visitItem=function(t){};fr.prototype.interfaces_=function(){return[]};fr.prototype.getClass=function(){return fr};var Zr=function(){};Zr.prototype.insert=function(t,e){};Zr.prototype.remove=function(t,e){};Zr.prototype.query=function(){};Zr.prototype.interfaces_=function(){return[]};Zr.prototype.getClass=function(){return Zr};var At=function(){if(this._childBoundables=new O,this._bounds=null,this._level=null,arguments.length!==0&&arguments.length===1){var t=arguments[0];this._level=t}},Gu={serialVersionUID:{configurable:!0}};At.prototype.getLevel=function(){return this._level};At.prototype.size=function(){return this._childBoundables.size()};At.prototype.getChildBoundables=function(){return this._childBoundables};At.prototype.addChildBoundable=function(t){$.isTrue(this._bounds===null),this._childBoundables.add(t)};At.prototype.isEmpty=function(){return this._childBoundables.isEmpty()};At.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds};At.prototype.interfaces_=function(){return[Ti,ze]};At.prototype.getClass=function(){return At};Gu.serialVersionUID.get=function(){return 6493722185909574e3};Object.defineProperties(At,Gu);var He=function(){};He.reverseOrder=function(){return{compare:function(t,e){return e.compareTo(t)}}};He.min=function(t){return He.sort(t),t.get(0)};He.sort=function(t,e){var n=t.toArray();e?wr.sort(n,e):wr.sort(n);for(var r=t.iterator(),i=0,o=n.length;i<o;i++)r.next(),r.set(n[i])};He.singletonList=function(t){var e=new O;return e.add(t),e};var wt=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var t=arguments[0],e=arguments[1],n=arguments[2];this._boundable1=t,this._boundable2=e,this._itemDistance=n,this._distance=this.distance()};wt.prototype.expandToQueue=function(t,e){var n=wt.isComposite(this._boundable1),r=wt.isComposite(this._boundable2);if(n&&r)return wt.area(this._boundable1)>wt.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(n)return this.expand(this._boundable1,this._boundable2,t,e),null;if(r)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new ft("neither boundable is composite")};wt.prototype.isLeaves=function(){return!(wt.isComposite(this._boundable1)||wt.isComposite(this._boundable2))};wt.prototype.compareTo=function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0};wt.prototype.expand=function(t,e,n,r){for(var i=this,o=t.getChildBoundables(),s=o.iterator();s.hasNext();){var a=s.next(),u=new wt(a,e,i._itemDistance);u.getDistance()<r&&n.add(u)}};wt.prototype.getBoundable=function(t){return t===0?this._boundable1:this._boundable2};wt.prototype.getDistance=function(){return this._distance};wt.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())};wt.prototype.interfaces_=function(){return[Be]};wt.prototype.getClass=function(){return wt};wt.area=function(t){return t.getBounds().getArea()};wt.isComposite=function(t){return t instanceof At};var kt=function t(){if(this._root=null,this._built=!1,this._itemBoundables=new O,this._nodeCapacity=null,arguments.length===0){var e=t.DEFAULT_NODE_CAPACITY;this._nodeCapacity=e}else if(arguments.length===1){var n=arguments[0];$.isTrue(n>1,"Node capacity must be greater than 1"),this._nodeCapacity=n}},hs={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};kt.prototype.getNodeCapacity=function(){return this._nodeCapacity};kt.prototype.lastNode=function(t){return t.get(t.size()-1)};kt.prototype.size=function(){var t=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var e=arguments[0],n=0,r=e.getChildBoundables().iterator();r.hasNext();){var i=r.next();i instanceof At?n+=t.size(i):i instanceof We&&(n+=1)}return n}};kt.prototype.removeItem=function(t,e){for(var n=null,r=t.getChildBoundables().iterator();r.hasNext();){var i=r.next();i instanceof We&&i.getItem()===e&&(n=i)}return n!==null?(t.getChildBoundables().remove(n),!0):!1};kt.prototype.itemsTree=function(){var t=this;if(arguments.length===0){this.build();var e=this.itemsTree(this._root);return e===null?new O:e}else if(arguments.length===1){for(var n=arguments[0],r=new O,i=n.getChildBoundables().iterator();i.hasNext();){var o=i.next();if(o instanceof At){var s=t.itemsTree(o);s!==null&&r.add(s)}else o instanceof We?r.add(o.getItem()):$.shouldNeverReachHere()}return r.size()<=0?null:r}};kt.prototype.insert=function(t,e){$.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new We(t,e))};kt.prototype.boundablesAtLevel=function(){var t=this;if(arguments.length===1){var e=arguments[0],n=new O;return this.boundablesAtLevel(e,this._root,n),n}else if(arguments.length===3){var r=arguments[0],i=arguments[1],o=arguments[2];if($.isTrue(r>-2),i.getLevel()===r)return o.add(i),null;for(var s=i.getChildBoundables().iterator();s.hasNext();){var a=s.next();a instanceof At?t.boundablesAtLevel(r,a,o):($.isTrue(a instanceof We),r===-1&&o.add(a))}return null}};kt.prototype.query=function(){var t=this;if(arguments.length===1){var e=arguments[0];this.build();var n=new O;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),e)&&this.query(e,this._root,n),n}else if(arguments.length===2){var r=arguments[0],i=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),r)&&this.query(r,this._root,i)}else if(arguments.length===3){if(z(arguments[2],fr)&&arguments[0]instanceof Object&&arguments[1]instanceof At)for(var o=arguments[0],s=arguments[1],a=arguments[2],u=s.getChildBoundables(),l=0;l<u.size();l++){var c=u.get(l);t.getIntersectsOp().intersects(c.getBounds(),o)&&(c instanceof At?t.query(o,c,a):c instanceof We?a.visitItem(c.getItem()):$.shouldNeverReachHere())}else if(z(arguments[2],Xe)&&arguments[0]instanceof Object&&arguments[1]instanceof At)for(var p=arguments[0],h=arguments[1],g=arguments[2],f=h.getChildBoundables(),m=0;m<f.size();m++){var y=f.get(m);t.getIntersectsOp().intersects(y.getBounds(),p)&&(y instanceof At?t.query(p,y,g):y instanceof We?g.add(y.getItem()):$.shouldNeverReachHere())}}};kt.prototype.build=function(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0};kt.prototype.getRoot=function(){return this.build(),this._root};kt.prototype.remove=function(){var t=this;if(arguments.length===2){var e=arguments[0],n=arguments[1];return this.build(),this.getIntersectsOp().intersects(this._root.getBounds(),e)?this.remove(e,this._root,n):!1}else if(arguments.length===3){var r=arguments[0],i=arguments[1],o=arguments[2],s=this.removeItem(i,o);if(s)return!0;for(var a=null,u=i.getChildBoundables().iterator();u.hasNext();){var l=u.next();if(t.getIntersectsOp().intersects(l.getBounds(),r)&&l instanceof At&&(s=t.remove(r,l,o),s)){a=l;break}}return a!==null&&a.getChildBoundables().isEmpty()&&i.getChildBoundables().remove(a),s}};kt.prototype.createHigherLevels=function(t,e){$.isTrue(!t.isEmpty());var n=this.createParentBoundables(t,e+1);return n.size()===1?n.get(0):this.createHigherLevels(n,e+1)};kt.prototype.depth=function(){var t=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(arguments.length===1){for(var e=arguments[0],n=0,r=e.getChildBoundables().iterator();r.hasNext();){var i=r.next();if(i instanceof At){var o=t.depth(i);o>n&&(n=o)}}return n+1}};kt.prototype.createParentBoundables=function(t,e){var n=this;$.isTrue(!t.isEmpty());var r=new O;r.add(this.createNode(e));var i=new O(t);He.sort(i,this.getComparator());for(var o=i.iterator();o.hasNext();){var s=o.next();n.lastNode(r).getChildBoundables().size()===n.getNodeCapacity()&&r.add(n.createNode(e)),n.lastNode(r).addChildBoundable(s)}return r};kt.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()};kt.prototype.interfaces_=function(){return[ze]};kt.prototype.getClass=function(){return kt};kt.compareDoubles=function(t,e){return t>e?1:t<e?-1:0};hs.IntersectsOp.get=function(){return Mp};hs.serialVersionUID.get=function(){return-3886435814360241e3};hs.DEFAULT_NODE_CAPACITY.get=function(){return 10};Object.defineProperties(kt,hs);var Mp=function(){},Ri=function(){};Ri.prototype.distance=function(t,e){};Ri.prototype.interfaces_=function(){return[]};Ri.prototype.getClass=function(){return Ri};var ku=function(t){function e(r){r=r||e.DEFAULT_NODE_CAPACITY,t.call(this,r)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return e.prototype.createParentBoundablesFromVerticalSlices=function(r,i){var o=this;$.isTrue(r.length>0);for(var s=new O,a=0;a<r.length;a++)s.addAll(o.createParentBoundablesFromVerticalSlice(r[a],i));return s},e.prototype.createNode=function(r){return new Xa(r)},e.prototype.size=function(){return arguments.length===0?t.prototype.size.call(this):t.prototype.size.apply(this,arguments)},e.prototype.insert=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];if(r.isNull())return null;t.prototype.insert.call(this,r,i)}else return t.prototype.insert.apply(this,arguments)},e.prototype.getIntersectsOp=function(){return e.intersectsOp},e.prototype.verticalSlices=function(r,i){for(var o=Math.trunc(Math.ceil(r.size()/i)),s=new Array(i).fill(null),a=r.iterator(),u=0;u<i;u++){s[u]=new O;for(var l=0;a.hasNext()&&l<o;){var c=a.next();s[u].add(c),l++}}return s},e.prototype.query=function(){if(arguments.length===1){var r=arguments[0];return t.prototype.query.call(this,r)}else if(arguments.length===2){var i=arguments[0],o=arguments[1];t.prototype.query.call(this,i,o)}else if(arguments.length===3){if(z(arguments[2],fr)&&arguments[0]instanceof Object&&arguments[1]instanceof At){var s=arguments[0],a=arguments[1],u=arguments[2];t.prototype.query.call(this,s,a,u)}else if(z(arguments[2],Xe)&&arguments[0]instanceof Object&&arguments[1]instanceof At){var l=arguments[0],c=arguments[1],p=arguments[2];t.prototype.query.call(this,l,c,p)}}},e.prototype.getComparator=function(){return e.yComparator},e.prototype.createParentBoundablesFromVerticalSlice=function(r,i){return t.prototype.createParentBoundables.call(this,r,i)},e.prototype.remove=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];return t.prototype.remove.call(this,r,i)}else return t.prototype.remove.apply(this,arguments)},e.prototype.depth=function(){return arguments.length===0?t.prototype.depth.call(this):t.prototype.depth.apply(this,arguments)},e.prototype.createParentBoundables=function(r,i){$.isTrue(!r.isEmpty());var o=Math.trunc(Math.ceil(r.size()/this.getNodeCapacity())),s=new O(r);He.sort(s,e.xComparator);var a=this.verticalSlices(s,Math.trunc(Math.ceil(Math.sqrt(o))));return this.createParentBoundablesFromVerticalSlices(a,i)},e.prototype.nearestNeighbour=function(){if(arguments.length===1){if(z(arguments[0],Ri)){var r=arguments[0],i=new wt(this.getRoot(),this.getRoot(),r);return this.nearestNeighbour(i)}else if(arguments[0]instanceof wt){var o=arguments[0];return this.nearestNeighbour(o,U.POSITIVE_INFINITY)}}else if(arguments.length===2){if(arguments[0]instanceof e&&z(arguments[1],Ri)){var s=arguments[0],a=arguments[1],u=new wt(this.getRoot(),s.getRoot(),a);return this.nearestNeighbour(u)}else if(arguments[0]instanceof wt&&typeof arguments[1]=="number"){var l=arguments[0],c=arguments[1],p=c,h=null,g=new tr;for(g.add(l);!g.isEmpty()&&p>0;){var f=g.poll(),m=f.getDistance();if(m>=p)break;f.isLeaves()?(p=m,h=f):f.expandToQueue(g,p)}return[h.getBoundable(0).getItem(),h.getBoundable(1).getItem()]}}else if(arguments.length===3){var y=arguments[0],v=arguments[1],x=arguments[2],I=new We(y,v),C=new wt(this.getRoot(),I,x);return this.nearestNeighbour(C)[0]}},e.prototype.interfaces_=function(){return[Zr,ze]},e.prototype.getClass=function(){return e},e.centreX=function(r){return e.avg(r.getMinX(),r.getMaxX())},e.avg=function(r,i){return(r+i)/2},e.centreY=function(r){return e.avg(r.getMinY(),r.getMaxY())},n.STRtreeNode.get=function(){return Xa},n.serialVersionUID.get=function(){return 0x39920f7d5f261e0},n.xComparator.get=function(){return{interfaces_:function(){return[Ei]},compare:function(r,i){return t.compareDoubles(e.centreX(r.getBounds()),e.centreX(i.getBounds()))}}},n.yComparator.get=function(){return{interfaces_:function(){return[Ei]},compare:function(r,i){return t.compareDoubles(e.centreY(r.getBounds()),e.centreY(i.getBounds()))}}},n.intersectsOp.get=function(){return{interfaces_:function(){return[t.IntersectsOp]},intersects:function(r,i){return r.intersects(i)}}},n.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(e,n),e}(kt),Xa=function(t){function e(){var n=arguments[0];t.call(this,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.computeBounds=function(){for(var n=null,r=this.getChildBoundables().iterator();r.hasNext();){var i=r.next();n===null?n=new F(i.getBounds()):n.expandToInclude(i.getBounds())}return n},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(At),pe=function(){};pe.prototype.interfaces_=function(){return[]};pe.prototype.getClass=function(){return pe};pe.relativeSign=function(t,e){return t<e?-1:t>e?1:0};pe.compare=function(t,e,n){if(e.equals2D(n))return 0;var r=pe.relativeSign(e.x,n.x),i=pe.relativeSign(e.y,n.y);switch(t){case 0:return pe.compareValue(r,i);case 1:return pe.compareValue(i,r);case 2:return pe.compareValue(i,-r);case 3:return pe.compareValue(-r,i);case 4:return pe.compareValue(-r,-i);case 5:return pe.compareValue(-i,-r);case 6:return pe.compareValue(-i,r);case 7:return pe.compareValue(r,-i)}return $.shouldNeverReachHere("invalid octant value"),0};pe.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var gr=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this._segString=t,this.coord=new d(e),this.segmentIndex=n,this._segmentOctant=r,this._isInterior=!e.equals2D(t.getCoordinate(n))};gr.prototype.getCoordinate=function(){return this.coord};gr.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)};gr.prototype.compareTo=function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:pe.compare(this._segmentOctant,this.coord,e.coord)};gr.prototype.isEndPoint=function(t){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===t};gr.prototype.isInterior=function(){return this._isInterior};gr.prototype.interfaces_=function(){return[Be]};gr.prototype.getClass=function(){return gr};var le=function(){this._nodeMap=new Jt,this._edge=null;var t=arguments[0];this._edge=t};le.prototype.getSplitCoordinates=function(){var t=this,e=new vo;this.addEndpoints();for(var n=this.iterator(),r=n.next();n.hasNext();){var i=n.next();t.addEdgeCoordinates(r,i,e),r=i}return e.toCoordinateArray()};le.prototype.addCollapsedNodes=function(){var t=this,e=new O;this.findCollapsesFromInsertedNodes(e),this.findCollapsesFromExistingVertices(e);for(var n=e.iterator();n.hasNext();){var r=n.next().intValue();t.add(t._edge.getCoordinate(r),r)}};le.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}};le.prototype.findCollapsesFromExistingVertices=function(t){for(var e=this,n=0;n<this._edge.size()-2;n++){var r=e._edge.getCoordinate(n),i=e._edge.getCoordinate(n+2);r.equals2D(i)&&t.add(new pn(n+1))}};le.prototype.addEdgeCoordinates=function(t,e,n){var r=this,i=this._edge.getCoordinate(e.segmentIndex),o=e.isInterior()||!e.coord.equals2D(i);n.add(new d(t.coord),!1);for(var s=t.segmentIndex+1;s<=e.segmentIndex;s++)n.add(r._edge.getCoordinate(s));o&&n.add(new d(e.coord))};le.prototype.iterator=function(){return this._nodeMap.values().iterator()};le.prototype.addSplitEdges=function(t){var e=this;this.addEndpoints(),this.addCollapsedNodes();for(var n=this.iterator(),r=n.next();n.hasNext();){var i=n.next(),o=e.createSplitEdge(r,i);t.add(o),r=i}};le.prototype.findCollapseIndex=function(t,e,n){if(!t.coord.equals2D(e.coord))return!1;var r=e.segmentIndex-t.segmentIndex;return e.isInterior()||r--,r===1?(n[0]=t.segmentIndex+1,!0):!1};le.prototype.findCollapsesFromInsertedNodes=function(t){for(var e=this,n=new Array(1).fill(null),r=this.iterator(),i=r.next();r.hasNext();){var o=r.next(),s=e.findCollapseIndex(i,o,n);s&&t.add(new pn(n[0])),i=o}};le.prototype.getEdge=function(){return this._edge};le.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)};le.prototype.createSplitEdge=function(t,e){var n=this,r=e.segmentIndex-t.segmentIndex+2,i=this._edge.getCoordinate(e.segmentIndex),o=e.isInterior()||!e.coord.equals2D(i);o||r--;var s=new Array(r).fill(null),a=0;s[a++]=new d(t.coord);for(var u=t.segmentIndex+1;u<=e.segmentIndex;u++)s[a++]=n._edge.getCoordinate(u);return o&&(s[a]=new d(e.coord)),new Lt(s,this._edge.getData())};le.prototype.add=function(t,e){var n=new gr(this._edge,t,e,this._edge.getSegmentOctant(e)),r=this._nodeMap.get(n);return r!==null?($.isTrue(r.coord.equals2D(t),"Found equal nodes with different coordinates"),r):(this._nodeMap.put(n,n),n)};le.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),n=t.get(0),r=n.getCoordinate(0);if(!r.equals2D(e[0]))throw new Kn("bad split edge start point at "+r);var i=t.get(t.size()-1),o=i.getCoordinates(),s=o[o.length-1];if(!s.equals2D(e[e.length-1]))throw new Kn("bad split edge end point at "+s)};le.prototype.interfaces_=function(){return[]};le.prototype.getClass=function(){return le};var Kr=function(){};Kr.prototype.interfaces_=function(){return[]};Kr.prototype.getClass=function(){return Kr};Kr.octant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];if(t===0&&e===0)throw new ft("Cannot compute the octant for point ( "+t+", "+e+" )");var n=Math.abs(t),r=Math.abs(e);return t>=0?e>=0?n>=r?0:1:n>=r?7:6:e>=0?n>=r?3:2:n>=r?4:5}else if(arguments[0]instanceof d&&arguments[1]instanceof d){var i=arguments[0],o=arguments[1],s=o.x-i.x,a=o.y-i.y;if(s===0&&a===0)throw new ft("Cannot compute the octant for two identical points "+i);return Kr.octant(s,a)}};var Mn=function(){};Mn.prototype.getCoordinates=function(){};Mn.prototype.size=function(){};Mn.prototype.getCoordinate=function(t){};Mn.prototype.isClosed=function(){};Mn.prototype.setData=function(t){};Mn.prototype.getData=function(){};Mn.prototype.interfaces_=function(){return[]};Mn.prototype.getClass=function(){return Mn};var lo=function(){};lo.prototype.addIntersection=function(t,e){};lo.prototype.interfaces_=function(){return[Mn]};lo.prototype.getClass=function(){return lo};var Lt=function(){this._nodeList=new le(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Lt.prototype.getCoordinates=function(){return this._pts};Lt.prototype.size=function(){return this._pts.length};Lt.prototype.getCoordinate=function(t){return this._pts[t]};Lt.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])};Lt.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))};Lt.prototype.setData=function(t){this._data=t};Lt.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:Kr.octant(t,e)};Lt.prototype.getData=function(){return this._data};Lt.prototype.addIntersection=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(arguments.length===4){var n=arguments[0],r=arguments[1],i=arguments[3],o=new d(n.getIntersection(i));this.addIntersection(o,r)}};Lt.prototype.toString=function(){return je.toLineString(new xt(this._pts))};Lt.prototype.getNodeList=function(){return this._nodeList};Lt.prototype.addIntersectionNode=function(t,e){var n=e,r=n+1;if(r<this._pts.length){var i=this._pts[r];t.equals2D(i)&&(n=r)}var o=this._nodeList.add(t,n);return o};Lt.prototype.addIntersections=function(t,e,n){for(var r=this,i=0;i<t.getIntersectionNum();i++)r.addIntersection(t,e,n,i)};Lt.prototype.interfaces_=function(){return[lo]};Lt.prototype.getClass=function(){return Lt};Lt.getNodedSubstrings=function(){if(arguments.length===1){var t=arguments[0],e=new O;return Lt.getNodedSubstrings(t,e),e}else if(arguments.length===2)for(var n=arguments[0],r=arguments[1],i=n.iterator();i.hasNext();){var o=i.next();o.getNodeList().addSplitEdges(r)}};var G=function(){if(this.p0=null,this.p1=null,arguments.length===0)this.p0=new d,this.p1=new d;else if(arguments.length===1){var t=arguments[0];this.p0=new d(t.p0),this.p1=new d(t.p1)}else if(arguments.length===2)this.p0=arguments[0],this.p1=arguments[1];else if(arguments.length===4){var e=arguments[0],n=arguments[1],r=arguments[2],i=arguments[3];this.p0=new d(e,n),this.p1=new d(r,i)}},qu={serialVersionUID:{configurable:!0}};G.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)};G.prototype.orientationIndex=function(){if(arguments[0]instanceof G){var t=arguments[0],e=M.orientationIndex(this.p0,this.p1,t.p0),n=M.orientationIndex(this.p0,this.p1,t.p1);return e>=0&&n>=0||e<=0&&n<=0?Math.max(e,n):0}else if(arguments[0]instanceof d){var r=arguments[0];return M.orientationIndex(this.p0,this.p1,r)}};G.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])};G.prototype.isVertical=function(){return this.p0.x===this.p1.x};G.prototype.equals=function(t){if(!(t instanceof G))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)};G.prototype.intersection=function(t){var e=new Xr;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null};G.prototype.project=function(){if(arguments[0]instanceof d){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new d(t);var e=this.projectionFactor(t),n=new d;return n.x=this.p0.x+e*(this.p1.x-this.p0.x),n.y=this.p0.y+e*(this.p1.y-this.p0.y),n}else if(arguments[0]instanceof G){var r=arguments[0],i=this.projectionFactor(r.p0),o=this.projectionFactor(r.p1);if(i>=1&&o>=1||i<=0&&o<=0)return null;var s=this.project(r.p0);i<0&&(s=this.p0),i>1&&(s=this.p1);var a=this.project(r.p1);return o<0&&(a=this.p0),o>1&&(a=this.p1),new G(s,a)}};G.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()};G.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)};G.prototype.getCoordinate=function(t){return t===0?this.p0:this.p1};G.prototype.distancePerpendicular=function(t){return M.distancePointLinePerpendicular(t,this.p0,this.p1)};G.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)};G.prototype.midPoint=function(){return G.midPoint(this.p0,this.p1)};G.prototype.projectionFactor=function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,r=e*e+n*n;if(r<=0)return U.NaN;var i=((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/r;return i};G.prototype.closestPoints=function(t){var e=this.intersection(t);if(e!==null)return[e,e];var n=new Array(2).fill(null),r=U.MAX_VALUE,i=null,o=this.closestPoint(t.p0);r=o.distance(t.p0),n[0]=o,n[1]=t.p0;var s=this.closestPoint(t.p1);i=s.distance(t.p1),i<r&&(r=i,n[0]=s,n[1]=t.p1);var a=t.closestPoint(this.p0);i=a.distance(this.p0),i<r&&(r=i,n[0]=this.p0,n[1]=a);var u=t.closestPoint(this.p1);return i=u.distance(this.p1),i<r&&(r=i,n[0]=this.p1,n[1]=u),n};G.prototype.closestPoint=function(t){var e=this.projectionFactor(t);if(e>0&&e<1)return this.project(t);var n=this.p0.distance(t),r=this.p1.distance(t);return n<r?this.p0:this.p1};G.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)};G.prototype.getLength=function(){return this.p0.distance(this.p1)};G.prototype.compareTo=function(t){var e=t,n=this.p0.compareTo(e.p0);return n!==0?n:this.p1.compareTo(e.p1)};G.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t};G.prototype.equalsTopo=function(t){return this.p0.equals(t.p0)&&(this.p1.equals(t.p1)||this.p0.equals(t.p1))&&this.p1.equals(t.p0)};G.prototype.lineIntersection=function(t){try{var e=$e.intersection(this.p0,this.p1,t.p0,t.p1);return e}catch(n){if(!(n instanceof zi))throw n}finally{}return null};G.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)};G.prototype.pointAlongOffset=function(t,e){var n=this.p0.x+t*(this.p1.x-this.p0.x),r=this.p0.y+t*(this.p1.y-this.p0.y),i=this.p1.x-this.p0.x,o=this.p1.y-this.p0.y,s=Math.sqrt(i*i+o*o),a=0,u=0;if(e!==0){if(s<=0)throw new Error("Cannot compute offset from zero-length line segment");a=e*i/s,u=e*o/s}var l=n-u,c=r+a,p=new d(l,c);return p};G.prototype.setCoordinates=function(){if(arguments.length===1){var t=arguments[0];this.setCoordinates(t.p0,t.p1)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this.p0.x=e.x,this.p0.y=e.y,this.p1.x=n.x,this.p1.y=n.y}};G.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||U.isNaN(e))&&(e=1),e};G.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"};G.prototype.isHorizontal=function(){return this.p0.y===this.p1.y};G.prototype.distance=function(){if(arguments[0]instanceof G){var t=arguments[0];return M.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}else if(arguments[0]instanceof d){var e=arguments[0];return M.distancePointLine(e,this.p0,this.p1)}};G.prototype.pointAlong=function(t){var e=new d;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e};G.prototype.hashCode=function(){var t=U.doubleToLongBits(this.p0.x);t^=U.doubleToLongBits(this.p0.y)*31;var e=Math.trunc(t)^Math.trunc(t>>32),n=U.doubleToLongBits(this.p1.x);n^=U.doubleToLongBits(this.p1.y)*31;var r=Math.trunc(n)^Math.trunc(n>>32);return e^r};G.prototype.interfaces_=function(){return[Be,ze]};G.prototype.getClass=function(){return G};G.midPoint=function(t,e){return new d((t.x+e.x)/2,(t.y+e.y)/2)};qu.serialVersionUID.get=function(){return 0x2d2172135f411c00};Object.defineProperties(G,qu);var co=function(){this.tempEnv1=new F,this.tempEnv2=new F,this._overlapSeg1=new G,this._overlapSeg2=new G};co.prototype.overlap=function(){if(arguments.length!==2&&arguments.length===4){var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];t.getLineSegment(e,this._overlapSeg1),n.getLineSegment(r,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}};co.prototype.interfaces_=function(){return[]};co.prototype.getClass=function(){return co};var Ee=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this._pts=t,this._start=e,this._end=n,this._context=r};Ee.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]};Ee.prototype.computeSelect=function(t,e,n,r){var i=this._pts[e],o=this._pts[n];if(r.tempEnv1.init(i,o),n-e===1)return r.select(this,e),null;if(!t.intersects(r.tempEnv1))return null;var s=Math.trunc((e+n)/2);e<s&&this.computeSelect(t,e,s,r),s<n&&this.computeSelect(t,s,n,r)};Ee.prototype.getCoordinates=function(){for(var t=this,e=new Array(this._end-this._start+1).fill(null),n=0,r=this._start;r<=this._end;r++)e[n++]=t._pts[r];return e};Ee.prototype.computeOverlaps=function(t,e){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,e)};Ee.prototype.setId=function(t){this._id=t};Ee.prototype.select=function(t,e){this.computeSelect(t,this._start,this._end,e)};Ee.prototype.getEnvelope=function(){if(this._env===null){var t=this._pts[this._start],e=this._pts[this._end];this._env=new F(t,e)}return this._env};Ee.prototype.getEndIndex=function(){return this._end};Ee.prototype.getStartIndex=function(){return this._start};Ee.prototype.getContext=function(){return this._context};Ee.prototype.getId=function(){return this._id};Ee.prototype.computeOverlapsInternal=function(t,e,n,r,i,o){var s=this._pts[t],a=this._pts[e],u=n._pts[r],l=n._pts[i];if(e-t===1&&i-r===1)return o.overlap(this,t,n,r),null;if(o.tempEnv1.init(s,a),o.tempEnv2.init(u,l),!o.tempEnv1.intersects(o.tempEnv2))return null;var c=Math.trunc((t+e)/2),p=Math.trunc((r+i)/2);t<c&&(r<p&&this.computeOverlapsInternal(t,c,n,r,p,o),p<i&&this.computeOverlapsInternal(t,c,n,p,i,o)),c<e&&(r<p&&this.computeOverlapsInternal(c,e,n,r,p,o),p<i&&this.computeOverlapsInternal(c,e,n,p,i,o))};Ee.prototype.interfaces_=function(){return[]};Ee.prototype.getClass=function(){return Ee};var cn=function(){};cn.prototype.interfaces_=function(){return[]};cn.prototype.getClass=function(){return cn};cn.getChainStartIndices=function(t){var e=0,n=new O;n.add(new pn(e));do{var r=cn.findChainEnd(t,e);n.add(new pn(r)),e=r}while(e<t.length-1);var i=cn.toIntArray(n);return i};cn.findChainEnd=function(t,e){for(var n=e;n<t.length-1&&t[n].equals2D(t[n+1]);)n++;if(n>=t.length-1)return t.length-1;for(var r=ot.quadrant(t[n],t[n+1]),i=e+1;i<t.length;){if(!t[i-1].equals2D(t[i])){var o=ot.quadrant(t[i-1],t[i]);if(o!==r)break}i++}return i-1};cn.getChains=function(){if(arguments.length===1){var t=arguments[0];return cn.getChains(t,null)}else if(arguments.length===2){for(var e=arguments[0],n=arguments[1],r=new O,i=cn.getChainStartIndices(e),o=0;o<i.length-1;o++){var s=new Ee(e,i[o],i[o+1],n);r.add(s)}return r}};cn.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e};var Dr=function(){};Dr.prototype.computeNodes=function(t){};Dr.prototype.getNodedSubstrings=function(){};Dr.prototype.interfaces_=function(){return[]};Dr.prototype.getClass=function(){return Dr};var po=function(){if(this._segInt=null,arguments.length!==0&&arguments.length===1){var t=arguments[0];this.setSegmentIntersector(t)}};po.prototype.setSegmentIntersector=function(t){this._segInt=t};po.prototype.interfaces_=function(){return[Dr]};po.prototype.getClass=function(){return po};var ta=function(t){function e(r){r?t.call(this,r):t.call(this),this._monoChains=new O,this._index=new ku,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={SegmentOverlapAction:{configurable:!0}};return e.prototype.getMonotoneChains=function(){return this._monoChains},e.prototype.getNodedSubstrings=function(){return Lt.getNodedSubstrings(this._nodedSegStrings)},e.prototype.getIndex=function(){return this._index},e.prototype.add=function(r){for(var i=this,o=cn.getChains(r.getCoordinates(),r),s=o.iterator();s.hasNext();){var a=s.next();a.setId(i._idCounter++),i._index.insert(a.getEnvelope(),a),i._monoChains.add(a)}},e.prototype.computeNodes=function(r){var i=this;this._nodedSegStrings=r;for(var o=r.iterator();o.hasNext();)i.add(o.next());this.intersectChains()},e.prototype.intersectChains=function(){for(var r=this,i=new ja(this._segInt),o=this._monoChains.iterator();o.hasNext();)for(var s=o.next(),a=r._index.query(s.getEnvelope()),u=a.iterator();u.hasNext();){var l=u.next();if(l.getId()>s.getId()&&(s.computeOverlaps(l,i),r._nOverlaps++),r._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.SegmentOverlapAction.get=function(){return ja},Object.defineProperties(e,n),e}(po),ja=function(t){function e(){t.call(this),this._si=null;var n=arguments[0];this._si=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.overlap=function(){if(arguments.length===4){var n=arguments[0],r=arguments[1],i=arguments[2],o=arguments[3],s=n.getContext(),a=i.getContext();this._si.processIntersections(s,r,a,o)}else return t.prototype.overlap.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(co),J=function t(){if(this._quadrantSegments=t.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=t.CAP_ROUND,this._joinStyle=t.JOIN_ROUND,this._mitreLimit=t.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=t.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var e=arguments[0];this.setQuadrantSegments(e)}else if(arguments.length===2){var n=arguments[0],r=arguments[1];this.setQuadrantSegments(n),this.setEndCapStyle(r)}else if(arguments.length===4){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(o),this.setJoinStyle(s),this.setMitreLimit(a)}}},ir={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};J.prototype.getEndCapStyle=function(){return this._endCapStyle};J.prototype.isSingleSided=function(){return this._isSingleSided};J.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,this._quadrantSegments===0&&(this._joinStyle=J.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=J.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==J.JOIN_ROUND&&(this._quadrantSegments=J.DEFAULT_QUADRANT_SEGMENTS)};J.prototype.getJoinStyle=function(){return this._joinStyle};J.prototype.setJoinStyle=function(t){this._joinStyle=t};J.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t};J.prototype.getSimplifyFactor=function(){return this._simplifyFactor};J.prototype.getQuadrantSegments=function(){return this._quadrantSegments};J.prototype.setEndCapStyle=function(t){this._endCapStyle=t};J.prototype.getMitreLimit=function(){return this._mitreLimit};J.prototype.setMitreLimit=function(t){this._mitreLimit=t};J.prototype.setSingleSided=function(t){this._isSingleSided=t};J.prototype.interfaces_=function(){return[]};J.prototype.getClass=function(){return J};J.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)};ir.CAP_ROUND.get=function(){return 1};ir.CAP_FLAT.get=function(){return 2};ir.CAP_SQUARE.get=function(){return 3};ir.JOIN_ROUND.get=function(){return 1};ir.JOIN_MITRE.get=function(){return 2};ir.JOIN_BEVEL.get=function(){return 3};ir.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8};ir.DEFAULT_MITRE_LIMIT.get=function(){return 5};ir.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01};Object.defineProperties(J,ir);var vt=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=M.COUNTERCLOCKWISE,this._inputLine=t||null},Io={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};vt.prototype.isDeletable=function(t,e,n,r){var i=this._inputLine[t],o=this._inputLine[e],s=this._inputLine[n];return!this.isConcave(i,o,s)||!this.isShallow(i,o,s,r)?!1:this.isShallowSampled(i,o,t,n,r)};vt.prototype.deleteShallowConcavities=function(){for(var t=this,e=1,n=this.findNextNonDeletedIndex(e),r=this.findNextNonDeletedIndex(n),i=!1;r<this._inputLine.length;){var o=!1;t.isDeletable(e,n,r,t._distanceTol)&&(t._isDeleted[n]=vt.DELETE,o=!0,i=!0),o?e=r:e=n,n=t.findNextNonDeletedIndex(e),r=t.findNextNonDeletedIndex(n)}return i};vt.prototype.isShallowConcavity=function(t,e,n,r){var i=M.computeOrientation(t,e,n),o=i===this._angleOrientation;if(!o)return!1;var s=M.distancePointLine(e,t,n);return s<r};vt.prototype.isShallowSampled=function(t,e,n,r,i){var o=this,s=Math.trunc((r-n)/vt.NUM_PTS_TO_CHECK);s<=0&&(s=1);for(var a=n;a<r;a+=s)if(!o.isShallow(t,e,o._inputLine[a],i))return!1;return!0};vt.prototype.isConcave=function(t,e,n){var r=M.computeOrientation(t,e,n),i=r===this._angleOrientation;return i};vt.prototype.simplify=function(t){var e=this;this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=M.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var n=!1;do n=e.deleteShallowConcavities();while(n);return this.collapseLine()};vt.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===vt.DELETE;)e++;return e};vt.prototype.isShallow=function(t,e,n,r){var i=M.distancePointLine(e,t,n);return i<r};vt.prototype.collapseLine=function(){for(var t=this,e=new vo,n=0;n<this._inputLine.length;n++)t._isDeleted[n]!==vt.DELETE&&e.add(t._inputLine[n]);return e.toCoordinateArray()};vt.prototype.interfaces_=function(){return[]};vt.prototype.getClass=function(){return vt};vt.simplify=function(t,e){var n=new vt(t);return n.simplify(e)};Io.INIT.get=function(){return 0};Io.DELETE.get=function(){return 1};Io.KEEP.get=function(){return 1};Io.NUM_PTS_TO_CHECK.get=function(){return 10};Object.defineProperties(vt,Io);var Re=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new O},Bu={COORDINATE_ARRAY_TYPE:{configurable:!0}};Re.prototype.getCoordinates=function(){var t=this._ptList.toArray(Re.COORDINATE_ARRAY_TYPE);return t};Re.prototype.setPrecisionModel=function(t){this._precisionModel=t};Re.prototype.addPt=function(t){var e=new d(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)};Re.prototype.revere=function(){};Re.prototype.addPts=function(t,e){var n=this;if(e)for(var r=0;r<t.length;r++)n.addPt(t[r]);else for(var i=t.length-1;i>=0;i--)n.addPt(t[i])};Re.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1),n=t.distance(e);return n<this._minimimVertexDistance};Re.prototype.toString=function(){var t=new j,e=t.createLineString(this.getCoordinates());return e.toString()};Re.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var t=new d(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)};Re.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t};Re.prototype.interfaces_=function(){return[]};Re.prototype.getClass=function(){return Re};Bu.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)};Object.defineProperties(Re,Bu);var W=function(){},pi={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};W.prototype.interfaces_=function(){return[]};W.prototype.getClass=function(){return W};W.toDegrees=function(t){return t*180/Math.PI};W.normalize=function(t){for(;t>Math.PI;)t-=W.PI_TIMES_2;for(;t<=-Math.PI;)t+=W.PI_TIMES_2;return t};W.angle=function(){if(arguments.length===1){var t=arguments[0];return Math.atan2(t.y,t.x)}else if(arguments.length===2){var e=arguments[0],n=arguments[1],r=n.x-e.x,i=n.y-e.y;return Math.atan2(i,r)}};W.isAcute=function(t,e,n){var r=t.x-e.x,i=t.y-e.y,o=n.x-e.x,s=n.y-e.y,a=r*o+i*s;return a>0};W.isObtuse=function(t,e,n){var r=t.x-e.x,i=t.y-e.y,o=n.x-e.x,s=n.y-e.y,a=r*o+i*s;return a<0};W.interiorAngle=function(t,e,n){var r=W.angle(e,t),i=W.angle(e,n);return Math.abs(i-r)};W.normalizePositive=function(t){if(t<0){for(;t<0;)t+=W.PI_TIMES_2;t>=W.PI_TIMES_2&&(t=0)}else{for(;t>=W.PI_TIMES_2;)t-=W.PI_TIMES_2;t<0&&(t=0)}return t};W.angleBetween=function(t,e,n){var r=W.angle(e,t),i=W.angle(e,n);return W.diff(r,i)};W.diff=function(t,e){var n=null;return t<e?n=e-t:n=t-e,n>Math.PI&&(n=2*Math.PI-n),n};W.toRadians=function(t){return t*Math.PI/180};W.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?W.COUNTERCLOCKWISE:n<0?W.CLOCKWISE:W.NONE};W.angleBetweenOriented=function(t,e,n){var r=W.angle(e,t),i=W.angle(e,n),o=i-r;return o<=-Math.PI?o+W.PI_TIMES_2:o>Math.PI?o-W.PI_TIMES_2:o};pi.PI_TIMES_2.get=function(){return 2*Math.PI};pi.PI_OVER_2.get=function(){return Math.PI/2};pi.PI_OVER_4.get=function(){return Math.PI/4};pi.COUNTERCLOCKWISE.get=function(){return M.COUNTERCLOCKWISE};pi.CLOCKWISE.get=function(){return M.CLOCKWISE};pi.NONE.get=function(){return M.COLLINEAR};Object.defineProperties(W,pi);var ct=function t(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new G,this._seg1=new G,this._offset0=new G,this._offset1=new G,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],n=arguments[1],r=arguments[2];this._precisionModel=e,this._bufParams=n,this._li=new Xr,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),n.getQuadrantSegments()>=8&&n.getJoinStyle()===J.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)},No={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};ct.prototype.addNextSegment=function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var n=M.computeOrientation(this._s0,this._s1,this._s2),r=n===M.CLOCKWISE&&this._side===R.LEFT||n===M.COUNTERCLOCKWISE&&this._side===R.RIGHT;n===0?this.addCollinear(e):r?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)};ct.prototype.addLineEndCap=function(t,e){var n=new G(t,e),r=new G;this.computeOffsetSegment(n,R.LEFT,this._distance,r);var i=new G;this.computeOffsetSegment(n,R.RIGHT,this._distance,i);var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o);switch(this._bufParams.getEndCapStyle()){case J.CAP_ROUND:this._segList.addPt(r.p1),this.addFilletArc(e,a+Math.PI/2,a-Math.PI/2,M.CLOCKWISE,this._distance),this._segList.addPt(i.p1);break;case J.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(i.p1);break;case J.CAP_SQUARE:var u=new d;u.x=Math.abs(this._distance)*Math.cos(a),u.y=Math.abs(this._distance)*Math.sin(a);var l=new d(r.p1.x+u.x,r.p1.y+u.y),c=new d(i.p1.x+u.x,i.p1.y+u.y);this._segList.addPt(l),this._segList.addPt(c);break}};ct.prototype.getCoordinates=function(){var t=this._segList.getCoordinates();return t};ct.prototype.addMitreJoin=function(t,e,n,r){var i=!0,o=null;try{o=$e.intersection(e.p0,e.p1,n.p0,n.p1);var s=r<=0?1:o.distance(t)/Math.abs(r);s>this._bufParams.getMitreLimit()&&(i=!1)}catch(a){if(a instanceof zi)o=new d(0,0),i=!1;else throw a}finally{}i?this._segList.addPt(o):this.addLimitedMitreJoin(e,n,r,this._bufParams.getMitreLimit())};ct.prototype.addFilletCorner=function(t,e,n,r,i){var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o),u=n.x-t.x,l=n.y-t.y,c=Math.atan2(l,u);r===M.CLOCKWISE?a<=c&&(a+=2*Math.PI):a>=c&&(a-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,a,c,r,i),this._segList.addPt(n)};ct.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*ct.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===J.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===J.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(e&&this._segList.addPt(this._offset0.p1),this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,t,this._distance),this._segList.addPt(this._offset1.p0))};ct.prototype.createSquare=function(t){this._segList.addPt(new d(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new d(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new d(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new d(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()};ct.prototype.addSegments=function(t,e){this._segList.addPts(t,e)};ct.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)};ct.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)};ct.prototype.initSideSegments=function(t,e,n){this._s1=t,this._s2=e,this._side=n,this._seg1.setCoordinates(t,e),this.computeOffsetSegment(this._seg1,n,this._distance,this._offset1)};ct.prototype.addLimitedMitreJoin=function(t,e,n,r){var i=this._seg0.p1,o=W.angle(i,this._seg0.p0),s=W.angleBetweenOriented(this._seg0.p0,i,this._seg1.p1),a=s/2,u=W.normalize(o+a),l=W.normalize(u+Math.PI),c=r*n,p=c*Math.abs(Math.sin(a)),h=n-p,g=i.x+c*Math.cos(l),f=i.y+c*Math.sin(l),m=new d(g,f),y=new G(i,m),v=y.pointAlongOffset(1,h),x=y.pointAlongOffset(1,-h);this._side===R.LEFT?(this._segList.addPt(v),this._segList.addPt(x)):(this._segList.addPt(x),this._segList.addPt(v))};ct.prototype.computeOffsetSegment=function(t,e,n,r){var i=e===R.LEFT?1:-1,o=t.p1.x-t.p0.x,s=t.p1.y-t.p0.y,a=Math.sqrt(o*o+s*s),u=i*n*o/a,l=i*n*s/a;r.p0.x=t.p0.x-l,r.p0.y=t.p0.y+u,r.p1.x=t.p1.x-l,r.p1.y=t.p1.y+u};ct.prototype.addFilletArc=function(t,e,n,r,i){var o=this,s=r===M.CLOCKWISE?-1:1,a=Math.abs(e-n),u=Math.trunc(a/this._filletAngleQuantum+.5);if(u<1)return null;for(var l=0,c=a/u,p=l,h=new d;p<a;){var g=e+s*p;h.x=t.x+i*Math.cos(g),h.y=t.y+i*Math.sin(g),o._segList.addPt(h),p+=c}};ct.prototype.addInsideTurn=function(t,e){if(this._li.computeIntersection(this._offset0.p0,this._offset0.p1,this._offset1.p0,this._offset1.p1),this._li.hasIntersection())this._segList.addPt(this._li.getIntersection(0));else if(this._hasNarrowConcaveAngle=!0,this._offset0.p1.distance(this._offset1.p0)<this._distance*ct.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var n=new d((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(n);var r=new d((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(r)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}};ct.prototype.createCircle=function(t){var e=new d(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()};ct.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)};ct.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Re,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*ct.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)};ct.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2);var e=this._li.getIntersectionNum();e>=2&&(this._bufParams.getJoinStyle()===J.JOIN_BEVEL||this._bufParams.getJoinStyle()===J.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,M.CLOCKWISE,this._distance))};ct.prototype.closeRing=function(){this._segList.closeRing()};ct.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle};ct.prototype.interfaces_=function(){return[]};ct.prototype.getClass=function(){return ct};No.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001};No.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001};No.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6};No.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80};Object.defineProperties(ct,No);var fe=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};fe.prototype.getOffsetCurve=function(t,e){if(this._distance=e,e===0)return null;var n=e<0,r=Math.abs(e),i=this.getSegGen(r);t.length<=1?this.computePointCurve(t[0],i):this.computeOffsetCurve(t,n,i);var o=i.getCoordinates();return n&&Y.reverse(o),o};fe.prototype.computeSingleSidedBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var i=vt.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],R.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(i[s],!0)}else{n.addSegments(t,!1);var a=vt.simplify(t,r),u=a.length-1;n.initSideSegments(a[0],a[1],R.LEFT),n.addFirstSegment();for(var l=2;l<=u;l++)n.addNextSegment(a[l],!0)}n.addLastSegment(),n.closeRing()};fe.prototype.computeRingBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);e===R.RIGHT&&(r=-r);var i=vt.simplify(t,r),o=i.length-1;n.initSideSegments(i[o-1],i[0],e);for(var s=1;s<=o;s++){var a=s!==1;n.addNextSegment(i[s],a)}n.closeRing()};fe.prototype.computeLineBufferCurve=function(t,e){var n=this.simplifyTolerance(this._distance),r=vt.simplify(t,n),i=r.length-1;e.initSideSegments(r[0],r[1],R.LEFT);for(var o=2;o<=i;o++)e.addNextSegment(r[o],!0);e.addLastSegment(),e.addLineEndCap(r[i-1],r[i]);var s=vt.simplify(t,-n),a=s.length-1;e.initSideSegments(s[a],s[a-1],R.LEFT);for(var u=a-2;u>=0;u--)e.addNextSegment(s[u],!0);e.addLastSegment(),e.addLineEndCap(s[1],s[0]),e.closeRing()};fe.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case J.CAP_ROUND:e.createCircle(t);break;case J.CAP_SQUARE:e.createSquare(t);break}};fe.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided()||e===0)return null;var n=Math.abs(e),r=this.getSegGen(n);if(t.length<=1)this.computePointCurve(t[0],r);else if(this._bufParams.isSingleSided()){var i=e<0;this.computeSingleSidedBufferCurve(t,i,r)}else this.computeLineBufferCurve(t,r);var o=r.getCoordinates();return o};fe.prototype.getBufferParameters=function(){return this._bufParams};fe.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()};fe.prototype.getRingCurve=function(t,e,n){if(this._distance=n,t.length<=2)return this.getLineCurve(t,n);if(n===0)return fe.copyCoordinates(t);var r=this.getSegGen(n);return this.computeRingBufferCurve(t,e,r),r.getCoordinates()};fe.prototype.computeOffsetCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){var i=vt.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],R.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(i[s],!0)}else{var a=vt.simplify(t,r),u=a.length-1;n.initSideSegments(a[0],a[1],R.LEFT),n.addFirstSegment();for(var l=2;l<=u;l++)n.addNextSegment(a[l],!0)}n.addLastSegment()};fe.prototype.getSegGen=function(t){return new ct(this._precisionModel,this._bufParams,t)};fe.prototype.interfaces_=function(){return[]};fe.prototype.getClass=function(){return fe};fe.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),n=0;n<e.length;n++)e[n]=new d(t[n]);return e};var Jr=function(){this._subgraphs=null,this._seg=new G,this._cga=new M;var t=arguments[0];this._subgraphs=t},zu={DepthSegment:{configurable:!0}};Jr.prototype.findStabbedSegments=function(){var t=this;if(arguments.length===1){for(var e=arguments[0],n=new O,r=this._subgraphs.iterator();r.hasNext();){var i=r.next(),o=i.getEnvelope();e.y<o.getMinY()||e.y>o.getMaxY()||t.findStabbedSegments(e,i.getDirectedEdges(),n)}return n}else if(arguments.length===3){if(z(arguments[2],Xe)&&arguments[0]instanceof d&&arguments[1]instanceof ks)for(var s=arguments[0],a=arguments[1],u=arguments[2],l=a.getEdge().getCoordinates(),c=0;c<l.length-1;c++){t._seg.p0=l[c],t._seg.p1=l[c+1],t._seg.p0.y>t._seg.p1.y&&t._seg.reverse();var p=Math.max(t._seg.p0.x,t._seg.p1.x);if(!(p<s.x)&&!t._seg.isHorizontal()&&!(s.y<t._seg.p0.y||s.y>t._seg.p1.y)&&M.computeOrientation(t._seg.p0,t._seg.p1,s)!==M.RIGHT){var h=a.getDepth(R.LEFT);t._seg.p0.equals(l[c])||(h=a.getDepth(R.RIGHT));var g=new Ar(t._seg,h);u.add(g)}}else if(z(arguments[2],Xe)&&arguments[0]instanceof d&&z(arguments[1],Xe))for(var f=arguments[0],m=arguments[1],y=arguments[2],v=m.iterator();v.hasNext();){var x=v.next();x.isForward()&&t.findStabbedSegments(f,x,y)}}};Jr.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);if(e.size()===0)return 0;var n=He.min(e);return n._leftDepth};Jr.prototype.interfaces_=function(){return[]};Jr.prototype.getClass=function(){return Jr};zu.DepthSegment.get=function(){return Ar};Object.defineProperties(Jr,zu);var Ar=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new G(t),this._leftDepth=e};Ar.prototype.compareTo=function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var n=this._upwardSeg.orientationIndex(e._upwardSeg);return n!==0||(n=-1*e._upwardSeg.orientationIndex(this._upwardSeg),n!==0)?n:this._upwardSeg.compareTo(e._upwardSeg)};Ar.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return n!==0?n:t.p1.compareTo(e.p1)};Ar.prototype.toString=function(){return this._upwardSeg.toString()};Ar.prototype.interfaces_=function(){return[Be]};Ar.prototype.getClass=function(){return Ar};var tt=function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null};tt.prototype.area=function(){return tt.area(this.p0,this.p1,this.p2)};tt.prototype.signedArea=function(){return tt.signedArea(this.p0,this.p1,this.p2)};tt.prototype.interpolateZ=function(t){if(t===null)throw new ft("Supplied point is null.");return tt.interpolateZ(t,this.p0,this.p1,this.p2)};tt.prototype.longestSideLength=function(){return tt.longestSideLength(this.p0,this.p1,this.p2)};tt.prototype.isAcute=function(){return tt.isAcute(this.p0,this.p1,this.p2)};tt.prototype.circumcentre=function(){return tt.circumcentre(this.p0,this.p1,this.p2)};tt.prototype.area3D=function(){return tt.area3D(this.p0,this.p1,this.p2)};tt.prototype.centroid=function(){return tt.centroid(this.p0,this.p1,this.p2)};tt.prototype.inCentre=function(){return tt.inCentre(this.p0,this.p1,this.p2)};tt.prototype.interfaces_=function(){return[]};tt.prototype.getClass=function(){return tt};tt.area=function(t,e,n){return Math.abs(((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2)};tt.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2};tt.det=function(t,e,n,r){return t*r-e*n};tt.interpolateZ=function(t,e,n,r){var i=e.x,o=e.y,s=n.x-i,a=r.x-i,u=n.y-o,l=r.y-o,c=s*l-a*u,p=t.x-i,h=t.y-o,g=(l*p-a*h)/c,f=(-u*p+s*h)/c,m=e.z+g*(n.z-e.z)+f*(r.z-e.z);return m};tt.longestSideLength=function(t,e,n){var r=t.distance(e),i=e.distance(n),o=n.distance(t),s=r;return i>s&&(s=i),o>s&&(s=o),s};tt.isAcute=function(t,e,n){return!(!W.isAcute(t,e,n)||!W.isAcute(e,n,t)||!W.isAcute(n,t,e))};tt.circumcentre=function(t,e,n){var r=n.x,i=n.y,o=t.x-r,s=t.y-i,a=e.x-r,u=e.y-i,l=2*tt.det(o,s,a,u),c=tt.det(s,o*o+s*s,u,a*a+u*u),p=tt.det(o,o*o+s*s,a,a*a+u*u),h=r-c/l,g=i+p/l;return new d(h,g)};tt.perpendicularBisector=function(t,e){var n=e.x-t.x,r=e.y-t.y,i=new $e(t.x+n/2,t.y+r/2,1),o=new $e(t.x-r+n/2,t.y+n+r/2,1);return new $e(i,o)};tt.angleBisector=function(t,e,n){var r=e.distance(t),i=e.distance(n),o=r/(r+i),s=n.x-t.x,a=n.y-t.y,u=new d(t.x+o*s,t.y+o*a);return u};tt.area3D=function(t,e,n){var r=e.x-t.x,i=e.y-t.y,o=e.z-t.z,s=n.x-t.x,a=n.y-t.y,u=n.z-t.z,l=i*u-o*a,c=o*s-r*u,p=r*a-i*s,h=l*l+c*c+p*p,g=Math.sqrt(h)/2;return g};tt.centroid=function(t,e,n){var r=(t.x+e.x+n.x)/3,i=(t.y+e.y+n.y)/3;return new d(r,i)};tt.inCentre=function(t,e,n){var r=e.distance(n),i=t.distance(n),o=t.distance(e),s=r+i+o,a=(r*t.x+i*e.x+o*n.x)/s,u=(r*t.y+i*e.y+o*n.y)/s;return new d(a,u)};var qe=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new O;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n};qe.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,_.EXTERIOR,_.INTERIOR)};qe.prototype.addPolygon=function(t){var e=this,n=this._distance,r=R.LEFT;this._distance<0&&(n=-this._distance,r=R.RIGHT);var i=t.getExteriorRing(),o=Y.removeRepeatedPoints(i.getCoordinates());if(this._distance<0&&this.isErodedCompletely(i,this._distance)||this._distance<=0&&o.length<3)return null;this.addPolygonRing(o,n,r,_.EXTERIOR,_.INTERIOR);for(var s=0;s<t.getNumInteriorRing();s++){var a=t.getInteriorRingN(s),u=Y.removeRepeatedPoints(a.getCoordinates());e._distance>0&&e.isErodedCompletely(a,-e._distance)||e.addPolygonRing(u,n,R.opposite(r),_.INTERIOR,_.EXTERIOR)}};qe.prototype.isTriangleErodedCompletely=function(t,e){var n=new tt(t[0],t[1],t[2]),r=n.inCentre(),i=M.distancePointLine(r,n.p0,n.p1);return i<Math.abs(e)};qe.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=Y.removeRepeatedPoints(t.getCoordinates()),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,_.EXTERIOR,_.INTERIOR)};qe.prototype.addCurve=function(t,e,n){if(t===null||t.length<2)return null;var r=new Lt(t,new rt(0,_.BOUNDARY,e,n));this._curveList.add(r)};qe.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList};qe.prototype.addPolygonRing=function(t,e,n,r,i){if(e===0&&t.length<On.MINIMUM_VALID_SIZE)return null;var o=r,s=i;t.length>=On.MINIMUM_VALID_SIZE&&M.isCCW(t)&&(o=i,s=r,n=R.opposite(n));var a=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(a,o,s)};qe.prototype.add=function(t){if(t.isEmpty())return null;t instanceof Ft?this.addPolygon(t):t instanceof _t?this.addLineString(t):t instanceof _e?this.addPoint(t):t instanceof Si?this.addCollection(t):t instanceof Mr?this.addCollection(t):t instanceof wn?this.addCollection(t):t instanceof ae&&this.addCollection(t)};qe.prototype.isErodedCompletely=function(t,e){var n=t.getCoordinates();if(n.length<4)return e<0;if(n.length===4)return this.isTriangleErodedCompletely(n,e);var r=t.getEnvelopeInternal(),i=Math.min(r.getHeight(),r.getWidth());return e<0&&2*Math.abs(e)>i};qe.prototype.addCollection=function(t){for(var e=this,n=0;n<t.getNumGeometries();n++){var r=t.getGeometryN(n);e.add(r)}};qe.prototype.interfaces_=function(){return[]};qe.prototype.getClass=function(){return qe};var Oi=function(){};Oi.prototype.locate=function(t){};Oi.prototype.interfaces_=function(){return[]};Oi.prototype.getClass=function(){return Oi};var Tn=function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var t=arguments[0];this._parent=t,this._atStart=!0,this._index=0,this._max=t.getNumGeometries()};Tn.prototype.next=function(){if(this._atStart)return this._atStart=!1,Tn.isAtomic(this._parent)&&this._index++,this._parent;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new Vi;var t=this._parent.getGeometryN(this._index++);return t instanceof ae?(this._subcollectionIterator=new Tn(t),this._subcollectionIterator.next()):t};Tn.prototype.remove=function(){throw new Error(this.getClass().getName())};Tn.prototype.hasNext=function(){if(this._atStart)return!0;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)};Tn.prototype.interfaces_=function(){return[Ui]};Tn.prototype.getClass=function(){return Tn};Tn.isAtomic=function(t){return!(t instanceof ae)};var Le=function(){this._geom=null;var t=arguments[0];this._geom=t};Le.prototype.locate=function(t){return Le.locate(t,this._geom)};Le.prototype.interfaces_=function(){return[Oi]};Le.prototype.getClass=function(){return Le};Le.isPointInRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?M.isPointInRing(t,e.getCoordinates()):!1};Le.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!Le.isPointInRing(t,n))return!1;for(var r=0;r<e.getNumInteriorRing();r++){var i=e.getInteriorRingN(r);if(Le.isPointInRing(t,i))return!1}return!0};Le.containsPoint=function(t,e){if(e instanceof Ft)return Le.containsPointInPolygon(t,e);if(e instanceof ae)for(var n=new Tn(e);n.hasNext();){var r=n.next();if(r!==e&&Le.containsPoint(t,r))return!0}return!1};Le.locate=function(t,e){return e.isEmpty()?_.EXTERIOR:Le.containsPoint(t,e)?_.INTERIOR:_.EXTERIOR};var te=function(){this._edgeMap=new Jt,this._edgeList=null,this._ptInAreaLocation=[_.NONE,_.NONE]};te.prototype.getNextCW=function(t){this.getEdges();var e=this._edgeList.indexOf(t),n=e-1;return e===0&&(n=this._edgeList.size()-1),this._edgeList.get(n)};te.prototype.propagateSideLabels=function(t){for(var e=_.NONE,n=this.iterator();n.hasNext();){var r=n.next(),i=r.getLabel();i.isArea(t)&&i.getLocation(t,R.LEFT)!==_.NONE&&(e=i.getLocation(t,R.LEFT))}if(e===_.NONE)return null;for(var o=e,s=this.iterator();s.hasNext();){var a=s.next(),u=a.getLabel();if(u.getLocation(t,R.ON)===_.NONE&&u.setLocation(t,R.ON,o),u.isArea(t)){var l=u.getLocation(t,R.LEFT),c=u.getLocation(t,R.RIGHT);if(c!==_.NONE){if(c!==o)throw new Qn("side location conflict",a.getCoordinate());l===_.NONE&&$.shouldNeverReachHere("found single null side (at "+a.getCoordinate()+")"),o=l}else $.isTrue(u.getLocation(t,R.LEFT)===_.NONE,"found single null side"),u.setLocation(t,R.RIGHT,o),u.setLocation(t,R.LEFT,o)}}};te.prototype.getCoordinate=function(){var t=this.iterator();if(!t.hasNext())return null;var e=t.next();return e.getCoordinate()};te.prototype.print=function(t){$t.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}};te.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)};te.prototype.checkAreaLabelsConsistent=function(t){var e=this.getEdges();if(e.size()<=0)return!0;var n=e.size()-1,r=e.get(n).getLabel(),i=r.getLocation(t,R.LEFT);$.isTrue(i!==_.NONE,"Found unlabelled area edge");for(var o=i,s=this.iterator();s.hasNext();){var a=s.next(),u=a.getLabel();$.isTrue(u.isArea(t),"Found non-area edge");var l=u.getLocation(t,R.LEFT),c=u.getLocation(t,R.RIGHT);if(l===c||c!==o)return!1;o=l}return!0};te.prototype.findIndex=function(t){var e=this;this.iterator();for(var n=0;n<this._edgeList.size();n++){var r=e._edgeList.get(n);if(r===t)return n}return-1};te.prototype.iterator=function(){return this.getEdges().iterator()};te.prototype.getEdges=function(){return this._edgeList===null&&(this._edgeList=new O(this._edgeMap.values())),this._edgeList};te.prototype.getLocation=function(t,e,n){return this._ptInAreaLocation[t]===_.NONE&&(this._ptInAreaLocation[t]=Le.locate(e,n[t].getGeometry())),this._ptInAreaLocation[t]};te.prototype.toString=function(){var t=new In;t.append("EdgeEndStar: "+this.getCoordinate()),t.append(`
|
|
24
|
-
`);for(var e=this.iterator();e.hasNext();){var n=e.next();t.append(n),t.append(`
|
|
25
|
-
`)}return t.toString()};te.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next();n.computeLabel(t)}};te.prototype.computeLabelling=function(t){var e=this;this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var n=[!1,!1],r=this.iterator();r.hasNext();)for(var i=r.next(),o=i.getLabel(),s=0;s<2;s++)o.isLine(s)&&o.getLocation(s)===_.BOUNDARY&&(n[s]=!0);for(var a=this.iterator();a.hasNext();)for(var u=a.next(),l=u.getLabel(),c=0;c<2;c++)if(l.isAnyNull(c)){var p=_.NONE;if(n[c])p=_.EXTERIOR;else{var h=u.getCoordinate();p=e.getLocation(c,h,t)}l.setAllLocationsIfNull(c,p)}};te.prototype.getDegree=function(){return this._edgeMap.size()};te.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null};te.prototype.interfaces_=function(){return[]};te.prototype.getClass=function(){return te};var Dp=function(t){function e(){t.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.linkResultDirectedEdges=function(){var n=this;this.getResultAreaEdges();for(var r=null,i=null,o=this._SCANNING_FOR_INCOMING,s=0;s<this._resultAreaEdgeList.size();s++){var a=n._resultAreaEdgeList.get(s),u=a.getSym();if(a.getLabel().isArea())switch(r===null&&a.isInResult()&&(r=a),o){case n._SCANNING_FOR_INCOMING:if(!u.isInResult())continue;i=u,o=n._LINKING_TO_OUTGOING;break;case n._LINKING_TO_OUTGOING:if(!a.isInResult())continue;i.setNext(a),o=n._SCANNING_FOR_INCOMING;break}}if(o===this._LINKING_TO_OUTGOING){if(r===null)throw new Qn("no outgoing dirEdge found",this.getCoordinate());$.isTrue(r.isInResult(),"unable to link last incoming dirEdge"),i.setNext(r)}},e.prototype.insert=function(n){var r=n;this.insertEdgeEnd(r,r)},e.prototype.getRightmostEdge=function(){var n=this.getEdges(),r=n.size();if(r<1)return null;var i=n.get(0);if(r===1)return i;var o=n.get(r-1),s=i.getQuadrant(),a=o.getQuadrant();return ot.isNorthern(s)&&ot.isNorthern(a)?i:!ot.isNorthern(s)&&!ot.isNorthern(a)?o:i.getDy()!==0?i:o.getDy()!==0?o:($.shouldNeverReachHere("found two horizontal edges incident on node"),null)},e.prototype.print=function(n){$t.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var r=this.iterator();r.hasNext();){var i=r.next();n.print("out "),i.print(n),n.println(),n.print("in "),i.getSym().print(n),n.println()}},e.prototype.getResultAreaEdges=function(){var n=this;if(this._resultAreaEdgeList!==null)return this._resultAreaEdgeList;this._resultAreaEdgeList=new O;for(var r=this.iterator();r.hasNext();){var i=r.next();(i.isInResult()||i.getSym().isInResult())&&n._resultAreaEdgeList.add(i)}return this._resultAreaEdgeList},e.prototype.updateLabelling=function(n){for(var r=this.iterator();r.hasNext();){var i=r.next(),o=i.getLabel();o.setAllLocationsIfNull(0,n.getLocation(0)),o.setAllLocationsIfNull(1,n.getLocation(1))}},e.prototype.linkAllDirectedEdges=function(){var n=this;this.getEdges();for(var r=null,i=null,o=this._edgeList.size()-1;o>=0;o--){var s=n._edgeList.get(o),a=s.getSym();i===null&&(i=a),r!==null&&a.setNext(r),r=s}i.setNext(r)},e.prototype.computeDepths=function(){var n=this;if(arguments.length===1){var r=arguments[0],i=this.findIndex(r),o=r.getDepth(R.LEFT),s=r.getDepth(R.RIGHT),a=this.computeDepths(i+1,this._edgeList.size(),o),u=this.computeDepths(0,i,a);if(u!==s)throw new Qn("depth mismatch at "+r.getCoordinate())}else if(arguments.length===3){for(var l=arguments[0],c=arguments[1],p=arguments[2],h=p,g=l;g<c;g++){var f=n._edgeList.get(g);f.setEdgeDepths(R.RIGHT,h),h=f.getDepth(R.LEFT)}return h}},e.prototype.mergeSymLabels=function(){for(var n=this.iterator();n.hasNext();){var r=n.next(),i=r.getLabel();i.merge(r.getSym().getLabel())}},e.prototype.linkMinimalDirectedEdges=function(n){for(var r=this,i=null,o=null,s=this._SCANNING_FOR_INCOMING,a=this._resultAreaEdgeList.size()-1;a>=0;a--){var u=r._resultAreaEdgeList.get(a),l=u.getSym();switch(i===null&&u.getEdgeRing()===n&&(i=u),s){case r._SCANNING_FOR_INCOMING:if(l.getEdgeRing()!==n)continue;o=l,s=r._LINKING_TO_OUTGOING;break;case r._LINKING_TO_OUTGOING:if(u.getEdgeRing()!==n)continue;o.setNextMin(u),s=r._SCANNING_FOR_INCOMING;break}}s===this._LINKING_TO_OUTGOING&&($.isTrue(i!==null,"found null for first outgoing dirEdge"),$.isTrue(i.getEdgeRing()===n,"unable to link last incoming dirEdge"),o.setNextMin(i))},e.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var n=0,r=this.iterator();r.hasNext();){var i=r.next();i.isInResult()&&n++}return n}else if(arguments.length===1){for(var o=arguments[0],s=0,a=this.iterator();a.hasNext();){var u=a.next();u.getEdgeRing()===o&&s++}return s}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var n=_.NONE,r=this.iterator();r.hasNext();){var i=r.next(),o=i.getSym();if(!i.isLineEdge()){if(i.isInResult()){n=_.INTERIOR;break}if(o.isInResult()){n=_.EXTERIOR;break}}}if(n===_.NONE)return null;for(var s=n,a=this.iterator();a.hasNext();){var u=a.next(),l=u.getSym();u.isLineEdge()?u.getEdge().setCovered(s===_.INTERIOR):(u.isInResult()&&(s=_.EXTERIOR),l.isInResult()&&(s=_.INTERIOR))}},e.prototype.computeLabelling=function(n){var r=this;t.prototype.computeLabelling.call(this,n),this._label=new rt(_.NONE);for(var i=this.iterator();i.hasNext();)for(var o=i.next(),s=o.getEdge(),a=s.getLabel(),u=0;u<2;u++){var l=a.getLocation(u);(l===_.INTERIOR||l===_.BOUNDARY)&&r._label.setLocation(u,_.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(te),Uu=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createNode=function(n){return new ps(n,new Dp)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(wi),dr=function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)};dr.prototype.compareTo=function(t){var e=t,n=dr.compareOriented(this._pts,this._orientation,e._pts,e._orientation);return n};dr.prototype.interfaces_=function(){return[Be]};dr.prototype.getClass=function(){return dr};dr.orientation=function(t){return Y.increasingDirection(t)===1};dr.compareOriented=function(t,e,n,r){for(var i=e?1:-1,o=r?1:-1,s=e?t.length:-1,a=r?n.length:-1,u=e?0:t.length-1,l=r?0:n.length-1;;){var c=t[u].compareTo(n[l]);if(c!==0)return c;u+=i,l+=o;var p=u===s,h=l===a;if(p&&!h)return-1;if(!p&&h)return 1;if(p&&h)return 0}};var Ze=function(){this._edges=new O,this._ocaMap=new Jt};Ze.prototype.print=function(t){var e=this;t.print("MULTILINESTRING ( ");for(var n=0;n<this._edges.size();n++){var r=e._edges.get(n);n>0&&t.print(","),t.print("(");for(var i=r.getCoordinates(),o=0;o<i.length;o++)o>0&&t.print(","),t.print(i[o].x+" "+i[o].y);t.println(")")}t.print(") ")};Ze.prototype.addAll=function(t){for(var e=this,n=t.iterator();n.hasNext();)e.add(n.next())};Ze.prototype.findEdgeIndex=function(t){for(var e=this,n=0;n<this._edges.size();n++)if(e._edges.get(n).equals(t))return n;return-1};Ze.prototype.iterator=function(){return this._edges.iterator()};Ze.prototype.getEdges=function(){return this._edges};Ze.prototype.get=function(t){return this._edges.get(t)};Ze.prototype.findEqualEdge=function(t){var e=new dr(t.getCoordinates()),n=this._ocaMap.get(e);return n};Ze.prototype.add=function(t){this._edges.add(t);var e=new dr(t.getCoordinates());this._ocaMap.put(e,t)};Ze.prototype.interfaces_=function(){return[]};Ze.prototype.getClass=function(){return Ze};var Fr=function(){};Fr.prototype.processIntersections=function(t,e,n,r){};Fr.prototype.isDone=function(){};Fr.prototype.interfaces_=function(){return[]};Fr.prototype.getClass=function(){return Fr};var Oe=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._hasInterior=!1,this._properIntersectionPoint=null,this._li=null,this._isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;var t=arguments[0];this._li=t};Oe.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&this._li.getIntersectionNum()===1){if(Oe.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var i=t.size()-1;if(e===0&&r===i||r===0&&e===i)return!0}}return!1};Oe.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint};Oe.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior};Oe.prototype.getLineIntersector=function(){return this._li};Oe.prototype.hasProperIntersection=function(){return this._hasProper};Oe.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(t,e,n,r)||(this._hasIntersection=!0,t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))};Oe.prototype.hasIntersection=function(){return this._hasIntersection};Oe.prototype.isDone=function(){return!1};Oe.prototype.hasInteriorIntersection=function(){return this._hasInterior};Oe.prototype.interfaces_=function(){return[Fr]};Oe.prototype.getClass=function(){return Oe};Oe.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var yn=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.coord=new d(t),this.segmentIndex=e,this.dist=n};yn.prototype.getSegmentIndex=function(){return this.segmentIndex};yn.prototype.getCoordinate=function(){return this.coord};yn.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)};yn.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)};yn.prototype.isEndPoint=function(t){return this.segmentIndex===0&&this.dist===0||this.segmentIndex===t};yn.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist};yn.prototype.getDistance=function(){return this.dist};yn.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0};yn.prototype.interfaces_=function(){return[Be]};yn.prototype.getClass=function(){return yn};var Dn=function(){this._nodeMap=new Jt,this.edge=null;var t=arguments[0];this.edge=t};Dn.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}};Dn.prototype.iterator=function(){return this._nodeMap.values().iterator()};Dn.prototype.addSplitEdges=function(t){var e=this;this.addEndpoints();for(var n=this.iterator(),r=n.next();n.hasNext();){var i=n.next(),o=e.createSplitEdge(r,i);t.add(o),r=i}};Dn.prototype.addEndpoints=function(){var t=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[t],t,0)};Dn.prototype.createSplitEdge=function(t,e){var n=this,r=e.segmentIndex-t.segmentIndex+2,i=this.edge.pts[e.segmentIndex],o=e.dist>0||!e.coord.equals2D(i);o||r--;var s=new Array(r).fill(null),a=0;s[a++]=new d(t.coord);for(var u=t.segmentIndex+1;u<=e.segmentIndex;u++)s[a++]=n.edge.pts[u];return o&&(s[a]=e.coord),new jo(s,new rt(this.edge._label))};Dn.prototype.add=function(t,e,n){var r=new yn(t,e,n),i=this._nodeMap.get(r);return i!==null?i:(this._nodeMap.put(r,r),r)};Dn.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next();if(n.coord.equals(t))return!0}return!1};Dn.prototype.interfaces_=function(){return[]};Dn.prototype.getClass=function(){return Dn};var Gr=function(){};Gr.prototype.getChainStartIndices=function(t){var e=this,n=0,r=new O;r.add(new pn(n));do{var i=e.findChainEnd(t,n);r.add(new pn(i)),n=i}while(n<t.length-1);var o=Gr.toIntArray(r);return o};Gr.prototype.findChainEnd=function(t,e){for(var n=ot.quadrant(t[e],t[e+1]),r=e+1;r<t.length;){var i=ot.quadrant(t[r-1],t[r]);if(i!==n)break;r++}return r-1};Gr.prototype.interfaces_=function(){return[]};Gr.prototype.getClass=function(){return Gr};Gr.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e};var er=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new F,this.env2=new F;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new Gr;this.startIndex=e.getChainStartIndices(this.pts)};er.prototype.getCoordinates=function(){return this.pts};er.prototype.getMaxX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e>n?e:n};er.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e<n?e:n};er.prototype.computeIntersectsForChain=function(){if(arguments.length===4){var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this.computeIntersectsForChain(this.startIndex[t],this.startIndex[t+1],e,e.startIndex[n],e.startIndex[n+1],r)}else if(arguments.length===6){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],u=arguments[4],l=arguments[5],c=this.pts[i],p=this.pts[o],h=s.pts[a],g=s.pts[u];if(o-i===1&&u-a===1)return l.addIntersections(this.e,i,s.e,a),null;if(this.env1.init(c,p),this.env2.init(h,g),!this.env1.intersects(this.env2))return null;var f=Math.trunc((i+o)/2),m=Math.trunc((a+u)/2);i<f&&(a<m&&this.computeIntersectsForChain(i,f,s,a,m,l),m<u&&this.computeIntersectsForChain(i,f,s,m,u,l)),f<o&&(a<m&&this.computeIntersectsForChain(f,o,s,a,m,l),m<u&&this.computeIntersectsForChain(f,o,s,m,u,l))}};er.prototype.getStartIndexes=function(){return this.startIndex};er.prototype.computeIntersects=function(t,e){for(var n=this,r=0;r<this.startIndex.length-1;r++)for(var i=0;i<t.startIndex.length-1;i++)n.computeIntersectsForChain(r,t,i,e)};er.prototype.interfaces_=function(){return[]};er.prototype.getClass=function(){return er};var Vt=function t(){var e=this;this._depth=Array(2).fill().map(function(){return Array(3)});for(var n=0;n<2;n++)for(var r=0;r<3;r++)e._depth[n][r]=t.NULL_VALUE},Vu={NULL_VALUE:{configurable:!0}};Vt.prototype.getDepth=function(t,e){return this._depth[t][e]};Vt.prototype.setDepth=function(t,e,n){this._depth[t][e]=n};Vt.prototype.isNull=function(){var t=this;if(arguments.length===0){for(var e=0;e<2;e++)for(var n=0;n<3;n++)if(t._depth[e][n]!==Vt.NULL_VALUE)return!1;return!0}else if(arguments.length===1){var r=arguments[0];return this._depth[r][1]===Vt.NULL_VALUE}else if(arguments.length===2){var i=arguments[0],o=arguments[1];return this._depth[i][o]===Vt.NULL_VALUE}};Vt.prototype.normalize=function(){for(var t=this,e=0;e<2;e++)if(!t.isNull(e)){var n=t._depth[e][1];t._depth[e][2]<n&&(n=t._depth[e][2]),n<0&&(n=0);for(var r=1;r<3;r++){var i=0;t._depth[e][r]>n&&(i=1),t._depth[e][r]=i}}};Vt.prototype.getDelta=function(t){return this._depth[t][R.RIGHT]-this._depth[t][R.LEFT]};Vt.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?_.EXTERIOR:_.INTERIOR};Vt.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]};Vt.prototype.add=function(){var t=this;if(arguments.length===1)for(var e=arguments[0],n=0;n<2;n++)for(var r=1;r<3;r++){var i=e.getLocation(n,r);(i===_.EXTERIOR||i===_.INTERIOR)&&(t.isNull(n,r)?t._depth[n][r]=Vt.depthAtLocation(i):t._depth[n][r]+=Vt.depthAtLocation(i))}else if(arguments.length===3){var o=arguments[0],s=arguments[1],a=arguments[2];a===_.INTERIOR&&this._depth[o][s]++}};Vt.prototype.interfaces_=function(){return[]};Vt.prototype.getClass=function(){return Vt};Vt.depthAtLocation=function(t){return t===_.EXTERIOR?0:t===_.INTERIOR?1:Vt.NULL_VALUE};Vu.NULL_VALUE.get=function(){return-1};Object.defineProperties(Vt,Vu);var jo=function(t){function e(){if(t.call(this),this.pts=null,this._env=null,this.eiList=new Dn(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new Vt,this._depthDelta=0,arguments.length===1){var n=arguments[0];e.call(this,n,null)}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.pts=r,this._label=i}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDepth=function(){return this._depth},e.prototype.getCollapsedEdge=function(){var n=new Array(2).fill(null);n[0]=this.pts[0],n[1]=this.pts[1];var r=new e(n,rt.toLineLabel(this._label));return r},e.prototype.isIsolated=function(){return this._isIsolated},e.prototype.getCoordinates=function(){return this.pts},e.prototype.setIsolated=function(n){this._isIsolated=n},e.prototype.setName=function(n){this._name=n},e.prototype.equals=function(n){var r=this;if(!(n instanceof e))return!1;var i=n;if(this.pts.length!==i.pts.length)return!1;for(var o=!0,s=!0,a=this.pts.length,u=0;u<this.pts.length;u++)if(r.pts[u].equals2D(i.pts[u])||(o=!1),r.pts[u].equals2D(i.pts[--a])||(s=!1),!o&&!s)return!1;return!0},e.prototype.getCoordinate=function(){if(arguments.length===0)return this.pts.length>0?this.pts[0]:null;if(arguments.length===1){var n=arguments[0];return this.pts[n]}},e.prototype.print=function(n){var r=this;n.print("edge "+this._name+": "),n.print("LINESTRING (");for(var i=0;i<this.pts.length;i++)i>0&&n.print(","),n.print(r.pts[i].x+" "+r.pts[i].y);n.print(") "+this._label+" "+this._depthDelta)},e.prototype.computeIM=function(n){e.updateIM(this._label,n)},e.prototype.isCollapsed=function(){return!this._label.isArea()||this.pts.length!==3?!1:!!this.pts[0].equals(this.pts[2])},e.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},e.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},e.prototype.getDepthDelta=function(){return this._depthDelta},e.prototype.getNumPoints=function(){return this.pts.length},e.prototype.printReverse=function(n){var r=this;n.print("edge "+this._name+": ");for(var i=this.pts.length-1;i>=0;i--)n.print(r.pts[i]+" ");n.println("")},e.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new er(this)),this._mce},e.prototype.getEnvelope=function(){var n=this;if(this._env===null){this._env=new F;for(var r=0;r<this.pts.length;r++)n._env.expandToInclude(n.pts[r])}return this._env},e.prototype.addIntersection=function(n,r,i,o){var s=new d(n.getIntersection(o)),a=r,u=n.getEdgeDistance(i,o),l=a+1;if(l<this.pts.length){var c=this.pts[l];s.equals2D(c)&&(a=l,u=0)}this.eiList.add(s,a,u)},e.prototype.toString=function(){var n=this,r=new In;r.append("edge "+this._name+": "),r.append("LINESTRING (");for(var i=0;i<this.pts.length;i++)i>0&&r.append(","),r.append(n.pts[i].x+" "+n.pts[i].y);return r.append(") "+this._label+" "+this._depthDelta),r.toString()},e.prototype.isPointwiseEqual=function(n){var r=this;if(this.pts.length!==n.pts.length)return!1;for(var i=0;i<this.pts.length;i++)if(!r.pts[i].equals2D(n.pts[i]))return!1;return!0},e.prototype.setDepthDelta=function(n){this._depthDelta=n},e.prototype.getEdgeIntersectionList=function(){return this.eiList},e.prototype.addIntersections=function(n,r,i){for(var o=this,s=0;s<n.getIntersectionNum();s++)o.addIntersection(n,r,i,s)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.updateIM=function(){if(arguments.length===2){var n=arguments[0],r=arguments[1];r.setAtLeastIfValid(n.getLocation(0,R.ON),n.getLocation(1,R.ON),1),n.isArea()&&(r.setAtLeastIfValid(n.getLocation(0,R.LEFT),n.getLocation(1,R.LEFT),2),r.setAtLeastIfValid(n.getLocation(0,R.RIGHT),n.getLocation(1,R.RIGHT),2))}else return t.prototype.updateIM.apply(this,arguments)},e}(Te),se=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Ze,this._bufParams=t||null};se.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t};se.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(e!==null){var n=e.getLabel(),r=t.getLabel();e.isPointwiseEqual(t)||(r=new rt(t.getLabel()),r.flip()),n.merge(r);var i=se.depthDelta(r),o=e.getDepthDelta(),s=o+i;e.setDepthDelta(s)}else this._edgeList.add(t),t.setDepthDelta(se.depthDelta(t.getLabel()))};se.prototype.buildSubgraphs=function(t,e){for(var n=new O,r=t.iterator();r.hasNext();){var i=r.next(),o=i.getRightmostCoordinate(),s=new Jr(n),a=s.getDepth(o);i.computeDepth(a),i.findResultEdges(),n.add(i),e.add(i.getDirectedEdges(),i.getNodes())}};se.prototype.createSubgraphs=function(t){for(var e=new O,n=t.getNodes().iterator();n.hasNext();){var r=n.next();if(!r.isVisited()){var i=new ue;i.create(r),e.add(i)}}return He.sort(e,He.reverseOrder()),e};se.prototype.createEmptyResultGeometry=function(){var t=this._geomFact.createPolygon();return t};se.prototype.getNoder=function(t){if(this._workingNoder!==null)return this._workingNoder;var e=new ta,n=new Xr;return n.setPrecisionModel(t),e.setSegmentIntersector(new Oe(n)),e};se.prototype.buffer=function(t,e){var n=this._workingPrecisionModel;n===null&&(n=t.getPrecisionModel()),this._geomFact=t.getFactory();var r=new fe(n,this._bufParams),i=new qe(t,e,r),o=i.getCurves();if(o.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(o,n),this._graph=new dt(new Uu),this._graph.addEdges(this._edgeList.getEdges());var s=this.createSubgraphs(this._graph),a=new ve(this._geomFact);this.buildSubgraphs(s,a);var u=a.getPolygons();if(u.size()<=0)return this.createEmptyResultGeometry();var l=this._geomFact.buildGeometry(u);return l};se.prototype.computeNodedEdges=function(t,e){var n=this,r=this.getNoder(e);r.computeNodes(t);for(var i=r.getNodedSubstrings(),o=i.iterator();o.hasNext();){var s=o.next(),a=s.getCoordinates();if(!(a.length===2&&a[0].equals2D(a[1]))){var u=s.getData(),l=new jo(s.getCoordinates(),new rt(u));n.insertUniqueEdge(l)}}};se.prototype.setNoder=function(t){this._workingNoder=t};se.prototype.interfaces_=function(){return[]};se.prototype.getClass=function(){return se};se.depthDelta=function(t){var e=t.getLocation(0,R.LEFT),n=t.getLocation(0,R.RIGHT);return e===_.INTERIOR&&n===_.EXTERIOR?1:e===_.EXTERIOR&&n===_.INTERIOR?-1:0};se.convertSegStrings=function(t){for(var e=new j,n=new O;t.hasNext();){var r=t.next(),i=e.createLineString(r.getCoordinates());n.add(i)}return e.buildGeometry(n)};var mr=function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,arguments.length===2){var t=arguments[0],e=arguments[1];this._noder=t,this._scaleFactor=e,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision()}else if(arguments.length===4){var n=arguments[0],r=arguments[1],i=arguments[2],o=arguments[3];this._noder=n,this._scaleFactor=r,this._offsetX=i,this._offsetY=o,this._isScaled=!this.isIntegerPrecision()}};mr.prototype.rescale=function(){var t=this;if(z(arguments[0],Pt))for(var e=arguments[0],n=e.iterator();n.hasNext();){var r=n.next();t.rescale(r.getCoordinates())}else if(arguments[0]instanceof Array){for(var i=arguments[0],o=0;o<i.length;o++)i[o].x=i[o].x/t._scaleFactor+t._offsetX,i[o].y=i[o].y/t._scaleFactor+t._offsetY;i.length===2&&i[0].equals2D(i[1])&&$t.out.println(i)}};mr.prototype.scale=function(){var t=this;if(z(arguments[0],Pt)){for(var e=arguments[0],n=new O,r=e.iterator();r.hasNext();){var i=r.next();n.add(new Lt(t.scale(i.getCoordinates()),i.getData()))}return n}else if(arguments[0]instanceof Array){for(var o=arguments[0],s=new Array(o.length).fill(null),a=0;a<o.length;a++)s[a]=new d(Math.round((o[a].x-t._offsetX)*t._scaleFactor),Math.round((o[a].y-t._offsetY)*t._scaleFactor),o[a].z);var u=Y.removeRepeatedPoints(s);return u}};mr.prototype.isIntegerPrecision=function(){return this._scaleFactor===1};mr.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t};mr.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)};mr.prototype.interfaces_=function(){return[Dr]};mr.prototype.getClass=function(){return mr};var _n=function(){this._li=new Xr,this._segStrings=null;var t=arguments[0];this._segStrings=t},$u={fact:{configurable:!0}};_n.prototype.checkEndPtVertexIntersections=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var n=e.next(),r=n.getCoordinates();t.checkEndPtVertexIntersections(r[0],t._segStrings),t.checkEndPtVertexIntersections(r[r.length-1],t._segStrings)}else if(arguments.length===2){for(var i=arguments[0],o=arguments[1],s=o.iterator();s.hasNext();)for(var a=s.next(),u=a.getCoordinates(),l=1;l<u.length-1;l++)if(u[l].equals(i))throw new Kn("found endpt/interior pt intersection at index "+l+" :pt "+i)}};_n.prototype.checkInteriorIntersections=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();)for(var n=e.next(),r=this._segStrings.iterator();r.hasNext();){var i=r.next();t.checkInteriorIntersections(n,i)}else if(arguments.length===2)for(var o=arguments[0],s=arguments[1],a=o.getCoordinates(),u=s.getCoordinates(),l=0;l<a.length-1;l++)for(var c=0;c<u.length-1;c++)t.checkInteriorIntersections(o,l,s,c);else if(arguments.length===4){var p=arguments[0],h=arguments[1],g=arguments[2],f=arguments[3];if(p===g&&h===f)return null;var m=p.getCoordinates()[h],y=p.getCoordinates()[h+1],v=g.getCoordinates()[f],x=g.getCoordinates()[f+1];if(this._li.computeIntersection(m,y,v,x),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,m,y)||this.hasInteriorIntersection(this._li,v,x)))throw new Kn("found non-noded intersection at "+m+"-"+y+" and "+v+"-"+x)}};_n.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()};_n.prototype.checkCollapses=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var n=e.next();t.checkCollapses(n)}else if(arguments.length===1)for(var r=arguments[0],i=r.getCoordinates(),o=0;o<i.length-2;o++)t.checkCollapse(i[o],i[o+1],i[o+2])};_n.prototype.hasInteriorIntersection=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++){var i=t.getIntersection(r);if(!(i.equals(e)||i.equals(n)))return!0}return!1};_n.prototype.checkCollapse=function(t,e,n){if(t.equals(n))throw new Kn("found non-noded collapse at "+_n.fact.createLineString([t,e,n]))};_n.prototype.interfaces_=function(){return[]};_n.prototype.getClass=function(){return _n};$u.fact.get=function(){return new j};Object.defineProperties(_n,$u);var ge=function(){this._li=null,this._pt=null,this._originalPt=null,this._ptScaled=null,this._p0Scaled=null,this._p1Scaled=null,this._scaleFactor=null,this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,this._corner=new Array(4).fill(null),this._safeEnv=null;var t=arguments[0],e=arguments[1],n=arguments[2];if(this._originalPt=t,this._pt=t,this._scaleFactor=e,this._li=n,e<=0)throw new ft("Scale factor must be non-zero");e!==1&&(this._pt=new d(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new d,this._p1Scaled=new d),this.initCorners(this._pt)},Xu={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};ge.prototype.intersectsScaled=function(t,e){var n=Math.min(t.x,e.x),r=Math.max(t.x,e.x),i=Math.min(t.y,e.y),o=Math.max(t.y,e.y),s=this._maxx<n||this._minx>r||this._maxy<i||this._miny>o;if(s)return!1;var a=this.intersectsToleranceSquare(t,e);return $.isTrue(!(s&&a),"Found bad envelope test"),a};ge.prototype.initCorners=function(t){var e=.5;this._minx=t.x-e,this._maxx=t.x+e,this._miny=t.y-e,this._maxy=t.y+e,this._corner[0]=new d(this._maxx,this._maxy),this._corner[1]=new d(this._minx,this._maxy),this._corner[2]=new d(this._minx,this._miny),this._corner[3]=new d(this._maxx,this._miny)};ge.prototype.intersects=function(t,e){return this._scaleFactor===1?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))};ge.prototype.scale=function(t){return Math.round(t*this._scaleFactor)};ge.prototype.getCoordinate=function(){return this._originalPt};ge.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)};ge.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var t=ge.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new F(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv};ge.prototype.intersectsPixelClosure=function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.hasIntersection())||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.hasIntersection())||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.hasIntersection()))};ge.prototype.intersectsToleranceSquare=function(t,e){var n=!1,r=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.isProper())||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.isProper())||(this._li.hasIntersection()&&(r=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.isProper())||n&&r||t.equals(this._pt)||e.equals(this._pt))};ge.prototype.addSnappedNode=function(t,e){var n=t.getCoordinate(e),r=t.getCoordinate(e+1);return this.intersects(n,r)?(t.addIntersection(this.getCoordinate(),e),!0):!1};ge.prototype.interfaces_=function(){return[]};ge.prototype.getClass=function(){return ge};Xu.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75};Object.defineProperties(ge,Xu);var ho=function(){this.tempEnv1=new F,this.selectedSegment=new G};ho.prototype.select=function(){if(arguments.length!==1&&arguments.length===2){var t=arguments[0],e=arguments[1];t.getLineSegment(e,this.selectedSegment),this.select(this.selectedSegment)}};ho.prototype.interfaces_=function(){return[]};ho.prototype.getClass=function(){return ho};var Pi=function(){this._index=null;var t=arguments[0];this._index=t},ju={HotPixelSnapAction:{configurable:!0}};Pi.prototype.snap=function(){if(arguments.length===1){var t=arguments[0];return this.snap(t,null,-1)}else if(arguments.length===3){var e=arguments[0],n=arguments[1],r=arguments[2],i=e.getSafeEnvelope(),o=new Yu(e,n,r);return this._index.query(i,{interfaces_:function(){return[fr]},visitItem:function(s){var a=s;a.select(i,o)}}),o.isNodeAdded()}};Pi.prototype.interfaces_=function(){return[]};Pi.prototype.getClass=function(){return Pi};ju.HotPixelSnapAction.get=function(){return Yu};Object.defineProperties(Pi,ju);var Yu=function(t){function e(){t.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var n=arguments[0],r=arguments[1],i=arguments[2];this._hotPixel=n,this._parentEdge=r,this._hotPixelVertexIndex=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isNodeAdded=function(){return this._isNodeAdded},e.prototype.select=function(){if(arguments.length===2){var n=arguments[0],r=arguments[1],i=n.getContext();if(this._parentEdge!==null&&i===this._parentEdge&&r===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(i,r)}else return t.prototype.select.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ho),Qr=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new O};Qr.prototype.processIntersections=function(t,e,n,r){var i=this;if(t===n&&e===r)return null;var o=t.getCoordinates()[e],s=t.getCoordinates()[e+1],a=n.getCoordinates()[r],u=n.getCoordinates()[r+1];if(this._li.computeIntersection(o,s,a,u),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var l=0;l<this._li.getIntersectionNum();l++)i._interiorIntersections.add(i._li.getIntersection(l));t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1)}};Qr.prototype.isDone=function(){return!1};Qr.prototype.getInteriorIntersections=function(){return this._interiorIntersections};Qr.prototype.interfaces_=function(){return[Fr]};Qr.prototype.getClass=function(){return Qr};var An=function(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;var t=arguments[0];this._pm=t,this._li=new Xr,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};An.prototype.checkCorrectness=function(t){var e=Lt.getNodedSubstrings(t),n=new _n(e);try{n.checkValid()}catch(r){if(r instanceof Ru)r.printStackTrace();else throw r}finally{}};An.prototype.getNodedSubstrings=function(){return Lt.getNodedSubstrings(this._nodedSegStrings)};An.prototype.snapRound=function(t,e){var n=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(n),this.computeVertexSnaps(t)};An.prototype.findInteriorIntersections=function(t,e){var n=new Qr(e);return this._noder.setSegmentIntersector(n),this._noder.computeNodes(t),n.getInteriorIntersections()};An.prototype.computeVertexSnaps=function(){var t=this;if(z(arguments[0],Pt))for(var e=arguments[0],n=e.iterator();n.hasNext();){var r=n.next();t.computeVertexSnaps(r)}else if(arguments[0]instanceof Lt)for(var i=arguments[0],o=i.getCoordinates(),s=0;s<o.length;s++){var a=new ge(o[s],t._scaleFactor,t._li),u=t._pointSnapper.snap(a,i,s);u&&i.addIntersection(o[s],s)}};An.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new ta,this._pointSnapper=new Pi(this._noder.getIndex()),this.snapRound(t,this._li)};An.prototype.computeIntersectionSnaps=function(t){for(var e=this,n=t.iterator();n.hasNext();){var r=n.next(),i=new ge(r,e._scaleFactor,e._li);e._pointSnapper.snap(i)}};An.prototype.interfaces_=function(){return[Dr]};An.prototype.getClass=function(){return An};var Ut=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new J,this._resultGeometry=null,this._saveException=null,arguments.length===1){var t=arguments[0];this._argGeom=t}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this._argGeom=e,this._bufParams=n}},$i={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};Ut.prototype.bufferFixedPrecision=function(t){var e=new mr(new An(new Q(1)),t.getScale()),n=new se(this._bufParams);n.setWorkingPrecisionModel(t),n.setNoder(e),this._resultGeometry=n.buffer(this._argGeom,this._distance)};Ut.prototype.bufferReducedPrecision=function(){var t=this;if(arguments.length===0){for(var e=Ut.MAX_PRECISION_DIGITS;e>=0;e--){try{t.bufferReducedPrecision(e)}catch(o){if(o instanceof Qn)t._saveException=o;else throw o}finally{}if(t._resultGeometry!==null)return null}throw this._saveException}else if(arguments.length===1){var n=arguments[0],r=Ut.precisionScaleFactor(this._argGeom,this._distance,n),i=new Q(r);this.bufferFixedPrecision(i)}};Ut.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===Q.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()};Ut.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)};Ut.prototype.bufferOriginalPrecision=function(){try{var t=new se(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(e){if(e instanceof Kn)this._saveException=e;else throw e}finally{}};Ut.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry};Ut.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)};Ut.prototype.interfaces_=function(){return[]};Ut.prototype.getClass=function(){return Ut};Ut.bufferOp=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new Ut(t),r=n.getResultGeometry(e);return r}else if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof B&&typeof arguments[1]=="number"){var i=arguments[0],o=arguments[1],s=arguments[2],a=new Ut(i);a.setQuadrantSegments(s);var u=a.getResultGeometry(o);return u}else if(arguments[2]instanceof J&&arguments[0]instanceof B&&typeof arguments[1]=="number"){var l=arguments[0],c=arguments[1],p=arguments[2],h=new Ut(l,p),g=h.getResultGeometry(c);return g}}else if(arguments.length===4){var f=arguments[0],m=arguments[1],y=arguments[2],v=arguments[3],x=new Ut(f);x.setQuadrantSegments(y),x.setEndCapStyle(v);var I=x.getResultGeometry(m);return I}};Ut.precisionScaleFactor=function(t,e,n){var r=t.getEnvelopeInternal(),i=we.max(Math.abs(r.getMaxX()),Math.abs(r.getMaxY()),Math.abs(r.getMinX()),Math.abs(r.getMinY())),o=e>0?e:0,s=i+2*o,a=Math.trunc(Math.log(s)/Math.log(10)+1),u=n-a,l=Math.pow(10,u);return l};$i.CAP_ROUND.get=function(){return J.CAP_ROUND};$i.CAP_BUTT.get=function(){return J.CAP_FLAT};$i.CAP_FLAT.get=function(){return J.CAP_FLAT};$i.CAP_SQUARE.get=function(){return J.CAP_SQUARE};$i.MAX_PRECISION_DIGITS.get=function(){return 12};Object.defineProperties(Ut,$i);var re=function(){this._pt=[new d,new d],this._distance=U.NaN,this._isNull=!0};re.prototype.getCoordinates=function(){return this._pt};re.prototype.getCoordinate=function(t){return this._pt[t]};re.prototype.setMinimum=function(){if(arguments.length===1){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r<this._distance&&this.initialize(e,n,r)}};re.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(arguments.length===3){var n=arguments[0],r=arguments[1],i=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=i,this._isNull=!1}};re.prototype.getDistance=function(){return this._distance};re.prototype.setMaximum=function(){if(arguments.length===1){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r>this._distance&&this.initialize(e,n,r)}};re.prototype.interfaces_=function(){return[]};re.prototype.getClass=function(){return re};var Cn=function(){};Cn.prototype.interfaces_=function(){return[]};Cn.prototype.getClass=function(){return Cn};Cn.computeDistance=function(){if(arguments[2]instanceof re&&arguments[0]instanceof _t&&arguments[1]instanceof d)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=t.getCoordinates(),i=new G,o=0;o<r.length-1;o++){i.setCoordinates(r[o],r[o+1]);var s=i.closestPoint(e);n.setMinimum(s,e)}else if(arguments[2]instanceof re&&arguments[0]instanceof Ft&&arguments[1]instanceof d){var a=arguments[0],u=arguments[1],l=arguments[2];Cn.computeDistance(a.getExteriorRing(),u,l);for(var c=0;c<a.getNumInteriorRing();c++)Cn.computeDistance(a.getInteriorRingN(c),u,l)}else if(arguments[2]instanceof re&&arguments[0]instanceof B&&arguments[1]instanceof d){var p=arguments[0],h=arguments[1],g=arguments[2];if(p instanceof _t)Cn.computeDistance(p,h,g);else if(p instanceof Ft)Cn.computeDistance(p,h,g);else if(p instanceof ae)for(var f=p,m=0;m<f.getNumGeometries();m++){var y=f.getGeometryN(m);Cn.computeDistance(y,h,g)}else g.setMinimum(p.getCoordinate(),h)}else if(arguments[2]instanceof re&&arguments[0]instanceof G&&arguments[1]instanceof d){var v=arguments[0],x=arguments[1],I=arguments[2],C=v.closestPoint(x);I.setMinimum(C,x)}};var kr=function(t){this._maxPtDist=new re,this._inputGeom=t||null},ea={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};kr.prototype.computeMaxMidpointDistance=function(t){var e=new yr(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())};kr.prototype.computeMaxVertexDistance=function(t){var e=new ti(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())};kr.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()};kr.prototype.getDistancePoints=function(){return this._maxPtDist};kr.prototype.interfaces_=function(){return[]};kr.prototype.getClass=function(){return kr};ea.MaxPointDistanceFilter.get=function(){return ti};ea.MaxMidpointDistanceFilter.get=function(){return yr};Object.defineProperties(kr,ea);var ti=function(t){this._maxPtDist=new re,this._minPtDist=new re,this._geom=t||null};ti.prototype.filter=function(t){this._minPtDist.initialize(),Cn.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)};ti.prototype.getMaxPointDistance=function(){return this._maxPtDist};ti.prototype.interfaces_=function(){return[Rn]};ti.prototype.getClass=function(){return ti};var yr=function(t){this._maxPtDist=new re,this._minPtDist=new re,this._geom=t||null};yr.prototype.filter=function(t,e){if(e===0)return null;var n=t.getCoordinate(e-1),r=t.getCoordinate(e),i=new d((n.x+r.x)/2,(n.y+r.y)/2);this._minPtDist.initialize(),Cn.computeDistance(this._geom,i,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)};yr.prototype.isDone=function(){return!1};yr.prototype.isGeometryChanged=function(){return!1};yr.prototype.getMaxPointDistance=function(){return this._maxPtDist};yr.prototype.interfaces_=function(){return[Ye]};yr.prototype.getClass=function(){return yr};var Zn=function(t){this._comps=t||null};Zn.prototype.filter=function(t){t instanceof Ft&&this._comps.add(t)};Zn.prototype.interfaces_=function(){return[fn]};Zn.prototype.getClass=function(){return Zn};Zn.getPolygons=function(){if(arguments.length===1){var t=arguments[0];return Zn.getPolygons(t,new O)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return e instanceof Ft?n.add(e):e instanceof ae&&e.apply(new Zn(n)),n}};var zt=function(){if(this._lines=null,this._isForcedToLineString=!1,arguments.length===1){var t=arguments[0];this._lines=t}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this._lines=e,this._isForcedToLineString=n}};zt.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof On){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof _t&&this._lines.add(t)};zt.prototype.setForceToLineString=function(t){this._isForcedToLineString=t};zt.prototype.interfaces_=function(){return[Jn]};zt.prototype.getClass=function(){return zt};zt.getGeometry=function(){if(arguments.length===1){var t=arguments[0];return t.getFactory().buildGeometry(zt.getLines(t))}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return e.getFactory().buildGeometry(zt.getLines(e,n))}};zt.getLines=function(){if(arguments.length===1){var t=arguments[0];return zt.getLines(t,!1)}else if(arguments.length===2){if(z(arguments[0],Pt)&&z(arguments[1],Pt)){for(var e=arguments[0],n=arguments[1],r=e.iterator();r.hasNext();){var i=r.next();zt.getLines(i,n)}return n}else if(arguments[0]instanceof B&&typeof arguments[1]=="boolean"){var o=arguments[0],s=arguments[1],a=new O;return o.apply(new zt(a,s)),a}else if(arguments[0]instanceof B&&z(arguments[1],Pt)){var u=arguments[0],l=arguments[1];return u instanceof _t?l.add(u):u.apply(new zt(l)),l}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&z(arguments[0],Pt)&&z(arguments[1],Pt)){for(var c=arguments[0],p=arguments[1],h=arguments[2],g=c.iterator();g.hasNext();){var f=g.next();zt.getLines(f,p,h)}return p}else if(typeof arguments[2]=="boolean"&&arguments[0]instanceof B&&z(arguments[1],Pt)){var m=arguments[0],y=arguments[1],v=arguments[2];return m.apply(new zt(y,v)),y}}};var Ke=function(){if(this._boundaryRule=Ge.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,arguments.length!==0&&arguments.length===1){var t=arguments[0];if(t===null)throw new ft("Rule must be non-null");this._boundaryRule=t}};Ke.prototype.locateInternal=function(){var t=this;if(arguments[0]instanceof d&&arguments[1]instanceof Ft){var e=arguments[0],n=arguments[1];if(n.isEmpty())return _.EXTERIOR;var r=n.getExteriorRing(),i=this.locateInPolygonRing(e,r);if(i===_.EXTERIOR)return _.EXTERIOR;if(i===_.BOUNDARY)return _.BOUNDARY;for(var o=0;o<n.getNumInteriorRing();o++){var s=n.getInteriorRingN(o),a=t.locateInPolygonRing(e,s);if(a===_.INTERIOR)return _.EXTERIOR;if(a===_.BOUNDARY)return _.BOUNDARY}return _.INTERIOR}else if(arguments[0]instanceof d&&arguments[1]instanceof _t){var u=arguments[0],l=arguments[1];if(!l.getEnvelopeInternal().intersects(u))return _.EXTERIOR;var c=l.getCoordinates();return!l.isClosed()&&(u.equals(c[0])||u.equals(c[c.length-1]))?_.BOUNDARY:M.isOnLine(u,c)?_.INTERIOR:_.EXTERIOR}else if(arguments[0]instanceof d&&arguments[1]instanceof _e){var p=arguments[0],h=arguments[1],g=h.getCoordinate();return g.equals2D(p)?_.INTERIOR:_.EXTERIOR}};Ke.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?M.locatePointInRing(t,e.getCoordinates()):_.EXTERIOR};Ke.prototype.intersects=function(t,e){return this.locate(t,e)!==_.EXTERIOR};Ke.prototype.updateLocationInfo=function(t){t===_.INTERIOR&&(this._isIn=!0),t===_.BOUNDARY&&this._numBoundaries++};Ke.prototype.computeLocation=function(t,e){var n=this;if(e instanceof _e&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof _t)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Ft)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Mr)for(var r=e,i=0;i<r.getNumGeometries();i++){var o=r.getGeometryN(i);n.updateLocationInfo(n.locateInternal(t,o))}else if(e instanceof wn)for(var s=e,a=0;a<s.getNumGeometries();a++){var u=s.getGeometryN(a);n.updateLocationInfo(n.locateInternal(t,u))}else if(e instanceof ae)for(var l=new Tn(e);l.hasNext();){var c=l.next();c!==e&&n.computeLocation(t,c)}};Ke.prototype.locate=function(t,e){return e.isEmpty()?_.EXTERIOR:e instanceof _t?this.locateInternal(t,e):e instanceof Ft?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?_.BOUNDARY:this._numBoundaries>0||this._isIn?_.INTERIOR:_.EXTERIOR)};Ke.prototype.interfaces_=function(){return[]};Ke.prototype.getClass=function(){return Ke};var ie=function t(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var e=arguments[0],n=arguments[1];t.call(this,e,t.INSIDE_AREA,n)}else if(arguments.length===3){var r=arguments[0],i=arguments[1],o=arguments[2];this._component=r,this._segIndex=i,this._pt=o}},Wu={INSIDE_AREA:{configurable:!0}};ie.prototype.isInsideArea=function(){return this._segIndex===ie.INSIDE_AREA};ie.prototype.getCoordinate=function(){return this._pt};ie.prototype.getGeometryComponent=function(){return this._component};ie.prototype.getSegmentIndex=function(){return this._segIndex};ie.prototype.interfaces_=function(){return[]};ie.prototype.getClass=function(){return ie};Wu.INSIDE_AREA.get=function(){return-1};Object.defineProperties(ie,Wu);var ur=function(t){this._pts=t||null};ur.prototype.filter=function(t){t instanceof _e&&this._pts.add(t)};ur.prototype.interfaces_=function(){return[fn]};ur.prototype.getClass=function(){return ur};ur.getPoints=function(){if(arguments.length===1){var t=arguments[0];return t instanceof _e?He.singletonList(t):ur.getPoints(t,new O)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return e instanceof _e?n.add(e):e instanceof ae&&e.apply(new ur(n)),n}};var ei=function(){this._locations=null;var t=arguments[0];this._locations=t};ei.prototype.filter=function(t){(t instanceof _e||t instanceof _t||t instanceof Ft)&&this._locations.add(new ie(t,0,t.getCoordinate()))};ei.prototype.interfaces_=function(){return[fn]};ei.prototype.getClass=function(){return ei};ei.getLocations=function(t){var e=new O;return t.apply(new ei(e)),e};var Xt=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Ke,this._minDistanceLocation=null,this._minDistance=U.MAX_VALUE,arguments.length===2){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(arguments.length===3){var n=arguments[0],r=arguments[1],i=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=r,this._terminateDistance=i}};Xt.prototype.computeContainmentDistance=function(){var t=this;if(arguments.length===0){var e=new Array(2).fill(null);if(this.computeContainmentDistance(0,e),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,e)}else if(arguments.length===2){var n=arguments[0],r=arguments[1],i=1-n,o=Zn.getPolygons(this._geom[n]);if(o.size()>0){var s=ei.getLocations(this._geom[i]);if(this.computeContainmentDistance(s,o,r),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[i]=r[0],this._minDistanceLocation[n]=r[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&z(arguments[0],Xe)&&z(arguments[1],Xe)){for(var a=arguments[0],u=arguments[1],l=arguments[2],c=0;c<a.size();c++)for(var p=a.get(c),h=0;h<u.size();h++)if(t.computeContainmentDistance(p,u.get(h),l),t._minDistance<=t._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof ie&&arguments[1]instanceof Ft){var g=arguments[0],f=arguments[1],m=arguments[2],y=g.getCoordinate();if(_.EXTERIOR!==this._ptLocator.locate(y,f))return this._minDistance=0,m[0]=g,m[1]=new ie(f,y),null}}};Xt.prototype.computeMinDistanceLinesPoints=function(t,e,n){for(var r=this,i=0;i<t.size();i++)for(var o=t.get(i),s=0;s<e.size();s++){var a=e.get(s);if(r.computeMinDistance(o,a,n),r._minDistance<=r._terminateDistance)return null}};Xt.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=zt.getLines(this._geom[0]),n=zt.getLines(this._geom[1]),r=ur.getPoints(this._geom[0]),i=ur.getPoints(this._geom[1]);if(this.computeMinDistanceLines(e,n,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance||(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(e,i,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance)||(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(n,r,t),this.updateMinDistance(t,!0),this._minDistance<=this._terminateDistance))return null;t[0]=null,t[1]=null,this.computeMinDistancePoints(r,i,t),this.updateMinDistance(t,!1)};Xt.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation};Xt.prototype.updateMinDistance=function(t,e){if(t[0]===null)return null;e?(this._minDistanceLocation[0]=t[1],this._minDistanceLocation[1]=t[0]):(this._minDistanceLocation[0]=t[0],this._minDistanceLocation[1]=t[1])};Xt.prototype.nearestPoints=function(){this.computeMinDistance();var t=[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()];return t};Xt.prototype.computeMinDistance=function(){var t=this;if(arguments.length===0){if(this._minDistanceLocation!==null||(this._minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this._minDistance<=this._terminateDistance))return null;this.computeFacetDistance()}else if(arguments.length===3){if(arguments[2]instanceof Array&&arguments[0]instanceof _t&&arguments[1]instanceof _e){var e=arguments[0],n=arguments[1],r=arguments[2];if(e.getEnvelopeInternal().distance(n.getEnvelopeInternal())>this._minDistance)return null;for(var i=e.getCoordinates(),o=n.getCoordinate(),s=0;s<i.length-1;s++){var a=M.distancePointLine(o,i[s],i[s+1]);if(a<t._minDistance){t._minDistance=a;var u=new G(i[s],i[s+1]),l=u.closestPoint(o);r[0]=new ie(e,s,l),r[1]=new ie(n,0,o)}if(t._minDistance<=t._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof _t&&arguments[1]instanceof _t){var c=arguments[0],p=arguments[1],h=arguments[2];if(c.getEnvelopeInternal().distance(p.getEnvelopeInternal())>this._minDistance)return null;for(var g=c.getCoordinates(),f=p.getCoordinates(),m=0;m<g.length-1;m++)for(var y=0;y<f.length-1;y++){var v=M.distanceLineLine(g[m],g[m+1],f[y],f[y+1]);if(v<t._minDistance){t._minDistance=v;var x=new G(g[m],g[m+1]),I=new G(f[y],f[y+1]),C=x.closestPoints(I);h[0]=new ie(c,m,C[0]),h[1]=new ie(p,y,C[1])}if(t._minDistance<=t._terminateDistance)return null}}}};Xt.prototype.computeMinDistancePoints=function(t,e,n){for(var r=this,i=0;i<t.size();i++)for(var o=t.get(i),s=0;s<e.size();s++){var a=e.get(s),u=o.getCoordinate().distance(a.getCoordinate());if(u<r._minDistance&&(r._minDistance=u,n[0]=new ie(o,0,o.getCoordinate()),n[1]=new ie(a,0,a.getCoordinate())),r._minDistance<=r._terminateDistance)return null}};Xt.prototype.distance=function(){if(this._geom[0]===null||this._geom[1]===null)throw new ft("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)};Xt.prototype.computeMinDistanceLines=function(t,e,n){for(var r=this,i=0;i<t.size();i++)for(var o=t.get(i),s=0;s<e.size();s++){var a=e.get(s);if(r.computeMinDistance(o,a,n),r._minDistance<=r._terminateDistance)return null}};Xt.prototype.interfaces_=function(){return[]};Xt.prototype.getClass=function(){return Xt};Xt.distance=function(t,e){var n=new Xt(t,e);return n.distance()};Xt.isWithinDistance=function(t,e,n){var r=new Xt(t,e,n);return r.distance()<=n};Xt.nearestPoints=function(t,e){var n=new Xt(t,e);return n.nearestPoints()};var Kt=function(){this._pt=[new d,new d],this._distance=U.NaN,this._isNull=!0};Kt.prototype.getCoordinates=function(){return this._pt};Kt.prototype.getCoordinate=function(t){return this._pt[t]};Kt.prototype.setMinimum=function(){if(arguments.length===1){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r<this._distance&&this.initialize(e,n,r)}};Kt.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(arguments.length===3){var n=arguments[0],r=arguments[1],i=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=i,this._isNull=!1}};Kt.prototype.toString=function(){return je.toLineString(this._pt[0],this._pt[1])};Kt.prototype.getDistance=function(){return this._distance};Kt.prototype.setMaximum=function(){if(arguments.length===1){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r>this._distance&&this.initialize(e,n,r)}};Kt.prototype.interfaces_=function(){return[]};Kt.prototype.getClass=function(){return Kt};var an=function(){};an.prototype.interfaces_=function(){return[]};an.prototype.getClass=function(){return an};an.computeDistance=function(){if(arguments[2]instanceof Kt&&arguments[0]instanceof _t&&arguments[1]instanceof d)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=new G,i=t.getCoordinates(),o=0;o<i.length-1;o++){r.setCoordinates(i[o],i[o+1]);var s=r.closestPoint(e);n.setMinimum(s,e)}else if(arguments[2]instanceof Kt&&arguments[0]instanceof Ft&&arguments[1]instanceof d){var a=arguments[0],u=arguments[1],l=arguments[2];an.computeDistance(a.getExteriorRing(),u,l);for(var c=0;c<a.getNumInteriorRing();c++)an.computeDistance(a.getInteriorRingN(c),u,l)}else if(arguments[2]instanceof Kt&&arguments[0]instanceof B&&arguments[1]instanceof d){var p=arguments[0],h=arguments[1],g=arguments[2];if(p instanceof _t)an.computeDistance(p,h,g);else if(p instanceof Ft)an.computeDistance(p,h,g);else if(p instanceof ae)for(var f=p,m=0;m<f.getNumGeometries();m++){var y=f.getGeometryN(m);an.computeDistance(y,h,g)}else g.setMinimum(p.getCoordinate(),h)}else if(arguments[2]instanceof Kt&&arguments[0]instanceof G&&arguments[1]instanceof d){var v=arguments[0],x=arguments[1],I=arguments[2],C=v.closestPoint(x);I.setMinimum(C,x)}};var Fe=function(){this._g0=null,this._g1=null,this._ptDist=new Kt,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e},na={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};Fe.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()};Fe.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new ft("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t};Fe.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)};Fe.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()};Fe.prototype.computeOrientedDistance=function(t,e,n){var r=new ni(e);if(t.apply(r),n.setMaximum(r.getMaxPointDistance()),this._densifyFrac>0){var i=new _r(e,this._densifyFrac);t.apply(i),n.setMaximum(i.getMaxPointDistance())}};Fe.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()};Fe.prototype.interfaces_=function(){return[]};Fe.prototype.getClass=function(){return Fe};Fe.distance=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new Fe(t,e);return n.distance()}else if(arguments.length===3){var r=arguments[0],i=arguments[1],o=arguments[2],s=new Fe(r,i);return s.setDensifyFraction(o),s.distance()}};na.MaxPointDistanceFilter.get=function(){return ni};na.MaxDensifiedByFractionDistanceFilter.get=function(){return _r};Object.defineProperties(Fe,na);var ni=function(){this._maxPtDist=new Kt,this._minPtDist=new Kt,this._euclideanDist=new an,this._geom=null;var t=arguments[0];this._geom=t};ni.prototype.filter=function(t){this._minPtDist.initialize(),an.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)};ni.prototype.getMaxPointDistance=function(){return this._maxPtDist};ni.prototype.interfaces_=function(){return[Rn]};ni.prototype.getClass=function(){return ni};var _r=function(){this._maxPtDist=new Kt,this._minPtDist=new Kt,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};_r.prototype.filter=function(t,e){var n=this;if(e===0)return null;for(var r=t.getCoordinate(e-1),i=t.getCoordinate(e),o=(i.x-r.x)/this._numSubSegs,s=(i.y-r.y)/this._numSubSegs,a=0;a<this._numSubSegs;a++){var u=r.x+a*o,l=r.y+a*s,c=new d(u,l);n._minPtDist.initialize(),an.computeDistance(n._geom,c,n._minPtDist),n._maxPtDist.setMaximum(n._minPtDist)}};_r.prototype.isDone=function(){return!1};_r.prototype.isGeometryChanged=function(){return!1};_r.prototype.getMaxPointDistance=function(){return this._maxPtDist};_r.prototype.interfaces_=function(){return[Ye]};_r.prototype.getClass=function(){return _r};var me=function(t,e,n){this._minValidDistance=null,this._maxValidDistance=null,this._minDistanceFound=null,this._maxDistanceFound=null,this._isValid=!0,this._errMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._bufDistance=e||null,this._result=n||null},ra={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};me.prototype.checkMaximumDistance=function(t,e,n){var r=new Fe(e,t);if(r.setDensifyFraction(.25),this._maxDistanceFound=r.orientedDistance(),this._maxDistanceFound>n){this._isValid=!1;var i=r.getCoordinates();this._errorLocation=i[1],this._errorIndicator=t.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+je.toLineString(i[0],i[1])+")"}};me.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=me.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,this._input.isEmpty()||this._result.isEmpty()?!0:(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),me.VERBOSE&&$t.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)};me.prototype.checkNegativeValid=function(){if(!(this._input instanceof Ft||this._input instanceof wn||this._input instanceof ae))return null;var t=this.getPolygonLines(this._input);if(this.checkMinimumDistance(t,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(t,this._result,this._maxValidDistance)};me.prototype.getErrorIndicator=function(){return this._errorIndicator};me.prototype.checkMinimumDistance=function(t,e,n){var r=new Xt(t,e,n);if(this._minDistanceFound=r.distance(),this._minDistanceFound<n){this._isValid=!1;var i=r.nearestPoints();this._errorLocation=r.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+je.toLineString(i[0],i[1])+" )"}};me.prototype.checkPositiveValid=function(){var t=this._result.getBoundary();if(this.checkMinimumDistance(this._input,t,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(this._input,t,this._maxValidDistance)};me.prototype.getErrorLocation=function(){return this._errorLocation};me.prototype.getPolygonLines=function(t){for(var e=new O,n=new zt(e),r=Zn.getPolygons(t),i=r.iterator();i.hasNext();){var o=i.next();o.apply(n)}return t.getFactory().buildGeometry(e)};me.prototype.getErrorMessage=function(){return this._errMsg};me.prototype.interfaces_=function(){return[]};me.prototype.getClass=function(){return me};ra.VERBOSE.get=function(){return!1};ra.MAX_DISTANCE_DIFF_FRAC.get=function(){return .012};Object.defineProperties(me,ra);var jt=function(t,e,n){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._distance=e||null,this._result=n||null},ia={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};jt.prototype.isValid=function(){return this.checkPolygonal(),this._isValid?(this.checkExpectedEmpty(),this._isValid?(this.checkEnvelope(),this._isValid?(this.checkArea(),this._isValid?(this.checkDistance(),this._isValid):this._isValid):this._isValid):this._isValid):this._isValid};jt.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*jt.MAX_ENV_DIFF_FRAC;t===0&&(t=.001);var e=new F(this._input.getEnvelopeInternal());e.expandBy(this._distance);var n=new F(this._result.getEnvelopeInternal());n.expandBy(t),n.contains(e)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(n)),this.report("Envelope")};jt.prototype.checkDistance=function(){var t=new me(this._input,this._distance,this._result);t.isValid()||(this._isValid=!1,this._errorMsg=t.getErrorMessage(),this._errorLocation=t.getErrorLocation(),this._errorIndicator=t.getErrorIndicator()),this.report("Distance")};jt.prototype.checkArea=function(){var t=this._input.getArea(),e=this._result.getArea();this._distance>0&&t>e&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&t<e&&(this._isValid=!1,this._errorMsg="Area of negative buffer is larger than input",this._errorIndicator=this._result),this.report("Area")};jt.prototype.checkPolygonal=function(){this._result instanceof Ft||this._result instanceof wn||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")};jt.prototype.getErrorIndicator=function(){return this._errorIndicator};jt.prototype.getErrorLocation=function(){return this._errorLocation};jt.prototype.checkExpectedEmpty=function(){if(this._input.getDimension()>=2||this._distance>0)return null;this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),this.report("ExpectedEmpty")};jt.prototype.report=function(t){if(!jt.VERBOSE)return null;$t.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))};jt.prototype.getErrorMessage=function(){return this._errorMsg};jt.prototype.interfaces_=function(){return[]};jt.prototype.getClass=function(){return jt};jt.isValidMsg=function(t,e,n){var r=new jt(t,e,n);return r.isValid()?null:r.getErrorMessage()};jt.isValid=function(t,e,n){var r=new jt(t,e,n);return!!r.isValid()};ia.VERBOSE.get=function(){return!1};ia.MAX_ENV_DIFF_FRAC.get=function(){return .012};Object.defineProperties(jt,ia);var vn=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};vn.prototype.getCoordinates=function(){return this._pts};vn.prototype.size=function(){return this._pts.length};vn.prototype.getCoordinate=function(t){return this._pts[t]};vn.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])};vn.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:Kr.octant(this.getCoordinate(t),this.getCoordinate(t+1))};vn.prototype.setData=function(t){this._data=t};vn.prototype.getData=function(){return this._data};vn.prototype.toString=function(){return je.toLineString(new xt(this._pts))};vn.prototype.interfaces_=function(){return[Mn]};vn.prototype.getClass=function(){return vn};var qt=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new O,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};qt.prototype.getInteriorIntersection=function(){return this._interiorIntersection};qt.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t};qt.prototype.getIntersectionSegments=function(){return this._intSegments};qt.prototype.count=function(){return this._intersectionCount};qt.prototype.getIntersections=function(){return this._intersections};qt.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t};qt.prototype.setKeepIntersections=function(t){this._keepIntersections=t};qt.prototype.processIntersections=function(t,e,n,r){if(!this._findAllIntersections&&this.hasIntersection()||t===n&&e===r)return null;if(this._isCheckEndSegmentsOnly){var i=this.isEndSegment(t,e)||this.isEndSegment(n,r);if(!i)return null}var o=t.getCoordinates()[e],s=t.getCoordinates()[e+1],a=n.getCoordinates()[r],u=n.getCoordinates()[r+1];this._li.computeIntersection(o,s,a,u),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=o,this._intSegments[1]=s,this._intSegments[2]=a,this._intSegments[3]=u,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)};qt.prototype.isEndSegment=function(t,e){return e===0||e>=t.size()-2};qt.prototype.hasIntersection=function(){return this._interiorIntersection!==null};qt.prototype.isDone=function(){return this._findAllIntersections?!1:this._interiorIntersection!==null};qt.prototype.interfaces_=function(){return[Fr]};qt.prototype.getClass=function(){return qt};qt.createAllIntersectionsFinder=function(t){var e=new qt(t);return e.setFindAllIntersections(!0),e};qt.createAnyIntersectionFinder=function(t){return new qt(t)};qt.createIntersectionCounter=function(t){var e=new qt(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var Je=function(){this._li=new Xr,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};Je.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()};Je.prototype.getIntersections=function(){return this._segInt.getIntersections()};Je.prototype.isValid=function(){return this.execute(),this._isValid};Je.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t};Je.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new qt(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new ta;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null};Je.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Qn(this.getErrorMessage(),this._segInt.getInteriorIntersection())};Je.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+je.toLineString(t[0],t[1])+" and "+je.toLineString(t[2],t[3])};Je.prototype.interfaces_=function(){return[]};Je.prototype.getClass=function(){return Je};Je.computeIntersections=function(t){var e=new Je(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var qr=function t(){this._nv=null;var e=arguments[0];this._nv=new Je(t.toSegmentStrings(e))};qr.prototype.checkValid=function(){this._nv.checkValid()};qr.prototype.interfaces_=function(){return[]};qr.prototype.getClass=function(){return qr};qr.toSegmentStrings=function(t){for(var e=new O,n=t.iterator();n.hasNext();){var r=n.next();e.add(new vn(r.getCoordinates(),r))}return e};qr.checkValid=function(t){var e=new qr(t);e.checkValid()};var ri=function(t){this._mapOp=t};ri.prototype.map=function(t){for(var e=this,n=new O,r=0;r<t.getNumGeometries();r++){var i=e._mapOp.map(t.getGeometryN(r));i.isEmpty()||n.add(i)}return t.getFactory().createGeometryCollection(j.toGeometryArray(n))};ri.prototype.interfaces_=function(){return[]};ri.prototype.getClass=function(){return ri};ri.map=function(t,e){var n=new ri(e);return n.map(t)};var En=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new O,this._resultLineList=new O;var t=arguments[0],e=arguments[1],n=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=n};En.prototype.collectLines=function(t){for(var e=this,n=this._op.getGraph().getEdgeEnds().iterator();n.hasNext();){var r=n.next();e.collectLineEdge(r,t,e._lineEdgesList),e.collectBoundaryTouchEdge(r,t,e._lineEdgesList)}};En.prototype.labelIsolatedLine=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,n)};En.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList};En.prototype.collectLineEdge=function(t,e,n){var r=t.getLabel(),i=t.getEdge();t.isLineEdge()&&!t.isVisited()&&V.isResultOfOp(r,e)&&!i.isCovered()&&(n.add(i),t.setVisitedEdge(!0))};En.prototype.findCoveredLineEdges=function(){for(var t=this,e=this._op.getGraph().getNodes().iterator();e.hasNext();){var n=e.next();n.getEdges().findCoveredLineEdges()}for(var r=this._op.getGraph().getEdgeEnds().iterator();r.hasNext();){var i=r.next(),o=i.getEdge();if(i.isLineEdge()&&!o.isCoveredSet()){var s=t._op.isCoveredByA(i.getCoordinate());o.setCovered(s)}}};En.prototype.labelIsolatedLines=function(t){for(var e=this,n=t.iterator();n.hasNext();){var r=n.next(),i=r.getLabel();r.isIsolated()&&(i.isNull(0)?e.labelIsolatedLine(r,0):e.labelIsolatedLine(r,1))}};En.prototype.buildLines=function(t){for(var e=this,n=this._lineEdgesList.iterator();n.hasNext();){var r=n.next(),i=e._geometryFactory.createLineString(r.getCoordinates());e._resultLineList.add(i),r.setInResult(!0)}};En.prototype.collectBoundaryTouchEdge=function(t,e,n){var r=t.getLabel();if(t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult())return null;$.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),V.isResultOfOp(r,e)&&e===V.INTERSECTION&&(n.add(t.getEdge()),t.setVisitedEdge(!0))};En.prototype.interfaces_=function(){return[]};En.prototype.getClass=function(){return En};var ii=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new O;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e};ii.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var n=this._geometryFactory.createPoint(e);this._resultPointList.add(n)}};ii.prototype.extractNonCoveredResultNodes=function(t){for(var e=this,n=this._op.getGraph().getNodes().iterator();n.hasNext();){var r=n.next();if(!r.isInResult()&&!r.isIncidentEdgeInResult()&&(r.getEdges().getDegree()===0||t===V.INTERSECTION)){var i=r.getLabel();V.isResultOfOp(i,t)&&e.filterCoveredNodeToPoint(r)}}};ii.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList};ii.prototype.interfaces_=function(){return[]};ii.prototype.getClass=function(){return ii};var de=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};de.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))};de.prototype.transformPolygon=function(t,e){var n=this,r=!0,i=this.transformLinearRing(t.getExteriorRing(),t);(i===null||!(i instanceof On)||i.isEmpty())&&(r=!1);for(var o=new O,s=0;s<t.getNumInteriorRing();s++){var a=n.transformLinearRing(t.getInteriorRingN(s),t);a===null||a.isEmpty()||(a instanceof On||(r=!1),o.add(a))}if(r)return this._factory.createPolygon(i,o.toArray([]));var u=new O;return i!==null&&u.add(i),u.addAll(o),this._factory.buildGeometry(u)};de.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)};de.prototype.getInputGeometry=function(){return this._inputGeom};de.prototype.transformMultiLineString=function(t,e){for(var n=this,r=new O,i=0;i<t.getNumGeometries();i++){var o=n.transformLineString(t.getGeometryN(i),t);o!==null&&(o.isEmpty()||r.add(o))}return this._factory.buildGeometry(r)};de.prototype.transformCoordinates=function(t,e){return this.copy(t)};de.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))};de.prototype.transformMultiPoint=function(t,e){for(var n=this,r=new O,i=0;i<t.getNumGeometries();i++){var o=n.transformPoint(t.getGeometryN(i),t);o!==null&&(o.isEmpty()||r.add(o))}return this._factory.buildGeometry(r)};de.prototype.transformMultiPolygon=function(t,e){for(var n=this,r=new O,i=0;i<t.getNumGeometries();i++){var o=n.transformPolygon(t.getGeometryN(i),t);o!==null&&(o.isEmpty()||r.add(o))}return this._factory.buildGeometry(r)};de.prototype.copy=function(t){return t.copy()};de.prototype.transformGeometryCollection=function(t,e){for(var n=this,r=new O,i=0;i<t.getNumGeometries();i++){var o=n.transform(t.getGeometryN(i));o!==null&&(n._pruneEmptyGeometry&&o.isEmpty()||r.add(o))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(j.toGeometryArray(r)):this._factory.buildGeometry(r)};de.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof _e)return this.transformPoint(t,null);if(t instanceof Si)return this.transformMultiPoint(t,null);if(t instanceof On)return this.transformLinearRing(t,null);if(t instanceof _t)return this.transformLineString(t,null);if(t instanceof Mr)return this.transformMultiLineString(t,null);if(t instanceof Ft)return this.transformPolygon(t,null);if(t instanceof wn)return this.transformMultiPolygon(t,null);if(t instanceof ae)return this.transformGeometryCollection(t,null);throw new ft("Unknown Geometry subtype: "+t.getClass().getName())};de.prototype.transformLinearRing=function(t,e){var n=this.transformCoordinates(t.getCoordinateSequence(),t);if(n===null)return this._factory.createLinearRing(null);var r=n.size();return r>0&&r<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)};de.prototype.interfaces_=function(){return[]};de.prototype.getClass=function(){return de};var Fn=function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new G,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof _t&&typeof arguments[1]=="number"){var e=arguments[0],n=arguments[1];t.call(this,e.getCoordinates(),n)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var r=arguments[0],i=arguments[1];this._srcPts=r,this._isClosed=t.isClosed(r),this._snapTolerance=i}};Fn.prototype.snapVertices=function(t,e){for(var n=this,r=this._isClosed?t.size()-1:t.size(),i=0;i<r;i++){var o=t.get(i),s=n.findSnapForVertex(o,e);s!==null&&(t.set(i,new d(s)),i===0&&n._isClosed&&t.set(t.size()-1,new d(s)))}};Fn.prototype.findSnapForVertex=function(t,e){for(var n=this,r=0;r<e.length;r++){if(t.equals2D(e[r]))return null;if(t.distance(e[r])<n._snapTolerance)return e[r]}return null};Fn.prototype.snapTo=function(t){var e=new vo(this._srcPts);this.snapVertices(e,t),this.snapSegments(e,t);var n=e.toCoordinateArray();return n};Fn.prototype.snapSegments=function(t,e){var n=this;if(e.length===0)return null;var r=e.length;e[0].equals2D(e[e.length-1])&&(r=e.length-1);for(var i=0;i<r;i++){var o=e[i],s=n.findSegmentIndexToSnap(o,t);s>=0&&t.add(s+1,new d(o),!1)}};Fn.prototype.findSegmentIndexToSnap=function(t,e){for(var n=this,r=U.MAX_VALUE,i=-1,o=0;o<e.size()-1;o++){if(n._seg.p0=e.get(o),n._seg.p1=e.get(o+1),n._seg.p0.equals2D(t)||n._seg.p1.equals2D(t)){if(n._allowSnappingToSourceVertices)continue;return-1}var s=n._seg.distance(t);s<n._snapTolerance&&s<r&&(r=s,i=o)}return i};Fn.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t};Fn.prototype.interfaces_=function(){return[]};Fn.prototype.getClass=function(){return Fn};Fn.isClosed=function(t){return t.length<=1?!1:t[0].equals2D(t[t.length-1])};var It=function(t){this._srcGeom=t||null},Hu={SNAP_PRECISION_FACTOR:{configurable:!0}};It.prototype.snapTo=function(t,e){var n=this.extractTargetCoordinates(t),r=new Zu(e,n);return r.transform(this._srcGeom)};It.prototype.snapToSelf=function(t,e){var n=this.extractTargetCoordinates(this._srcGeom),r=new Zu(t,n,!0),i=r.transform(this._srcGeom),o=i;return e&&z(o,hr)&&(o=i.buffer(0)),o};It.prototype.computeSnapTolerance=function(t){var e=this.computeMinimumSegmentLength(t),n=e/10;return n};It.prototype.extractTargetCoordinates=function(t){for(var e=new hn,n=t.getCoordinates(),r=0;r<n.length;r++)e.add(n[r]);return e.toArray(new Array(0).fill(null))};It.prototype.computeMinimumSegmentLength=function(t){for(var e=U.MAX_VALUE,n=0;n<t.length-1;n++){var r=t[n].distance(t[n+1]);r<e&&(e=r)}return e};It.prototype.interfaces_=function(){return[]};It.prototype.getClass=function(){return It};It.snap=function(t,e,n){var r=new Array(2).fill(null),i=new It(t);r[0]=i.snapTo(e,n);var o=new It(e);return r[1]=o.snapTo(r[0],n),r};It.computeOverlaySnapTolerance=function(){if(arguments.length===1){var t=arguments[0],e=It.computeSizeBasedSnapTolerance(t),n=t.getPrecisionModel();if(n.getType()===Q.FIXED){var r=1/n.getScale()*2/1.415;r>e&&(e=r)}return e}else if(arguments.length===2){var i=arguments[0],o=arguments[1];return Math.min(It.computeOverlaySnapTolerance(i),It.computeOverlaySnapTolerance(o))}};It.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal(),n=Math.min(e.getHeight(),e.getWidth()),r=n*It.SNAP_PRECISION_FACTOR;return r};It.snapToSelf=function(t,e,n){var r=new It(t);return r.snapToSelf(e,n)};Hu.SNAP_PRECISION_FACTOR.get=function(){return 1e-9};Object.defineProperties(It,Hu);var Zu=function(t){function e(n,r,i){t.call(this),this._snapTolerance=n||null,this._snapPts=r||null,this._isSelfSnap=i!==void 0?i:!1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(n,r){var i=new Fn(n,this._snapTolerance);return i.setAllowSnappingToSourceVertices(this._isSelfSnap),i.snapTo(r)},e.prototype.transformCoordinates=function(n,r){var i=n.toCoordinateArray(),o=this.snapLine(i,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(o)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(de),ne=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};ne.prototype.getCommon=function(){return U.longBitsToDouble(this._commonBits)};ne.prototype.add=function(t){var e=U.doubleToLongBits(t);if(this._isFirst)return this._commonBits=e,this._commonSignExp=ne.signExpBits(this._commonBits),this._isFirst=!1,null;var n=ne.signExpBits(e);if(n!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=ne.numCommonMostSigMantissaBits(this._commonBits,e),this._commonBits=ne.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))};ne.prototype.toString=function(){if(arguments.length===1){var t=arguments[0],e=U.longBitsToDouble(t),n=U.toBinaryString(t),r="0000000000000000000000000000000000000000000000000000000000000000"+n,i=r.substring(r.length-64),o=i.substring(0,1)+" "+i.substring(1,12)+"(exp) "+i.substring(12)+" [ "+e+" ]";return o}};ne.prototype.interfaces_=function(){return[]};ne.prototype.getClass=function(){return ne};ne.getBit=function(t,e){var n=1<<e;return t&n?1:0};ne.signExpBits=function(t){return t>>52};ne.zeroLowerBits=function(t,e){var n=(1<<e)-1,r=~n,i=t&r;return i};ne.numCommonMostSigMantissaBits=function(t,e){for(var n=0,r=52;r>=0;r--){if(ne.getBit(t,r)!==ne.getBit(e,r))return n;n++}return 52};var vr=function(){this._commonCoord=null,this._ccFilter=new oi},oa={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};vr.prototype.addCommonBits=function(t){var e=new Er(this._commonCoord);t.apply(e),t.geometryChanged()};vr.prototype.removeCommonBits=function(t){if(this._commonCoord.x===0&&this._commonCoord.y===0)return t;var e=new d(this._commonCoord);e.x=-e.x,e.y=-e.y;var n=new Er(e);return t.apply(n),t.geometryChanged(),t};vr.prototype.getCommonCoordinate=function(){return this._commonCoord};vr.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()};vr.prototype.interfaces_=function(){return[]};vr.prototype.getClass=function(){return vr};oa.CommonCoordinateFilter.get=function(){return oi};oa.Translater.get=function(){return Er};Object.defineProperties(vr,oa);var oi=function(){this._commonBitsX=new ne,this._commonBitsY=new ne};oi.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)};oi.prototype.getCommonCoordinate=function(){return new d(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())};oi.prototype.interfaces_=function(){return[Rn]};oi.prototype.getClass=function(){return oi};var Er=function(){this.trans=null;var t=arguments[0];this.trans=t};Er.prototype.filter=function(t,e){var n=t.getOrdinate(e,0)+this.trans.x,r=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,n),t.setOrdinate(e,1,r)};Er.prototype.isDone=function(){return!1};Er.prototype.isGeometryChanged=function(){return!0};Er.prototype.interfaces_=function(){return[Ye]};Er.prototype.getClass=function(){return Er};var Bt=function(t,e){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()};Bt.prototype.selfSnap=function(t){var e=new It(t),n=e.snapTo(t,this._snapTolerance);return n};Bt.prototype.removeCommonBits=function(t){this._cbr=new vr,this._cbr.add(t[0]),this._cbr.add(t[1]);var e=new Array(2).fill(null);return e[0]=this._cbr.removeCommonBits(t[0].copy()),e[1]=this._cbr.removeCommonBits(t[1].copy()),e};Bt.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t};Bt.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),n=V.overlayOp(e[0],e[1],t);return this.prepareResult(n)};Bt.prototype.checkValid=function(t){t.isValid()||$t.out.println("Snapped geometry is invalid")};Bt.prototype.computeSnapTolerance=function(){this._snapTolerance=It.computeOverlaySnapTolerance(this._geom[0],this._geom[1])};Bt.prototype.snap=function(t){var e=this.removeCommonBits(t),n=It.snap(e[0],e[1],this._snapTolerance);return n};Bt.prototype.interfaces_=function(){return[]};Bt.prototype.getClass=function(){return Bt};Bt.overlayOp=function(t,e,n){var r=new Bt(t,e);return r.getResultGeometry(n)};Bt.union=function(t,e){return Bt.overlayOp(t,e,V.UNION)};Bt.intersection=function(t,e){return Bt.overlayOp(t,e,V.INTERSECTION)};Bt.symDifference=function(t,e){return Bt.overlayOp(t,e,V.SYMDIFFERENCE)};Bt.difference=function(t,e){return Bt.overlayOp(t,e,V.DIFFERENCE)};var ce=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};ce.prototype.getResultGeometry=function(t){var e=null,n=!1,r=null;try{e=V.overlayOp(this._geom[0],this._geom[1],t);var i=!0;i&&(n=!0)}catch(o){if(o instanceof Kn)r=o;else throw o}finally{}if(!n)try{e=Bt.overlayOp(this._geom[0],this._geom[1],t)}catch(o){throw o instanceof Kn?r:o}finally{}return e};ce.prototype.interfaces_=function(){return[]};ce.prototype.getClass=function(){return ce};ce.overlayOp=function(t,e,n){var r=new ce(t,e);return r.getResultGeometry(n)};ce.union=function(t,e){return ce.overlayOp(t,e,V.UNION)};ce.intersection=function(t,e){return ce.overlayOp(t,e,V.INTERSECTION)};ce.symDifference=function(t,e){return ce.overlayOp(t,e,V.SYMDIFFERENCE)};ce.difference=function(t,e){return ce.overlayOp(t,e,V.DIFFERENCE)};var fo=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};fo.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)};fo.prototype.interfaces_=function(){return[]};fo.prototype.getClass=function(){return fo};var xe=function t(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,arguments.length===2){var e=arguments[0],n=arguments[1];this._eventType=t.DELETE,this._xValue=e,this._insertEvent=n}else if(arguments.length===3){var r=arguments[0],i=arguments[1],o=arguments[2];this._eventType=t.INSERT,this._label=r,this._xValue=i,this._obj=o}},sa={INSERT:{configurable:!0},DELETE:{configurable:!0}};xe.prototype.isDelete=function(){return this._eventType===xe.DELETE};xe.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t};xe.prototype.getObject=function(){return this._obj};xe.prototype.compareTo=function(t){var e=t;return this._xValue<e._xValue?-1:this._xValue>e._xValue?1:this._eventType<e._eventType?-1:this._eventType>e._eventType?1:0};xe.prototype.getInsertEvent=function(){return this._insertEvent};xe.prototype.isInsert=function(){return this._eventType===xe.INSERT};xe.prototype.isSameLabel=function(t){return this._label===null?!1:this._label===t._label};xe.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex};xe.prototype.interfaces_=function(){return[Be]};xe.prototype.getClass=function(){return xe};sa.INSERT.get=function(){return 1};sa.DELETE.get=function(){return 2};Object.defineProperties(xe,sa);var Yo=function(){};Yo.prototype.interfaces_=function(){return[]};Yo.prototype.getClass=function(){return Yo};var Yt=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=n};Yt.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&this._li.getIntersectionNum()===1){if(Yt.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var i=t.getNumPoints()-1;if(e===0&&r===i||r===0&&e===i)return!0}}return!1};Yt.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint};Yt.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t};Yt.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior};Yt.prototype.isBoundaryPointInternal=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next(),i=r.getCoordinate();if(t.isIntersection(i))return!0}return!1};Yt.prototype.hasProperIntersection=function(){return this._hasProper};Yt.prototype.hasIntersection=function(){return this._hasIntersection};Yt.prototype.isDone=function(){return this._isDone};Yt.prototype.isBoundaryPoint=function(t,e){return e===null?!1:!!(this.isBoundaryPointInternal(t,e[0])||this.isBoundaryPointInternal(t,e[1]))};Yt.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e};Yt.prototype.addIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,n,r)||(this._hasIntersection=!0,(this._includeProper||!this._li.isProper())&&(t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))};Yt.prototype.interfaces_=function(){return[]};Yt.prototype.getClass=function(){return Yt};Yt.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var Ap=function(t){function e(){t.call(this),this.events=new O,this.nOverlaps=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){var n=this;He.sort(this.events);for(var r=0;r<this.events.size();r++){var i=n.events.get(r);i.isDelete()&&i.getInsertEvent().setDeleteEventIndex(r)}},e.prototype.computeIntersections=function(){var n=this;if(arguments.length===1){var r=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var i=0;i<this.events.size();i++){var o=n.events.get(i);if(o.isInsert()&&n.processOverlaps(i,o.getDeleteEventIndex(),o,r),r.isDone())break}}else if(arguments.length===3){if(arguments[2]instanceof Yt&&z(arguments[0],Xe)&&z(arguments[1],Xe)){var s=arguments[0],a=arguments[1],u=arguments[2];this.addEdges(s,s),this.addEdges(a,a),this.computeIntersections(u)}else if(typeof arguments[2]=="boolean"&&z(arguments[0],Xe)&&arguments[1]instanceof Yt){var l=arguments[0],c=arguments[1],p=arguments[2];p?this.addEdges(l,null):this.addEdges(l),this.computeIntersections(c)}}},e.prototype.addEdge=function(n,r){for(var i=this,o=n.getMonotoneChainEdge(),s=o.getStartIndexes(),a=0;a<s.length-1;a++){var u=new fo(o,a),l=new xe(r,o.getMinX(a),u);i.events.add(l),i.events.add(new xe(o.getMaxX(a),l))}},e.prototype.processOverlaps=function(n,r,i,o){for(var s=this,a=i.getObject(),u=n;u<r;u++){var l=s.events.get(u);if(l.isInsert()){var c=l.getObject();i.isSameLabel(l)||(a.computeIntersections(c,o),s.nOverlaps++)}}},e.prototype.addEdges=function(){var n=this;if(arguments.length===1)for(var r=arguments[0],i=r.iterator();i.hasNext();){var o=i.next();n.addEdge(o,o)}else if(arguments.length===2)for(var s=arguments[0],a=arguments[1],u=s.iterator();u.hasNext();){var l=u.next();n.addEdge(l,a)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Yo),Gn=function(){this._min=U.POSITIVE_INFINITY,this._max=U.NEGATIVE_INFINITY},Ku={NodeComparator:{configurable:!0}};Gn.prototype.getMin=function(){return this._min};Gn.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)};Gn.prototype.getMax=function(){return this._max};Gn.prototype.toString=function(){return je.toLineString(new d(this._min,0),new d(this._max,0))};Gn.prototype.interfaces_=function(){return[]};Gn.prototype.getClass=function(){return Gn};Ku.NodeComparator.get=function(){return go};Object.defineProperties(Gn,Ku);var go=function(){};go.prototype.compare=function(t,e){var n=t,r=e,i=(n._min+n._max)/2,o=(r._min+r._max)/2;return i<o?-1:i>o?1:0};go.prototype.interfaces_=function(){return[Ei]};go.prototype.getClass=function(){return go};var Fp=function(t){function e(){t.call(this),this._item=null;var n=arguments[0],r=arguments[1],i=arguments[2];this._min=n,this._max=r,this._item=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.query=function(n,r,i){if(!this.intersects(n,r))return null;i.visitItem(this._item)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Gn),Gp=function(t){function e(){t.call(this),this._node1=null,this._node2=null;var n=arguments[0],r=arguments[1];this._node1=n,this._node2=r,this.buildExtent(this._node1,this._node2)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildExtent=function(n,r){this._min=Math.min(n._min,r._min),this._max=Math.max(n._max,r._max)},e.prototype.query=function(n,r,i){if(!this.intersects(n,r))return null;this._node1!==null&&this._node1.query(n,r,i),this._node2!==null&&this._node2.query(n,r,i)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Gn),kn=function(){this._leaves=new O,this._root=null,this._level=0};kn.prototype.buildTree=function(){var t=this;He.sort(this._leaves,new Gn.NodeComparator);for(var e=this._leaves,n=null,r=new O;;){if(t.buildLevel(e,r),r.size()===1)return r.get(0);n=e,e=r,r=n}};kn.prototype.insert=function(t,e,n){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new Fp(t,e,n))};kn.prototype.query=function(t,e,n){this.init(),this._root.query(t,e,n)};kn.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()};kn.prototype.printNode=function(t){$t.out.println(je.toLineString(new d(t._min,this._level),new d(t._max,this._level)))};kn.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()};kn.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var n=0;n<t.size();n+=2){var r=t.get(n),i=n+1<t.size()?t.get(n):null;if(i===null)e.add(r);else{var o=new Gp(t.get(n),t.get(n+1));e.add(o)}}};kn.prototype.interfaces_=function(){return[]};kn.prototype.getClass=function(){return kn};var Mi=function(){this._items=new O};Mi.prototype.visitItem=function(t){this._items.add(t)};Mi.prototype.getItems=function(){return this._items};Mi.prototype.interfaces_=function(){return[fr]};Mi.prototype.getClass=function(){return Mi};var Di=function(){this._index=null;var t=arguments[0];if(!z(t,hr))throw new ft("Argument must be Polygonal");this._index=new Br(t)},aa={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};Di.prototype.locate=function(t){var e=new ln(t),n=new Ai(e);return this._index.query(t.y,t.y,n),e.getLocation()};Di.prototype.interfaces_=function(){return[Oi]};Di.prototype.getClass=function(){return Di};aa.SegmentVisitor.get=function(){return Ai};aa.IntervalIndexedGeometry.get=function(){return Br};Object.defineProperties(Di,aa);var Ai=function(){this._counter=null;var t=arguments[0];this._counter=t};Ai.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))};Ai.prototype.interfaces_=function(){return[fr]};Ai.prototype.getClass=function(){return Ai};var Br=function(){this._index=new kn;var t=arguments[0];this.init(t)};Br.prototype.init=function(t){for(var e=this,n=zt.getLines(t),r=n.iterator();r.hasNext();){var i=r.next(),o=i.getCoordinates();e.addLine(o)}};Br.prototype.addLine=function(t){for(var e=this,n=1;n<t.length;n++){var r=new G(t[n-1],t[n]),i=Math.min(r.p0.y,r.p1.y),o=Math.max(r.p0.y,r.p1.y);e._index.insert(i,o,r)}};Br.prototype.query=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new Mi;return this._index.query(t,e,n),n.getItems()}else if(arguments.length===3){var r=arguments[0],i=arguments[1],o=arguments[2];this._index.query(r,i,o)}};Br.prototype.interfaces_=function(){return[]};Br.prototype.getClass=function(){return Br};var Wi=function(t){function e(){if(t.call(this),this._parentGeom=null,this._lineEdgeMap=new Du,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new Ke,arguments.length===2){var n=arguments[0],r=arguments[1],i=Ge.OGC_SFS_BOUNDARY_RULE;this._argIndex=n,this._parentGeom=r,this._boundaryNodeRule=i,r!==null&&this.add(r)}else if(arguments.length===3){var o=arguments[0],s=arguments[1],a=arguments[2];this._argIndex=o,this._parentGeom=s,this._boundaryNodeRule=a,s!==null&&this.add(s)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.insertBoundaryPoint=function(n,r){var i=this._nodes.addNode(r),o=i.getLabel(),s=1,a=_.NONE;a=o.getLocation(n,R.ON),a===_.BOUNDARY&&s++;var u=e.determineBoundary(this._boundaryNodeRule,s);o.setLocation(n,u)},e.prototype.computeSelfNodes=function(){if(arguments.length===2){var n=arguments[0],r=arguments[1];return this.computeSelfNodes(n,r,!1)}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2],a=new Yt(i,!0,!1);a.setIsDoneIfProperInt(s);var u=this.createEdgeSetIntersector(),l=this._parentGeom instanceof On||this._parentGeom instanceof Ft||this._parentGeom instanceof wn,c=o||!l;return u.computeIntersections(this._edges,a,c),this.addSelfIntersectionNodes(this._argIndex),a}},e.prototype.computeSplitEdges=function(n){for(var r=this._edges.iterator();r.hasNext();){var i=r.next();i.eiList.addSplitEdges(n)}},e.prototype.computeEdgeIntersections=function(n,r,i){var o=new Yt(r,i,!0);o.setBoundaryNodes(this.getBoundaryNodes(),n.getBoundaryNodes());var s=this.createEdgeSetIntersector();return s.computeIntersections(this._edges,n._edges,o),o},e.prototype.getGeometry=function(){return this._parentGeom},e.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},e.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},e.prototype.addPoint=function(){if(arguments[0]instanceof _e){var n=arguments[0],r=n.getCoordinate();this.insertPoint(this._argIndex,r,_.INTERIOR)}else if(arguments[0]instanceof d){var i=arguments[0];this.insertPoint(this._argIndex,i,_.INTERIOR)}},e.prototype.addPolygon=function(n){var r=this;this.addPolygonRing(n.getExteriorRing(),_.EXTERIOR,_.INTERIOR);for(var i=0;i<n.getNumInteriorRing();i++){var o=n.getInteriorRingN(i);r.addPolygonRing(o,_.INTERIOR,_.EXTERIOR)}},e.prototype.addEdge=function(n){this.insertEdge(n);var r=n.getCoordinates();this.insertPoint(this._argIndex,r[0],_.BOUNDARY),this.insertPoint(this._argIndex,r[r.length-1],_.BOUNDARY)},e.prototype.addLineString=function(n){var r=Y.removeRepeatedPoints(n.getCoordinates());if(r.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=r[0],null;var i=new jo(r,new rt(this._argIndex,_.INTERIOR));this._lineEdgeMap.put(n,i),this.insertEdge(i),$.isTrue(r.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,r[0]),this.insertBoundaryPoint(this._argIndex,r[r.length-1])},e.prototype.getInvalidPoint=function(){return this._invalidPoint},e.prototype.getBoundaryPoints=function(){for(var n=this.getBoundaryNodes(),r=new Array(n.size()).fill(null),i=0,o=n.iterator();o.hasNext();){var s=o.next();r[i++]=s.getCoordinate().copy()}return r},e.prototype.getBoundaryNodes=function(){return this._boundaryNodes===null&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},e.prototype.addSelfIntersectionNode=function(n,r,i){if(this.isBoundaryNode(n,r))return null;i===_.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(n,r):this.insertPoint(n,r,i)},e.prototype.addPolygonRing=function(n,r,i){if(n.isEmpty())return null;var o=Y.removeRepeatedPoints(n.getCoordinates());if(o.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=o[0],null;var s=r,a=i;M.isCCW(o)&&(s=i,a=r);var u=new jo(o,new rt(this._argIndex,_.BOUNDARY,s,a));this._lineEdgeMap.put(n,u),this.insertEdge(u),this.insertPoint(this._argIndex,o[0],_.BOUNDARY)},e.prototype.insertPoint=function(n,r,i){var o=this._nodes.addNode(r),s=o.getLabel();s===null?o._label=new rt(n,i):s.setLocation(n,i)},e.prototype.createEdgeSetIntersector=function(){return new Ap},e.prototype.addSelfIntersectionNodes=function(n){for(var r=this,i=this._edges.iterator();i.hasNext();)for(var o=i.next(),s=o.getLabel().getLocation(n),a=o.eiList.iterator();a.hasNext();){var u=a.next();r.addSelfIntersectionNode(n,u.coord,s)}},e.prototype.add=function(){if(arguments.length===1){var n=arguments[0];if(n.isEmpty())return null;if(n instanceof wn&&(this._useBoundaryDeterminationRule=!1),n instanceof Ft)this.addPolygon(n);else if(n instanceof _t)this.addLineString(n);else if(n instanceof _e)this.addPoint(n);else if(n instanceof Si)this.addCollection(n);else if(n instanceof Mr)this.addCollection(n);else if(n instanceof wn)this.addCollection(n);else if(n instanceof ae)this.addCollection(n);else throw new Error(n.getClass().getName())}else return t.prototype.add.apply(this,arguments)},e.prototype.addCollection=function(n){for(var r=this,i=0;i<n.getNumGeometries();i++){var o=n.getGeometryN(i);r.add(o)}},e.prototype.locate=function(n){return z(this._parentGeom,hr)&&this._parentGeom.getNumGeometries()>50?(this._areaPtLocator===null&&(this._areaPtLocator=new Di(this._parentGeom)),this._areaPtLocator.locate(n)):this._ptLocator.locate(n,this._parentGeom)},e.prototype.findEdge=function(){if(arguments.length===1){var n=arguments[0];return this._lineEdgeMap.get(n)}else return t.prototype.findEdge.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.determineBoundary=function(n,r){return n.isInBoundary(r)?_.BOUNDARY:_.INTERIOR},e}(dt),Fi=function(){if(this._li=new Xr,this._resultPrecisionModel=null,this._arg=null,arguments.length===1){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new Wi(0,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1],r=Ge.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(n.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(n.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Wi(0,e,r),this._arg[1]=new Wi(1,n,r)}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2];i.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(i.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Wi(0,i,s),this._arg[1]=new Wi(1,o,s)}};Fi.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()};Fi.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)};Fi.prototype.interfaces_=function(){return[]};Fi.prototype.getClass=function(){return Fi};var Tr=function(){};Tr.prototype.interfaces_=function(){return[]};Tr.prototype.getClass=function(){return Tr};Tr.map=function(){if(arguments[0]instanceof B&&z(arguments[1],Tr.MapOp)){for(var t=arguments[0],e=arguments[1],n=new O,r=0;r<t.getNumGeometries();r++){var i=e.map(t.getGeometryN(r));i!==null&&n.add(i)}return t.getFactory().buildGeometry(n)}else if(z(arguments[0],Pt)&&z(arguments[1],Tr.MapOp)){for(var o=arguments[0],s=arguments[1],a=new O,u=o.iterator();u.hasNext();){var l=u.next(),c=s.map(l);c!==null&&a.add(c)}return a}};Tr.MapOp=function(){};var V=function(t){function e(){var n=arguments[0],r=arguments[1];t.call(this,n,r),this._ptLocator=new Ke,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new Ze,this._resultPolyList=new O,this._resultLineList=new O,this._resultPointList=new O,this._graph=new dt(new Uu),this._geomFact=n.getFactory()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.insertUniqueEdge=function(n){var r=this._edgeList.findEqualEdge(n);if(r!==null){var i=r.getLabel(),o=n.getLabel();r.isPointwiseEqual(n)||(o=new rt(n.getLabel()),o.flip());var s=r.getDepth();s.isNull()&&s.add(i),s.add(o),i.merge(o)}else this._edgeList.add(n)},e.prototype.getGraph=function(){return this._graph},e.prototype.cancelDuplicateResultEdges=function(){for(var n=this._graph.getEdgeEnds().iterator();n.hasNext();){var r=n.next(),i=r.getSym();r.isInResult()&&i.isInResult()&&(r.setInResult(!1),i.setInResult(!1))}},e.prototype.isCoveredByLA=function(n){return!!(this.isCovered(n,this._resultLineList)||this.isCovered(n,this._resultPolyList))},e.prototype.computeGeometry=function(n,r,i,o){var s=new O;return s.addAll(n),s.addAll(r),s.addAll(i),s.isEmpty()?e.createEmptyResult(o,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(s)},e.prototype.mergeSymLabels=function(){for(var n=this._graph.getNodes().iterator();n.hasNext();){var r=n.next();r.getEdges().mergeSymLabels()}},e.prototype.isCovered=function(n,r){for(var i=this,o=r.iterator();o.hasNext();){var s=o.next(),a=i._ptLocator.locate(n,s);if(a!==_.EXTERIOR)return!0}return!1},e.prototype.replaceCollapsedEdges=function(){for(var n=new O,r=this._edgeList.iterator();r.hasNext();){var i=r.next();i.isCollapsed()&&(r.remove(),n.add(i.getCollapsedEdge()))}this._edgeList.addAll(n)},e.prototype.updateNodeLabelling=function(){for(var n=this._graph.getNodes().iterator();n.hasNext();){var r=n.next(),i=r.getEdges().getLabel();r.getLabel().merge(i)}},e.prototype.getResultGeometry=function(n){return this.computeOverlay(n),this._resultGeom},e.prototype.insertUniqueEdges=function(n){for(var r=this,i=n.iterator();i.hasNext();){var o=i.next();r.insertUniqueEdge(o)}},e.prototype.computeOverlay=function(n){this.copyPoints(0),this.copyPoints(1),this._arg[0].computeSelfNodes(this._li,!1),this._arg[1].computeSelfNodes(this._li,!1),this._arg[0].computeEdgeIntersections(this._arg[1],this._li,!0);var r=new O;this._arg[0].computeSplitEdges(r),this._arg[1].computeSplitEdges(r),this.insertUniqueEdges(r),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),qr.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(n),this.cancelDuplicateResultEdges();var i=new ve(this._geomFact);i.add(this._graph),this._resultPolyList=i.getPolygons();var o=new En(this,this._geomFact,this._ptLocator);this._resultLineList=o.build(n);var s=new ii(this,this._geomFact,this._ptLocator);this._resultPointList=s.build(n),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,n)},e.prototype.labelIncompleteNode=function(n,r){var i=this._ptLocator.locate(n.getCoordinate(),this._arg[r].getGeometry());n.getLabel().setLocation(r,i)},e.prototype.copyPoints=function(n){for(var r=this,i=this._arg[n].getNodeIterator();i.hasNext();){var o=i.next(),s=r._graph.addNode(o.getCoordinate());s.setLabel(n,o.getLabel().getLocation(n))}},e.prototype.findResultAreaEdges=function(n){for(var r=this._graph.getEdgeEnds().iterator();r.hasNext();){var i=r.next(),o=i.getLabel();o.isArea()&&!i.isInteriorAreaEdge()&&e.isResultOfOp(o.getLocation(0,R.RIGHT),o.getLocation(1,R.RIGHT),n)&&i.setInResult(!0)}},e.prototype.computeLabelsFromDepths=function(){for(var n=this._edgeList.iterator();n.hasNext();){var r=n.next(),i=r.getLabel(),o=r.getDepth();if(!o.isNull()){o.normalize();for(var s=0;s<2;s++)!i.isNull(s)&&i.isArea()&&!o.isNull(s)&&(o.getDelta(s)===0?i.toLine(s):($.isTrue(!o.isNull(s,R.LEFT),"depth of LEFT side has not been initialized"),i.setLocation(s,R.LEFT,o.getLocation(s,R.LEFT)),$.isTrue(!o.isNull(s,R.RIGHT),"depth of RIGHT side has not been initialized"),i.setLocation(s,R.RIGHT,o.getLocation(s,R.RIGHT))))}}},e.prototype.computeLabelling=function(){for(var n=this,r=this._graph.getNodes().iterator();r.hasNext();){var i=r.next();i.getEdges().computeLabelling(n._arg)}this.mergeSymLabels(),this.updateNodeLabelling()},e.prototype.labelIncompleteNodes=function(){for(var n=this,r=this._graph.getNodes().iterator();r.hasNext();){var i=r.next(),o=i.getLabel();i.isIsolated()&&(o.isNull(0)?n.labelIncompleteNode(i,0):n.labelIncompleteNode(i,1)),i.getEdges().updateLabelling(o)}},e.prototype.isCoveredByA=function(n){return!!this.isCovered(n,this._resultPolyList)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Fi);V.overlayOp=function(t,e,n){var r=new V(t,e),i=r.getResultGeometry(n);return i};V.intersection=function(t,e){if(t.isEmpty()||e.isEmpty())return V.createEmptyResult(V.INTERSECTION,t,e,t.getFactory());if(t.isGeometryCollection()){var n=e;return ri.map(t,{interfaces_:function(){return[Tr.MapOp]},map:function(r){return r.intersection(n)}})}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),ce.overlayOp(t,e,V.INTERSECTION)};V.symDifference=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return V.createEmptyResult(V.SYMDIFFERENCE,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),ce.overlayOp(t,e,V.SYMDIFFERENCE)};V.resultDimension=function(t,e,n){var r=e.getDimension(),i=n.getDimension(),o=-1;switch(t){case V.INTERSECTION:o=Math.min(r,i);break;case V.UNION:o=Math.max(r,i);break;case V.DIFFERENCE:o=r;break;case V.SYMDIFFERENCE:o=Math.max(r,i);break}return o};V.createEmptyResult=function(t,e,n,r){var i=null;switch(V.resultDimension(t,e,n)){case-1:i=r.createGeometryCollection(new Array(0).fill(null));break;case 0:i=r.createPoint();break;case 1:i=r.createLineString();break;case 2:i=r.createPolygon();break}return i};V.difference=function(t,e){return t.isEmpty()?V.createEmptyResult(V.DIFFERENCE,t,e,t.getFactory()):e.isEmpty()?t.copy():(t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),ce.overlayOp(t,e,V.DIFFERENCE))};V.isResultOfOp=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=t.getLocation(0),r=t.getLocation(1);return V.isResultOfOp(n,r,e)}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2];switch(i===_.BOUNDARY&&(i=_.INTERIOR),o===_.BOUNDARY&&(o=_.INTERIOR),s){case V.INTERSECTION:return i===_.INTERIOR&&o===_.INTERIOR;case V.UNION:return i===_.INTERIOR||o===_.INTERIOR;case V.DIFFERENCE:return i===_.INTERIOR&&o!==_.INTERIOR;case V.SYMDIFFERENCE:return i===_.INTERIOR&&o!==_.INTERIOR||i!==_.INTERIOR&&o===_.INTERIOR}return!1}};V.INTERSECTION=1;V.UNION=2;V.DIFFERENCE=3;V.SYMDIFFERENCE=4;var lr=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new Ke,this._seg=new G;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};lr.prototype.isWithinToleranceOfBoundary=function(t){for(var e=this,n=0;n<this._linework.getNumGeometries();n++)for(var r=e._linework.getGeometryN(n),i=r.getCoordinateSequence(),o=0;o<i.size()-1;o++){i.getCoordinate(o,e._seg.p0),i.getCoordinate(o+1,e._seg.p1);var s=e._seg.distance(t);if(s<=e._boundaryDistanceTolerance)return!0}return!1};lr.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?_.BOUNDARY:this._ptLocator.locate(t,this._g)};lr.prototype.extractLinework=function(t){var e=new Gi;t.apply(e);var n=e.getLinework(),r=j.toLineStringArray(n);return t.getFactory().createMultiLineString(r)};lr.prototype.interfaces_=function(){return[]};lr.prototype.getClass=function(){return lr};var Gi=function(){this._linework=null,this._linework=new O};Gi.prototype.getLinework=function(){return this._linework};Gi.prototype.filter=function(t){var e=this;if(t instanceof Ft){var n=t;this._linework.add(n.getExteriorRing());for(var r=0;r<n.getNumInteriorRing();r++)e._linework.add(n.getInteriorRingN(r))}};Gi.prototype.interfaces_=function(){return[fn]};Gi.prototype.getClass=function(){return Gi};var zr=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};zr.prototype.extractPoints=function(t,e,n){for(var r=this,i=t.getCoordinates(),o=0;o<i.length-1;o++)r.computeOffsetPoints(i[o],i[o+1],e,n)};zr.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e};zr.prototype.getPoints=function(t){for(var e=this,n=new O,r=zt.getLines(this._g),i=r.iterator();i.hasNext();){var o=i.next();e.extractPoints(o,t,n)}return n};zr.prototype.computeOffsetPoints=function(t,e,n,r){var i=e.x-t.x,o=e.y-t.y,s=Math.sqrt(i*i+o*o),a=n*i/s,u=n*o/s,l=(e.x+t.x)/2,c=(e.y+t.y)/2;if(this._doLeft){var p=new d(l-u,c+a);r.add(p)}if(this._doRight){var h=new d(l+u,c-a);r.add(h)}};zr.prototype.interfaces_=function(){return[]};zr.prototype.getClass=function(){return zr};var Pe=function t(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=t.TOLERANCE,this._testCoords=new O;var e=arguments[0],n=arguments[1],r=arguments[2];this._boundaryDistanceTolerance=t.computeBoundaryDistanceTolerance(e,n),this._geom=[e,n,r],this._locFinder=[new lr(this._geom[0],this._boundaryDistanceTolerance),new lr(this._geom[1],this._boundaryDistanceTolerance),new lr(this._geom[2],this._boundaryDistanceTolerance)]},Ju={TOLERANCE:{configurable:!0}};Pe.prototype.reportResult=function(t,e,n){$t.out.println("Overlay result invalid - A:"+_.toLocationSymbol(e[0])+" B:"+_.toLocationSymbol(e[1])+" expected:"+(n?"i":"e")+" actual:"+_.toLocationSymbol(e[2]))};Pe.prototype.isValid=function(t){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var e=this.checkValid(t);return e};Pe.prototype.checkValid=function(){var t=this;if(arguments.length===1){for(var e=arguments[0],n=0;n<this._testCoords.size();n++){var r=t._testCoords.get(n);if(!t.checkValid(e,r))return t._invalidLocation=r,!1}return!0}else if(arguments.length===2){var i=arguments[0],o=arguments[1];return this._location[0]=this._locFinder[0].getLocation(o),this._location[1]=this._locFinder[1].getLocation(o),this._location[2]=this._locFinder[2].getLocation(o),Pe.hasLocation(this._location,_.BOUNDARY)?!0:this.isValidResult(i,this._location)}};Pe.prototype.addTestPts=function(t){var e=new zr(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))};Pe.prototype.isValidResult=function(t,e){var n=V.isResultOfOp(e[0],e[1],t),r=e[2]===_.INTERIOR,i=!(n^r);return i||this.reportResult(t,e,n),i};Pe.prototype.getInvalidLocation=function(){return this._invalidLocation};Pe.prototype.interfaces_=function(){return[]};Pe.prototype.getClass=function(){return Pe};Pe.hasLocation=function(t,e){for(var n=0;n<3;n++)if(t[n]===e)return!0;return!1};Pe.computeBoundaryDistanceTolerance=function(t,e){return Math.min(It.computeSizeBasedSnapTolerance(t),It.computeSizeBasedSnapTolerance(e))};Pe.isValid=function(t,e,n,r){var i=new Pe(t,e,r);return i.isValid(n)};Ju.TOLERANCE.get=function(){return 1e-6};Object.defineProperties(Pe,Ju);var Ce=function t(e){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=t.extractFactory(e),this._inputGeoms=e};Ce.prototype.extractElements=function(t,e){var n=this;if(t===null)return null;for(var r=0;r<t.getNumGeometries();r++){var i=t.getGeometryN(r);n._skipEmpty&&i.isEmpty()||e.add(i)}};Ce.prototype.combine=function(){for(var t=this,e=new O,n=this._inputGeoms.iterator();n.hasNext();){var r=n.next();t.extractElements(r,e)}return e.size()===0?this._geomFactory!==null?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(e)};Ce.prototype.interfaces_=function(){return[]};Ce.prototype.getClass=function(){return Ce};Ce.combine=function(){if(arguments.length===1){var t=arguments[0],e=new Ce(t);return e.combine()}else if(arguments.length===2){var n=arguments[0],r=arguments[1],i=new Ce(Ce.createList(n,r));return i.combine()}else if(arguments.length===3){var o=arguments[0],s=arguments[1],a=arguments[2],u=new Ce(Ce.createList(o,s,a));return u.combine()}};Ce.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()};Ce.createList=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new O;return n.add(t),n.add(e),n}else if(arguments.length===3){var r=arguments[0],i=arguments[1],o=arguments[2],s=new O;return s.add(r),s.add(i),s.add(o),s}};var Tt=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,this._inputPolys===null&&(this._inputPolys=new O)},Qu={STRTREE_NODE_CAPACITY:{configurable:!0}};Tt.prototype.reduceToGeometries=function(t){for(var e=this,n=new O,r=t.iterator();r.hasNext();){var i=r.next(),o=null;z(i,Xe)?o=e.unionTree(i):i instanceof B&&(o=i),n.add(o)}return n};Tt.prototype.extractByEnvelope=function(t,e,n){for(var r=new O,i=0;i<e.getNumGeometries();i++){var o=e.getGeometryN(i);o.getEnvelopeInternal().intersects(t)?r.add(o):n.add(o)}return this._geomFactory.buildGeometry(r)};Tt.prototype.unionOptimized=function(t,e){var n=t.getEnvelopeInternal(),r=e.getEnvelopeInternal();if(!n.intersects(r)){var i=Ce.combine(t,e);return i}if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var o=n.intersection(r);return this.unionUsingEnvelopeIntersection(t,e,o)};Tt.prototype.union=function(){if(this._inputPolys===null)throw new Error("union() method cannot be called twice");if(this._inputPolys.isEmpty())return null;this._geomFactory=this._inputPolys.iterator().next().getFactory();for(var t=new ku(Tt.STRTREE_NODE_CAPACITY),e=this._inputPolys.iterator();e.hasNext();){var n=e.next();t.insert(n.getEnvelopeInternal(),n)}this._inputPolys=null;var r=t.itemsTree(),i=this.unionTree(r);return i};Tt.prototype.binaryUnion=function(){if(arguments.length===1){var t=arguments[0];return this.binaryUnion(t,0,t.size())}else if(arguments.length===3){var e=arguments[0],n=arguments[1],r=arguments[2];if(r-n<=1){var i=Tt.getGeometry(e,n);return this.unionSafe(i,null)}else{if(r-n===2)return this.unionSafe(Tt.getGeometry(e,n),Tt.getGeometry(e,n+1));var o=Math.trunc((r+n)/2),s=this.binaryUnion(e,n,o),a=this.binaryUnion(e,o,r);return this.unionSafe(s,a)}}};Tt.prototype.repeatedUnion=function(t){for(var e=null,n=t.iterator();n.hasNext();){var r=n.next();e===null?e=r.copy():e=e.union(r)}return e};Tt.prototype.unionSafe=function(t,e){return t===null&&e===null?null:t===null?e.copy():e===null?t.copy():this.unionOptimized(t,e)};Tt.prototype.unionActual=function(t,e){return Tt.restrictToPolygons(t.union(e))};Tt.prototype.unionTree=function(t){var e=this.reduceToGeometries(t),n=this.binaryUnion(e);return n};Tt.prototype.unionUsingEnvelopeIntersection=function(t,e,n){var r=new O,i=this.extractByEnvelope(n,t,r),o=this.extractByEnvelope(n,e,r),s=this.unionActual(i,o);r.add(s);var a=Ce.combine(r);return a};Tt.prototype.bufferUnion=function(){if(arguments.length===1){var t=arguments[0],e=t.get(0).getFactory(),n=e.buildGeometry(t),r=n.buffer(0);return r}else if(arguments.length===2){var i=arguments[0],o=arguments[1],s=i.getFactory(),a=s.createGeometryCollection([i,o]),u=a.buffer(0);return u}};Tt.prototype.interfaces_=function(){return[]};Tt.prototype.getClass=function(){return Tt};Tt.restrictToPolygons=function(t){if(z(t,hr))return t;var e=Zn.getPolygons(t);return e.size()===1?e.get(0):t.getFactory().createMultiPolygon(j.toPolygonArray(e))};Tt.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)};Tt.union=function(t){var e=new Tt(t);return e.union()};Qu.STRTREE_NODE_CAPACITY.get=function(){return 4};Object.defineProperties(Tt,Qu);var Wo=function(){};Wo.prototype.interfaces_=function(){return[]};Wo.prototype.getClass=function(){return Wo};Wo.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return V.createEmptyResult(V.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),ce.overlayOp(t,e,V.UNION)};function jr(){return new Ho}function Ho(){this.reset()}Ho.prototype={constructor:Ho,reset:function(){this.s=this.t=0},add:function(t){Ya(Oo,t,this.t),Ya(this,Oo.s,this.s),this.s?this.t+=Oo.t:this.s=Oo.t},valueOf:function(){return this.s}};var Oo=new Ho;function Ya(t,e,n){var r=t.s=e+n,i=r-e,o=r-i;t.t=e-o+(n-i)}var yt=1e-6,st=Math.PI,Hn=st/2,Wa=st/4,nr=st*2,Cr=180/st,on=st/180,oe=Math.abs,kp=Math.atan,ki=Math.atan2,Mt=Math.cos,Dt=Math.sin,Xi=Math.sqrt;function tl(t){return t>1?0:t<-1?st:Math.acos(t)}function si(t){return t>1?Hn:t<-1?-Hn:Math.asin(t)}function Hi(){}function Zo(t,e){t&&Za.hasOwnProperty(t.type)&&Za[t.type](t,e)}var Ha={Feature:function(t,e){Zo(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)Zo(n[r].geometry,e)}},Za={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){qs(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)qs(n[r],e,0)},Polygon:function(t,e){Ka(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)Ka(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)Zo(n[r],e)}};function qs(t,e,n){var r=-1,i=t.length-n,o;for(e.lineStart();++r<i;)o=t[r],e.point(o[0],o[1],o[2]);e.lineEnd()}function Ka(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)qs(t[n],e,1);e.polygonEnd()}function qp(t,e){t&&Ha.hasOwnProperty(t.type)?Ha[t.type](t,e):Zo(t,e)}jr();jr();function Bs(t){return[ki(t[1],t[0]),si(t[2])]}function qi(t){var e=t[0],n=t[1],r=Mt(n);return[r*Mt(e),r*Dt(e),Dt(n)]}function Po(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Ko(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function Cs(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Mo(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function zs(t){var e=Xi(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}jr();function el(t,e){function n(r,i){return r=t(r,i),e(r[0],r[1])}return t.invert&&e.invert&&(n.invert=function(r,i){return r=e.invert(r,i),r&&t.invert(r[0],r[1])}),n}function Us(t,e){return[t>st?t-nr:t<-st?t+nr:t,e]}Us.invert=Us;function Bp(t,e,n){return(t%=nr)?e||n?el(Qa(t),tu(e,n)):Qa(t):e||n?tu(e,n):Us}function Ja(t){return function(e,n){return e+=t,[e>st?e-nr:e<-st?e+nr:e,n]}}function Qa(t){var e=Ja(t);return e.invert=Ja(-t),e}function tu(t,e){var n=Mt(t),r=Dt(t),i=Mt(e),o=Dt(e);function s(a,u){var l=Mt(u),c=Mt(a)*l,p=Dt(a)*l,h=Dt(u),g=h*n+c*r;return[ki(p*i-g*o,c*n-h*r),si(g*i+p*o)]}return s.invert=function(a,u){var l=Mt(u),c=Mt(a)*l,p=Dt(a)*l,h=Dt(u),g=h*i-p*o;return[ki(p*i+h*o,c*n+g*r),si(g*n-c*r)]},s}function zp(t,e,n,r,i,o){if(n){var s=Mt(e),a=Dt(e),u=r*n;i==null?(i=e+r*nr,o=e-u/2):(i=eu(s,i),o=eu(s,o),(r>0?i<o:i>o)&&(i+=r*nr));for(var l,c=i;r>0?c>o:c<o;c-=u)l=Bs([s,-a*Mt(c),-a*Dt(c)]),t.point(l[0],l[1])}}function eu(t,e){e=qi(e),e[0]-=t,zs(e);var n=tl(-e[1]);return((-e[2]<0?-n:n)+nr-yt)%nr}function nl(){var t=[],e;return{point:function(n,r){e.push([n,r])},lineStart:function(){t.push(e=[])},lineEnd:Hi,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;return t=[],e=null,n}}}function Up(t,e,n,r,i,o){var s=t[0],a=t[1],u=e[0],l=e[1],c=0,p=1,h=u-s,g=l-a,f;if(f=n-s,!(!h&&f>0)){if(f/=h,h<0){if(f<c)return;f<p&&(p=f)}else if(h>0){if(f>p)return;f>c&&(c=f)}if(f=i-s,!(!h&&f<0)){if(f/=h,h<0){if(f>p)return;f>c&&(c=f)}else if(h>0){if(f<c)return;f<p&&(p=f)}if(f=r-a,!(!g&&f>0)){if(f/=g,g<0){if(f<c)return;f<p&&(p=f)}else if(g>0){if(f>p)return;f>c&&(c=f)}if(f=o-a,!(!g&&f<0)){if(f/=g,g<0){if(f>p)return;f>c&&(c=f)}else if(g>0){if(f<c)return;f<p&&(p=f)}return c>0&&(t[0]=s+c*h,t[1]=a+c*g),p<1&&(e[0]=s+p*h,e[1]=a+p*g),!0}}}}}function qo(t,e){return oe(t[0]-e[0])<yt&&oe(t[1]-e[1])<yt}function Do(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function rl(t,e,n,r,i){var o=[],s=[],a,u;if(t.forEach(function(f){if(!((m=f.length-1)<=0)){var m,y=f[0],v=f[m],x;if(qo(y,v)){for(i.lineStart(),a=0;a<m;++a)i.point((y=f[a])[0],y[1]);i.lineEnd();return}o.push(x=new Do(y,f,null,!0)),s.push(x.o=new Do(y,null,x,!1)),o.push(x=new Do(v,f,null,!1)),s.push(x.o=new Do(v,null,x,!0))}}),!!o.length){for(s.sort(e),nu(o),nu(s),a=0,u=s.length;a<u;++a)s[a].e=n=!n;for(var l=o[0],c,p;;){for(var h=l,g=!0;h.v;)if((h=h.n)===l)return;c=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(g)for(a=0,u=c.length;a<u;++a)i.point((p=c[a])[0],p[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(g)for(c=h.p.z,a=c.length-1;a>=0;--a)i.point((p=c[a])[0],p[1]);else r(h.x,h.p.x,-1,i);h=h.p}h=h.o,c=h.z,g=!g}while(!h.v);i.lineEnd()}}}function nu(t){if(e=t.length){for(var e,n=0,r=t[0],i;++n<e;)r.n=i=t[n],i.p=r,r=i;r.n=i=t[0],i.p=r}}function il(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Vp(t){return t.length===1&&(t=$p(t)),{left:function(e,n,r,i){for(r==null&&(r=0),i==null&&(i=e.length);r<i;){var o=r+i>>>1;t(e[o],n)<0?r=o+1:i=o}return r},right:function(e,n,r,i){for(r==null&&(r=0),i==null&&(i=e.length);r<i;){var o=r+i>>>1;t(e[o],n)>0?i=o:r=o+1}return r}}}function $p(t){return function(e,n){return il(t(e),n)}}Vp(il);function ol(t){for(var e=t.length,n,r=-1,i=0,o,s;++r<e;)i+=t[r].length;for(o=new Array(i);--e>=0;)for(s=t[e],n=s.length;--n>=0;)o[--i]=s[n];return o}var Zi=1e9,Ao=-Zi;function Xp(t,e,n,r){function i(l,c){return t<=l&&l<=n&&e<=c&&c<=r}function o(l,c,p,h){var g=0,f=0;if(l==null||(g=s(l,p))!==(f=s(c,p))||u(l,c)<0^p>0)do h.point(g===0||g===3?t:n,g>1?r:e);while((g=(g+p+4)%4)!==f);else h.point(c[0],c[1])}function s(l,c){return oe(l[0]-t)<yt?c>0?0:3:oe(l[0]-n)<yt?c>0?2:1:oe(l[1]-e)<yt?c>0?1:0:c>0?3:2}function a(l,c){return u(l.x,c.x)}function u(l,c){var p=s(l,1),h=s(c,1);return p!==h?p-h:p===0?c[1]-l[1]:p===1?l[0]-c[0]:p===2?l[1]-c[1]:c[0]-l[0]}return function(l){var c=l,p=nl(),h,g,f,m,y,v,x,I,C,P,D,S={point:T,lineStart:k,lineEnd:pt,polygonStart:A,polygonEnd:X};function T(q,H){i(q,H)&&c.point(q,H)}function w(){for(var q=0,H=0,Et=g.length;H<Et;++H)for(var Wt=g[H],Ht=1,Bn=Wt.length,Ie=Wt[0],Me,Ue,Ir=Ie[0],or=Ie[1];Ht<Bn;++Ht)Me=Ir,Ue=or,Ie=Wt[Ht],Ir=Ie[0],or=Ie[1],Ue<=r?or>r&&(Ir-Me)*(r-Ue)>(or-Ue)*(t-Me)&&++q:or<=r&&(Ir-Me)*(r-Ue)<(or-Ue)*(t-Me)&&--q;return q}function A(){c=p,h=[],g=[],D=!0}function X(){var q=w(),H=D&&q,Et=(h=ol(h)).length;(H||Et)&&(l.polygonStart(),H&&(l.lineStart(),o(null,null,1,l),l.lineEnd()),Et&&rl(h,a,q,o,l),l.polygonEnd()),c=l,h=g=f=null}function k(){S.point=N,g&&g.push(f=[]),P=!0,C=!1,x=I=NaN}function pt(){h&&(N(m,y),v&&C&&p.rejoin(),h.push(p.result())),S.point=T,C&&c.lineEnd()}function N(q,H){var Et=i(q,H);if(g&&f.push([q,H]),P)m=q,y=H,v=Et,P=!1,Et&&(c.lineStart(),c.point(q,H));else if(Et&&C)c.point(q,H);else{var Wt=[x=Math.max(Ao,Math.min(Zi,x)),I=Math.max(Ao,Math.min(Zi,I))],Ht=[q=Math.max(Ao,Math.min(Zi,q)),H=Math.max(Ao,Math.min(Zi,H))];Up(Wt,Ht,t,e,n,r)?(C||(c.lineStart(),c.point(Wt[0],Wt[1])),c.point(Ht[0],Ht[1]),Et||c.lineEnd(),D=!1):Et&&(c.lineStart(),c.point(q,H),D=!1)}x=q,I=H,C=Et}return S}}var Ls=jr();function jp(t,e){var n=e[0],r=e[1],i=[Dt(n),-Mt(n),0],o=0,s=0;Ls.reset();for(var a=0,u=t.length;a<u;++a)if(c=(l=t[a]).length)for(var l,c,p=l[c-1],h=p[0],g=p[1]/2+Wa,f=Dt(g),m=Mt(g),y=0;y<c;++y,h=x,f=C,m=P,p=v){var v=l[y],x=v[0],I=v[1]/2+Wa,C=Dt(I),P=Mt(I),D=x-h,S=D>=0?1:-1,T=S*D,w=T>st,A=f*C;if(Ls.add(ki(A*S*Dt(T),m*P+A*Mt(T))),o+=w?D+S*nr:D,w^h>=n^x>=n){var X=Ko(qi(p),qi(v));zs(X);var k=Ko(i,X);zs(k);var pt=(w^D>=0?-1:1)*si(k[2]);(r>pt||r===pt&&(X[0]||X[1]))&&(s+=w^D>=0?1:-1)}}return(o<-yt||o<yt&&Ls<-yt)^s&1}jr();function ru(t){return t}jr();jr();var Bi=1/0,Jo=Bi,mo=-Bi,Qo=mo,iu={point:Yp,lineStart:Hi,lineEnd:Hi,polygonStart:Hi,polygonEnd:Hi,result:function(){var t=[[Bi,Jo],[mo,Qo]];return mo=Qo=-(Jo=Bi=1/0),t}};function Yp(t,e){t<Bi&&(Bi=t),t>mo&&(mo=t),e<Jo&&(Jo=e),e>Qo&&(Qo=e)}jr();function sl(t,e,n,r){return function(i,o){var s=e(o),a=i.invert(r[0],r[1]),u=nl(),l=e(u),c=!1,p,h,g,f={point:m,lineStart:v,lineEnd:x,polygonStart:function(){f.point=I,f.lineStart=C,f.lineEnd=P,h=[],p=[]},polygonEnd:function(){f.point=m,f.lineStart=v,f.lineEnd=x,h=ol(h);var D=jp(p,a);h.length?(c||(o.polygonStart(),c=!0),rl(h,Hp,D,n,o)):D&&(c||(o.polygonStart(),c=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),c&&(o.polygonEnd(),c=!1),h=p=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function m(D,S){var T=i(D,S);t(D=T[0],S=T[1])&&o.point(D,S)}function y(D,S){var T=i(D,S);s.point(T[0],T[1])}function v(){f.point=y,s.lineStart()}function x(){f.point=m,s.lineEnd()}function I(D,S){g.push([D,S]);var T=i(D,S);l.point(T[0],T[1])}function C(){l.lineStart(),g=[]}function P(){I(g[0][0],g[0][1]),l.lineEnd();var D=l.clean(),S=u.result(),T,w=S.length,A,X,k;if(g.pop(),p.push(g),g=null,!!w){if(D&1){if(X=S[0],(A=X.length-1)>0){for(c||(o.polygonStart(),c=!0),o.lineStart(),T=0;T<A;++T)o.point((k=X[T])[0],k[1]);o.lineEnd()}return}w>1&&D&2&&S.push(S.pop().concat(S.shift())),h.push(S.filter(Wp))}}return f}}function Wp(t){return t.length>1}function Hp(t,e){return((t=t.x)[0]<0?t[1]-Hn-yt:Hn-t[1])-((e=e.x)[0]<0?e[1]-Hn-yt:Hn-e[1])}const ou=sl(function(){return!0},Zp,Jp,[-st,-Hn]);function Zp(t){var e=NaN,n=NaN,r=NaN,i;return{lineStart:function(){t.lineStart(),i=1},point:function(o,s){var a=o>0?st:-st,u=oe(o-e);oe(u-st)<yt?(t.point(e,n=(n+s)/2>0?Hn:-Hn),t.point(r,n),t.lineEnd(),t.lineStart(),t.point(a,n),t.point(o,n),i=0):r!==a&&u>=st&&(oe(e-r)<yt&&(e-=r*yt),oe(o-a)<yt&&(o-=a*yt),n=Kp(e,n,o,s),t.point(r,n),t.lineEnd(),t.lineStart(),t.point(a,n),i=0),t.point(e=o,n=s),r=a},lineEnd:function(){t.lineEnd(),e=n=NaN},clean:function(){return 2-i}}}function Kp(t,e,n,r){var i,o,s=Dt(t-n);return oe(s)>yt?kp((Dt(e)*(o=Mt(r))*Dt(n)-Dt(r)*(i=Mt(e))*Dt(t))/(i*o*s)):(e+r)/2}function Jp(t,e,n,r){var i;if(t==null)i=n*Hn,r.point(-st,i),r.point(0,i),r.point(st,i),r.point(st,0),r.point(st,-i),r.point(0,-i),r.point(-st,-i),r.point(-st,0),r.point(-st,i);else if(oe(t[0]-e[0])>yt){var o=t[0]<e[0]?st:-st;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(e[0],e[1])}function Qp(t,e){var n=Mt(t),r=n>0,i=oe(n)>yt;function o(c,p,h,g){zp(g,t,e,h,c,p)}function s(c,p){return Mt(c)*Mt(p)>n}function a(c){var p,h,g,f,m;return{lineStart:function(){f=g=!1,m=1},point:function(y,v){var x=[y,v],I,C=s(y,v),P=r?C?0:l(y,v):C?l(y+(y<0?st:-st),v):0;if(!p&&(f=g=C)&&c.lineStart(),C!==g&&(I=u(p,x),(!I||qo(p,I)||qo(x,I))&&(x[0]+=yt,x[1]+=yt,C=s(x[0],x[1]))),C!==g)m=0,C?(c.lineStart(),I=u(x,p),c.point(I[0],I[1])):(I=u(p,x),c.point(I[0],I[1]),c.lineEnd()),p=I;else if(i&&p&&r^C){var D;!(P&h)&&(D=u(x,p,!0))&&(m=0,r?(c.lineStart(),c.point(D[0][0],D[0][1]),c.point(D[1][0],D[1][1]),c.lineEnd()):(c.point(D[1][0],D[1][1]),c.lineEnd(),c.lineStart(),c.point(D[0][0],D[0][1])))}C&&(!p||!qo(p,x))&&c.point(x[0],x[1]),p=x,g=C,h=P},lineEnd:function(){g&&c.lineEnd(),p=null},clean:function(){return m|(f&&g)<<1}}}function u(c,p,h){var g=qi(c),f=qi(p),m=[1,0,0],y=Ko(g,f),v=Po(y,y),x=y[0],I=v-x*x;if(!I)return!h&&c;var C=n*v/I,P=-n*x/I,D=Ko(m,y),S=Mo(m,C),T=Mo(y,P);Cs(S,T);var w=D,A=Po(S,w),X=Po(w,w),k=A*A-X*(Po(S,S)-1);if(!(k<0)){var pt=Xi(k),N=Mo(w,(-A-pt)/X);if(Cs(N,S),N=Bs(N),!h)return N;var q=c[0],H=p[0],Et=c[1],Wt=p[1],Ht;H<q&&(Ht=q,q=H,H=Ht);var Bn=H-q,Ie=oe(Bn-st)<yt,Me=Ie||Bn<yt;if(!Ie&&Wt<Et&&(Ht=Et,Et=Wt,Wt=Ht),Me?Ie?Et+Wt>0^N[1]<(oe(N[0]-q)<yt?Et:Wt):Et<=N[1]&&N[1]<=Wt:Bn>st^(q<=N[0]&&N[0]<=H)){var Ue=Mo(w,(-A+pt)/X);return Cs(Ue,S),[N,Bs(Ue)]}}}function l(c,p){var h=r?t:st-t,g=0;return c<-h?g|=1:c>h&&(g|=2),p<-h?g|=4:p>h&&(g|=8),g}return sl(s,a,o,r?[0,-t]:[-st,t-st])}function al(t){return function(e){var n=new Vs;for(var r in t)n[r]=t[r];return n.stream=e,n}}function Vs(){}Vs.prototype={constructor:Vs,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function ul(t,e,n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=t.clipExtent&&t.clipExtent();t.scale(150).translate([0,0]),o!=null&&t.clipExtent(null),qp(n,t.stream(iu));var s=iu.result(),a=Math.min(r/(s[1][0]-s[0][0]),i/(s[1][1]-s[0][1])),u=+e[0][0]+(r-a*(s[1][0]+s[0][0]))/2,l=+e[0][1]+(i-a*(s[1][1]+s[0][1]))/2;return o!=null&&t.clipExtent(o),t.scale(a*150).translate([u,l])}function th(t,e,n){return ul(t,[[0,0],e],n)}var su=16,eh=Mt(30*on);function au(t,e){return+e?rh(t,e):nh(t)}function nh(t){return al({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}function rh(t,e){function n(r,i,o,s,a,u,l,c,p,h,g,f,m,y){var v=l-r,x=c-i,I=v*v+x*x;if(I>4*e&&m--){var C=s+h,P=a+g,D=u+f,S=Xi(C*C+P*P+D*D),T=si(D/=S),w=oe(oe(D)-1)<yt||oe(o-p)<yt?(o+p)/2:ki(P,C),A=t(w,T),X=A[0],k=A[1],pt=X-r,N=k-i,q=x*pt-v*N;(q*q/I>e||oe((v*pt+x*N)/I-.5)>.3||s*h+a*g+u*f<eh)&&(n(r,i,o,s,a,u,X,k,w,C/=S,P/=S,D,m,y),y.point(X,k),n(X,k,w,C,P,D,l,c,p,h,g,f,m,y))}}return function(r){var i,o,s,a,u,l,c,p,h,g,f,m,y={point:v,lineStart:x,lineEnd:C,polygonStart:function(){r.polygonStart(),y.lineStart=P},polygonEnd:function(){r.polygonEnd(),y.lineStart=x}};function v(T,w){T=t(T,w),r.point(T[0],T[1])}function x(){p=NaN,y.point=I,r.lineStart()}function I(T,w){var A=qi([T,w]),X=t(T,w);n(p,h,c,g,f,m,p=X[0],h=X[1],c=T,g=A[0],f=A[1],m=A[2],su,r),r.point(p,h)}function C(){y.point=v,r.lineEnd()}function P(){x(),y.point=D,y.lineEnd=S}function D(T,w){I(i=T,w),o=p,s=h,a=g,u=f,l=m,y.point=I}function S(){n(p,h,c,g,f,m,o,s,i,a,u,l,su,r),y.lineEnd=C,C()}return y}}var ih=al({point:function(t,e){this.stream.point(t*on,e*on)}});function oh(t){return sh(function(){return t})()}function sh(t){var e,n=150,r=480,i=250,o,s,a=0,u=0,l=0,c=0,p=0,h,g,f=null,m=ou,y=null,v,x,I,C=ru,P=.5,D=au(X,P),S,T;function w(N){return N=g(N[0]*on,N[1]*on),[N[0]*n+o,s-N[1]*n]}function A(N){return N=g.invert((N[0]-o)/n,(s-N[1])/n),N&&[N[0]*Cr,N[1]*Cr]}function X(N,q){return N=e(N,q),[N[0]*n+o,s-N[1]*n]}w.stream=function(N){return S&&T===N?S:S=ih(m(h,D(C(T=N))))},w.clipAngle=function(N){return arguments.length?(m=+N?Qp(f=N*on,6*on):(f=null,ou),pt()):f*Cr},w.clipExtent=function(N){return arguments.length?(C=N==null?(y=v=x=I=null,ru):Xp(y=+N[0][0],v=+N[0][1],x=+N[1][0],I=+N[1][1]),pt()):y==null?null:[[y,v],[x,I]]},w.scale=function(N){return arguments.length?(n=+N,k()):n},w.translate=function(N){return arguments.length?(r=+N[0],i=+N[1],k()):[r,i]},w.center=function(N){return arguments.length?(a=N[0]%360*on,u=N[1]%360*on,k()):[a*Cr,u*Cr]},w.rotate=function(N){return arguments.length?(l=N[0]%360*on,c=N[1]%360*on,p=N.length>2?N[2]%360*on:0,k()):[l*Cr,c*Cr,p*Cr]},w.precision=function(N){return arguments.length?(D=au(X,P=N*N),pt()):Xi(P)},w.fitExtent=function(N,q){return ul(w,N,q)},w.fitSize=function(N,q){return th(w,N,q)};function k(){g=el(h=Bp(l,c,p),e);var N=e(a,u);return o=r-N[0]*n,s=i+N[1]*n,pt()}function pt(){return S=T=null,w}return function(){return e=t.apply(this,arguments),w.invert=e.invert&&A,k()}}function ll(t){return function(e,n){var r=Mt(e),i=Mt(n),o=t(r*i);return[o*i*Dt(e),o*Dt(n)]}}function cl(t){return function(e,n){var r=Xi(e*e+n*n),i=t(r),o=Dt(i),s=Mt(i);return[ki(e*o,r*s),si(r&&n*o/r)]}}var ah=ll(function(t){return Xi(2/(1+t))});ah.invert=cl(function(t){return 2*si(t/2)});var pl=ll(function(t){return(t=tl(t))&&t/Dt(t)});pl.invert=cl(function(t){return t});function uh(){return oh(pl).scale(79.4188).clipAngle(180-.001)}function uu(t,e){return[t,e]}uu.invert=uu;function lh(t,e,n){n=n||{};var r=n.units||"kilometers",i=n.steps||8;if(!t)throw new Error("geojson is required");if(typeof n!="object")throw new Error("options must be an object");if(typeof i!="number")throw new Error("steps must be an number");if(e===void 0)throw new Error("radius is required");if(i<=0)throw new Error("steps must be greater than 0");var o=[];switch(t.type){case"GeometryCollection":return Lu(t,function(s){var a=Bo(s,e,r,i);a&&o.push(a)}),Fs(o);case"FeatureCollection":return Ua(t,function(s){var a=Bo(s,e,r,i);a&&Ua(a,function(u){u&&o.push(u)})}),Fs(o)}return Bo(t,e,r,i)}function Bo(t,e,n,r){var i=t.properties||{},o=t.type==="Feature"?t.geometry:t;if(o.type==="GeometryCollection"){var s=[];return Lu(t,function(m){var y=Bo(m,e,n,r);y&&s.push(y)}),Fs(s)}var a=ch(o),u={type:o.type,coordinates:fl(o.coordinates,a)},l=new Qs,c=l.read(u),p=yp(_p(e,n),"meters"),h=Ut.bufferOp(c,p,r),g=new Fu;if(h=g.write(h),!hl(h.coordinates)){var f={type:h.type,coordinates:gl(h.coordinates,a)};return ts(f,i)}}function hl(t){return Array.isArray(t[0])?hl(t[0]):isNaN(t[0])}function fl(t,e){return typeof t[0]!="object"?e(t):t.map(function(n){return fl(n,e)})}function gl(t,e){return typeof t[0]!="object"?e.invert(t):t.map(function(n){return gl(n,e)})}function ch(t){var e=Ep(t).geometry.coordinates,n=[-e[0],-e[1]];return uh().rotate(n).scale(Ne)}function ph(t,e){var n=Vo(t),r=Vo(e),i=t.properties||{},o=xu.difference(n.coordinates,r.coordinates);return o.length===0?null:o.length===1?Nu(o[0],i):bu(o,i)}function lu(t){let e;for(const n of t)e&&n[0]-e[0]>=180?n[0]-=360:e&&n[0]-e[0]<-180&&(n[0]+=360),e=n}function cu(t,e){const n=ph({type:"Polygon",coordinates:[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]},t);if(!n)return;n.properties={isMask:"y"};const r=lh(t,0);if(r.geometry.type==="Polygon")for(const i of r.geometry.coordinates)lu(i);else for(const i of r.geometry.coordinates)for(const o of i)lu(o);e({type:"FeatureCollection",features:[r,n]})}let pu={type:"FeatureCollection",features:[]};function dl(t,e,n=!0,r=!0,i={},o={},s={fill:{paint:{"fill-color":"#000","fill-opacity":.1},filter:["all",["==",["geometry-type"],"Polygon"],["has","isMask"]]},line:{layout:{"line-cap":"square"},paint:{"line-width":["case",["==",["geometry-type"],"Polygon"],2,3],"line-dasharray":[1,1],"line-color":"#3170fe"},filter:["!",["has","isMask"]]}}){let a,u=[],l,c;function p(){(s!=null&&s.fill||s!=null&&s.line)&&t.addSource("full-geom",{type:"geojson",data:pu}),s!=null&&s.fill&&t.addLayer({...s==null?void 0:s.fill,id:"full-geom-fill",type:"fill",source:"full-geom"}),s!=null&&s.line&&t.addLayer({...s==null?void 0:s.line,id:"full-geom-line",type:"line",source:"full-geom"})}t.loaded()?p():t.once("load",()=>{p()});const h=f=>{a==null||a({type:"mapClick",coordinates:[f.lngLat.lng,f.lngLat.lat]})};function g(f=!1){if(!e)throw new Error;const m=document.createElement("div");return f&&m.classList.add("marker-interactive"),new Nc({props:{displayIn:"maplibre"},target:m}),new e.Marker({element:m,offset:[1,-13]})}return{setEventHandler(f){f?(a=f,t.on("click",h)):(a=void 0,t.off("click",h))},flyTo(f,m){t.flyTo({center:f,zoom:m,...i})},fitBounds(f,m,y){t.fitBounds([[f[0],f[1]],[f[2],f[3]]],{padding:m,maxZoom:y,...o})},indicateReverse(f){t.getCanvasContainer().style.cursor=f?"crosshair":""},setReverseMarker(f){!e||!n||(c?f?c.setLngLat(f):(c.remove(),c=void 0):f&&(c=(typeof n=="object"?new e.Marker(n):g()).setLngLat(f).addTo(t),c.getElement().classList.add("marker-reverse")))},setMarkers(f,m){if(!n)return;function y(v){var x;(x=t.getSource("full-geom"))==null||x.setData(v)}for(const v of u)v.remove();if(u.length=0,y(pu),!!e){if(m){let v=!1;if(m.geometry.type==="GeometryCollection"){const x=m.geometry.geometries.filter(I=>I.type==="Polygon"||I.type==="MultiPolygon");if(x.length>0){let I=x.pop();for(const C of x)I=vp(I,C);cu({...m,geometry:I},y),v=!0}else{const I=m.geometry.geometries.filter(C=>C.type==="LineString"||C.type==="MultiLineString");I.length>0&&(y({...m,geometry:{type:"GeometryCollection",geometries:I}}),v=!0)}}if(!v){if(m.geometry.type==="Polygon"||m.geometry.type==="MultiPolygon")cu(m,y);else if(m.geometry.type==="LineString"||m.geometry.type==="MultiLineString"){y(m);return}}n&&u.push((typeof n=="object"?new e.Marker(n):g()).setLngLat(m.center).addTo(t))}if(r)for(const v of f??[]){if(v===m)continue;const x=(typeof r=="object"?new e.Marker(r):g(!0)).setLngLat(v.center).setPopup(new e.Popup({offset:[1,-27],closeButton:!1,closeOnMove:!0,className:"maptiler-gc-popup"}).setText(v.place_type[0]==="reverse"?v.place_name:v.place_name.replace(/,.*/,""))).addTo(t),I=x.getElement();I.addEventListener("click",C=>{C.stopPropagation(),a==null||a({type:"markerClick",id:v.id})}),I.addEventListener("mouseenter",()=>{a==null||a({type:"markerMouseEnter",id:v.id}),x.togglePopup()}),I.addEventListener("mouseleave",()=>{a==null||a({type:"markerMouseLeave",id:v.id}),x.togglePopup()}),u.push(x)}}},setSelectedMarker(f){l&&l.getElement().classList.toggle("marker-selected",!1),l=f>-1?u[f]:void 0,l==null||l.getElement().classList.toggle("marker-selected",!0)},getCenterAndZoom(){const f=t.getCenter();return[t.getZoom(),f.lng,f.lat]}}}var nn,yi;class hh extends EventTarget{constructor(e={}){super(),ha(this,nn,void 0),ha(this,yi,void 0),xs(this,yi,e)}onAddInt(e){const n=document.createElement("div");n.className="mapboxgl-ctrl-geocoder mapboxgl-ctrl maplibregl-ctrl-geocoder maplibregl-ctrl mapboxgl-ctrl-group";const{marker:r,showResultMarkers:i,flyTo:o,fullGeometryStyle:s,...a}=bn(this,yi),u=typeof o=="boolean"?{}:o,l=this.getExtraProps(e,n),c={mapController:dl(e,this.getMapLibreGl(),r,i,u,u,s),flyTo:o===void 0?!0:!!o,apiKey:"",...l,...a};if(!c.apiKey)throw new Error("no apiKey provided");xs(this,nn,new Yc({target:n,props:c}));for(const p of["select","pick","featuresListed","featuresMarked","response","optionsVisibilityChange","reverseToggle","queryChange"])bn(this,nn).$on(p,h=>this.dispatchEvent(h));return n}setOptions(e){var n;xs(this,yi,e);const{marker:r,showResultMarkers:i,flyTo:o,fullGeometryStyle:s,...a}=bn(this,yi);(n=bn(this,nn))==null||n.$set(a)}setQuery(e,n=!0){var r;(r=bn(this,nn))==null||r.setQuery(e,n)}clearMap(){var e;(e=bn(this,nn))==null||e.clearMap()}clearList(){var e;(e=bn(this,nn))==null||e.clearList()}setReverseMode(e){var n;(n=bn(this,nn))==null||n.$set({reverseActive:e})}focus(){var e;(e=bn(this,nn))==null||e.focus()}blur(){var e;(e=bn(this,nn))==null||e.blur()}onRemove(){var e;(e=bn(this,nn))==null||e.$destroy()}}nn=new WeakMap,yi=new WeakMap;class fh extends hh{getMapLibreGl(){return Gl}onAdd(e){return super.onAddInt(e)}getExtraProps(e,n){return{}}}exports.GeocodingControl=fh;exports.createMapLibreGlMapController=dl;
|
|
21
|
+
***************************************************************************** */function mo(i,t){var e={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},r,o,n,l;return l={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function s(a){return function(d){return c([a,d])}}function c(a){if(r)throw new TypeError("Generator is already executing.");for(;e;)try{if(r=1,o&&(n=a[0]&2?o.return:a[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,a[1])).done)return n;switch(o=0,n&&(a=[a[0]&2,n.value]),a[0]){case 0:case 1:n=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,o=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(n=e.trys,!(n=n.length>0&&n[n.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!n||a[1]>n[0]&&a[1]<n[3])){e.label=a[1];break}if(a[0]===6&&e.label<n[1]){e.label=n[1],n=a;break}if(n&&e.label<n[2]){e.label=n[2],e.ops.push(a);break}n[2]&&e.ops.pop(),e.trys.pop();continue}a=t.call(i,e)}catch(d){a=[6,d],o=0}finally{r=n=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}var Lt=function(){function i(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null}return i}();function go(i,t){return i>t?1:i<t?-1:0}function yt(i,t,e){for(var r=new Lt(null,null),o=r,n=r;;){var l=e(i,t.key);if(l<0){if(t.left===null)break;if(e(i,t.left.key)<0){var s=t.left;if(t.left=s.right,s.right=t,t=s,t.left===null)break}n.left=t,n=t,t=t.left}else if(l>0){if(t.right===null)break;if(e(i,t.right.key)>0){var s=t.right;if(t.right=s.left,s.left=t,t=s,t.right===null)break}o.right=t,o=t,t=t.right}else break}return o.right=t.left,n.left=t.right,t.left=r.right,t.right=r.left,t}function Ee(i,t,e,r){var o=new Lt(i,t);if(e===null)return o.left=o.right=null,o;e=yt(i,e,r);var n=r(i,e.key);return n<0?(o.left=e.left,o.right=e,e.left=null):n>=0&&(o.right=e.right,o.left=e,e.right=null),o}function nr(i,t,e){var r=null,o=null;if(t){t=yt(i,t,e);var n=e(t.key,i);n===0?(r=t.left,o=t.right):n<0?(o=t.right,t.right=null,r=t):(r=t.left,t.left=null,o=t)}return{left:r,right:o}}function yo(i,t,e){return t===null?i:(i===null||(t=yt(i.key,t,e),t.left=i),t)}function ke(i,t,e,r,o){if(i){r(""+t+(e?"└── ":"├── ")+o(i)+`
|
|
22
|
+
`);var n=t+(e?" ":"│ ");i.left&&ke(i.left,n,!1,r,o),i.right&&ke(i.right,n,!0,r,o)}}var Re=function(){function i(t){t===void 0&&(t=go),this._root=null,this._size=0,this._comparator=t}return i.prototype.insert=function(t,e){return this._size++,this._root=Ee(t,e,this._root,this._comparator)},i.prototype.add=function(t,e){var r=new Lt(t,e);this._root===null&&(r.left=r.right=null,this._size++,this._root=r);var o=this._comparator,n=yt(t,this._root,o),l=o(t,n.key);return l===0?this._root=n:(l<0?(r.left=n.left,r.right=n,n.left=null):l>0&&(r.right=n.right,r.left=n,n.right=null),this._size++,this._root=r),this._root},i.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},i.prototype._remove=function(t,e,r){var o;if(e===null)return null;e=yt(t,e,r);var n=r(t,e.key);return n===0?(e.left===null?o=e.right:(o=yt(t,e.left,r),o.right=e.right),this._size--,o):e},i.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=yt(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},i.prototype.findStatic=function(t){for(var e=this._root,r=this._comparator;e;){var o=r(t,e.key);if(o===0)return e;o<0?e=e.left:e=e.right}return null},i.prototype.find=function(t){return this._root&&(this._root=yt(t,this._root,this._comparator),this._comparator(t,this._root.key)!==0)?null:this._root},i.prototype.contains=function(t){for(var e=this._root,r=this._comparator;e;){var o=r(t,e.key);if(o===0)return!0;o<0?e=e.left:e=e.right}return!1},i.prototype.forEach=function(t,e){for(var r=this._root,o=[],n=!1;!n;)r!==null?(o.push(r),r=r.left):o.length!==0?(r=o.pop(),t.call(e,r),r=r.right):n=!0;return this},i.prototype.range=function(t,e,r,o){for(var n=[],l=this._comparator,s=this._root,c;n.length!==0||s;)if(s)n.push(s),s=s.left;else{if(s=n.pop(),c=l(s.key,e),c>0)break;if(l(s.key,t)>=0&&r.call(o,s))return this;s=s.right}return this},i.prototype.keys=function(){var t=[];return this.forEach(function(e){var r=e.key;return t.push(r)}),t},i.prototype.values=function(){var t=[];return this.forEach(function(e){var r=e.data;return t.push(r)}),t},i.prototype.min=function(){return this._root?this.minNode(this._root).key:null},i.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},i.prototype.minNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.left;)t=t.left;return t},i.prototype.maxNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.right;)t=t.right;return t},i.prototype.at=function(t){for(var e=this._root,r=!1,o=0,n=[];!r;)if(e)n.push(e),e=e.left;else if(n.length>0){if(e=n.pop(),o===t)return e;o++,e=e.right}else r=!0;return null},i.prototype.next=function(t){var e=this._root,r=null;if(t.right){for(r=t.right;r.left;)r=r.left;return r}for(var o=this._comparator;e;){var n=o(t.key,e.key);if(n===0)break;n<0?(r=e,e=e.left):e=e.right}return r},i.prototype.prev=function(t){var e=this._root,r=null;if(t.left!==null){for(r=t.left;r.right;)r=r.right;return r}for(var o=this._comparator;e;){var n=o(t.key,e.key);if(n===0)break;n<0?e=e.left:(r=e,e=e.right)}return r},i.prototype.clear=function(){return this._root=null,this._size=0,this},i.prototype.toList=function(){return bo(this._root)},i.prototype.load=function(t,e,r){e===void 0&&(e=[]),r===void 0&&(r=!1);var o=t.length,n=this._comparator;if(r&&Me(t,e,0,o-1,n),this._root===null)this._root=_e(t,e,0,o),this._size=o;else{var l=xo(this.toList(),vo(t,e),n);o=this._size+o,this._root=Ne({head:l},0,o)}return this},i.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(i.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),i.prototype.toString=function(t){t===void 0&&(t=function(r){return String(r.key)});var e=[];return ke(this._root,"",!0,function(r){return e.push(r)},t),e.join("")},i.prototype.update=function(t,e,r){var o=this._comparator,n=nr(t,this._root,o),l=n.left,s=n.right;o(t,e)<0?s=Ee(e,r,s,o):l=Ee(e,r,l,o),this._root=yo(l,s,o)},i.prototype.split=function(t){return nr(t,this._root,this._comparator)},i.prototype[Symbol.iterator]=function(){var t,e,r;return mo(this,function(o){switch(o.label){case 0:t=this._root,e=[],r=!1,o.label=1;case 1:return r?[3,6]:t===null?[3,2]:(e.push(t),t=t.left,[3,5]);case 2:return e.length===0?[3,4]:(t=e.pop(),[4,t]);case 3:return o.sent(),t=t.right,[3,5];case 4:r=!0,o.label=5;case 5:return[3,1];case 6:return[2]}})},i}();function _e(i,t,e,r){var o=r-e;if(o>0){var n=e+Math.floor(o/2),l=i[n],s=t[n],c=new Lt(l,s);return c.left=_e(i,t,e,n),c.right=_e(i,t,n+1,r),c}return null}function vo(i,t){for(var e=new Lt(null,null),r=e,o=0;o<i.length;o++)r=r.next=new Lt(i[o],t[o]);return r.next=null,e.next}function bo(i){for(var t=i,e=[],r=!1,o=new Lt(null,null),n=o;!r;)t?(e.push(t),t=t.left):e.length>0?(t=n=n.next=e.pop(),t=t.right):r=!0;return n.next=null,o.next}function Ne(i,t,e){var r=e-t;if(r>0){var o=t+Math.floor(r/2),n=Ne(i,t,o),l=i.head;return l.left=n,i.head=i.head.next,l.right=Ne(i,o+1,e),l}return null}function xo(i,t,e){for(var r=new Lt(null,null),o=r,n=i,l=t;n!==null&&l!==null;)e(n.key,l.key)<0?(o.next=n,n=n.next):(o.next=l,l=l.next),o=o.next;return n!==null?o.next=n:l!==null&&(o.next=l),r.next}function Me(i,t,e,r,o){if(!(e>=r)){for(var n=i[e+r>>1],l=e-1,s=r+1;;){do l++;while(o(i[l],n)<0);do s--;while(o(i[s],n)>0);if(l>=s)break;var c=i[l];i[l]=i[s],i[s]=c,c=t[l],t[l]=t[s],t[s]=c}Me(i,t,e,s,o),Me(i,t,s+1,r,o)}}const ft=11102230246251565e-32,V=134217729,Eo=(3+8*ft)*ft;function Le(i,t,e,r,o){let n,l,s,c,a=t[0],d=r[0],u=0,f=0;d>a==d>-a?(n=a,a=t[++u]):(n=d,d=r[++f]);let h=0;if(u<i&&f<e)for(d>a==d>-a?(l=a+n,s=n-(l-a),a=t[++u]):(l=d+n,s=n-(l-d),d=r[++f]),n=l,s!==0&&(o[h++]=s);u<i&&f<e;)d>a==d>-a?(l=n+a,c=l-n,s=n-(l-c)+(a-c),a=t[++u]):(l=n+d,c=l-n,s=n-(l-c)+(d-c),d=r[++f]),n=l,s!==0&&(o[h++]=s);for(;u<i;)l=n+a,c=l-n,s=n-(l-c)+(a-c),a=t[++u],n=l,s!==0&&(o[h++]=s);for(;f<e;)l=n+d,c=l-n,s=n-(l-c)+(d-c),d=r[++f],n=l,s!==0&&(o[h++]=s);return(n!==0||h===0)&&(o[h++]=n),h}function Lo(i,t){let e=t[0];for(let r=1;r<i;r++)e+=t[r];return e}function Zt(i){return new Float64Array(i)}const wo=(3+16*ft)*ft,So=(2+12*ft)*ft,$o=(9+64*ft)*ft*ft,Rt=Zt(4),sr=Zt(8),lr=Zt(12),ar=Zt(16),X=Zt(4);function ko(i,t,e,r,o,n,l){let s,c,a,d,u,f,h,v,x,g,m,L,$,E,_,S,w,b;const N=i-o,P=e-o,U=t-n,z=r-n;E=N*z,f=V*N,h=f-(f-N),v=N-h,f=V*z,x=f-(f-z),g=z-x,_=v*g-(E-h*x-v*x-h*g),S=U*P,f=V*U,h=f-(f-U),v=U-h,f=V*P,x=f-(f-P),g=P-x,w=v*g-(S-h*x-v*x-h*g),m=_-w,u=_-m,Rt[0]=_-(m+u)+(u-w),L=E+m,u=L-E,$=E-(L-u)+(m-u),m=$-S,u=$-m,Rt[1]=$-(m+u)+(u-S),b=L+m,u=b-L,Rt[2]=L-(b-u)+(m-u),Rt[3]=b;let W=Lo(4,Rt),k=So*l;if(W>=k||-W>=k||(u=i-N,s=i-(N+u)+(u-o),u=e-P,a=e-(P+u)+(u-o),u=t-U,c=t-(U+u)+(u-n),u=r-z,d=r-(z+u)+(u-n),s===0&&c===0&&a===0&&d===0)||(k=$o*l+Eo*Math.abs(W),W+=N*d+z*s-(U*a+P*c),W>=k||-W>=k))return W;E=s*z,f=V*s,h=f-(f-s),v=s-h,f=V*z,x=f-(f-z),g=z-x,_=v*g-(E-h*x-v*x-h*g),S=c*P,f=V*c,h=f-(f-c),v=c-h,f=V*P,x=f-(f-P),g=P-x,w=v*g-(S-h*x-v*x-h*g),m=_-w,u=_-m,X[0]=_-(m+u)+(u-w),L=E+m,u=L-E,$=E-(L-u)+(m-u),m=$-S,u=$-m,X[1]=$-(m+u)+(u-S),b=L+m,u=b-L,X[2]=L-(b-u)+(m-u),X[3]=b;const G=Le(4,Rt,4,X,sr);E=N*d,f=V*N,h=f-(f-N),v=N-h,f=V*d,x=f-(f-d),g=d-x,_=v*g-(E-h*x-v*x-h*g),S=U*a,f=V*U,h=f-(f-U),v=U-h,f=V*a,x=f-(f-a),g=a-x,w=v*g-(S-h*x-v*x-h*g),m=_-w,u=_-m,X[0]=_-(m+u)+(u-w),L=E+m,u=L-E,$=E-(L-u)+(m-u),m=$-S,u=$-m,X[1]=$-(m+u)+(u-S),b=L+m,u=b-L,X[2]=L-(b-u)+(m-u),X[3]=b;const tt=Le(G,sr,4,X,lr);E=s*d,f=V*s,h=f-(f-s),v=s-h,f=V*d,x=f-(f-d),g=d-x,_=v*g-(E-h*x-v*x-h*g),S=c*a,f=V*c,h=f-(f-c),v=c-h,f=V*a,x=f-(f-a),g=a-x,w=v*g-(S-h*x-v*x-h*g),m=_-w,u=_-m,X[0]=_-(m+u)+(u-w),L=E+m,u=L-E,$=E-(L-u)+(m-u),m=$-S,u=$-m,X[1]=$-(m+u)+(u-S),b=L+m,u=b-L,X[2]=L-(b-u)+(m-u),X[3]=b;const rt=Le(tt,lr,4,X,ar);return ar[rt-1]}function _o(i,t,e,r,o,n){const l=(t-n)*(e-o),s=(i-o)*(r-n),c=l-s,a=Math.abs(l+s);return Math.abs(c)>=wo*a?c:-ko(i,t,e,r,o,n,a)}const Ft=(i,t)=>i.ll.x<=t.x&&t.x<=i.ur.x&&i.ll.y<=t.y&&t.y<=i.ur.y,Ce=(i,t)=>{if(t.ur.x<i.ll.x||i.ur.x<t.ll.x||t.ur.y<i.ll.y||i.ur.y<t.ll.y)return null;const e=i.ll.x<t.ll.x?t.ll.x:i.ll.x,r=i.ur.x<t.ur.x?i.ur.x:t.ur.x,o=i.ll.y<t.ll.y?t.ll.y:i.ll.y,n=i.ur.y<t.ur.y?i.ur.y:t.ur.y;return{ll:{x:e,y:o},ur:{x:r,y:n}}};let vt=Number.EPSILON;vt===void 0&&(vt=Math.pow(2,-52));const No=vt*vt,ur=(i,t)=>{if(-vt<i&&i<vt&&-vt<t&&t<vt)return 0;const e=i-t;return e*e<No*i*t?0:i<t?-1:1};class Mo{constructor(){this.reset()}reset(){this.xRounder=new cr,this.yRounder=new cr}round(t,e){return{x:this.xRounder.round(t),y:this.yRounder.round(e)}}}class cr{constructor(){this.tree=new Re,this.round(0)}round(t){const e=this.tree.add(t),r=this.tree.prev(e);if(r!==null&&ur(e.key,r.key)===0)return this.tree.remove(t),r.key;const o=this.tree.next(e);return o!==null&&ur(e.key,o.key)===0?(this.tree.remove(t),o.key):t}}const qt=new Mo,oe=(i,t)=>i.x*t.y-i.y*t.x,Tr=(i,t)=>i.x*t.x+i.y*t.y,dr=(i,t,e)=>{const r=_o(i.x,i.y,t.x,t.y,e.x,e.y);return r>0?-1:r<0?1:0},se=i=>Math.sqrt(Tr(i,i)),Co=(i,t,e)=>{const r={x:t.x-i.x,y:t.y-i.y},o={x:e.x-i.x,y:e.y-i.y};return oe(o,r)/se(o)/se(r)},To=(i,t,e)=>{const r={x:t.x-i.x,y:t.y-i.y},o={x:e.x-i.x,y:e.y-i.y};return Tr(o,r)/se(o)/se(r)},fr=(i,t,e)=>t.y===0?null:{x:i.x+t.x/t.y*(e-i.y),y:e},hr=(i,t,e)=>t.x===0?null:{x:e,y:i.y+t.y/t.x*(e-i.x)},Po=(i,t,e,r)=>{if(t.x===0)return hr(e,r,i.x);if(r.x===0)return hr(i,t,e.x);if(t.y===0)return fr(e,r,i.y);if(r.y===0)return fr(i,t,e.y);const o=oe(t,r);if(o==0)return null;const n={x:e.x-i.x,y:e.y-i.y},l=oe(n,t)/o,s=oe(n,r)/o,c=i.x+s*t.x,a=e.x+l*r.x,d=i.y+s*t.y,u=e.y+l*r.y,f=(c+a)/2,h=(d+u)/2;return{x:f,y:h}};class ot{static compare(t,e){const r=ot.comparePoints(t.point,e.point);return r!==0?r:(t.point!==e.point&&t.link(e),t.isLeft!==e.isLeft?t.isLeft?1:-1:bt.compare(t.segment,e.segment))}static comparePoints(t,e){return t.x<e.x?-1:t.x>e.x?1:t.y<e.y?-1:t.y>e.y?1:0}constructor(t,e){t.events===void 0?t.events=[this]:t.events.push(this),this.point=t,this.isLeft=e}link(t){if(t.point===this.point)throw new Error("Tried to link already linked events");const e=t.point.events;for(let r=0,o=e.length;r<o;r++){const n=e[r];this.point.events.push(n),n.point=this.point}this.checkForConsuming()}checkForConsuming(){const t=this.point.events.length;for(let e=0;e<t;e++){const r=this.point.events[e];if(r.segment.consumedBy===void 0)for(let o=e+1;o<t;o++){const n=this.point.events[o];n.consumedBy===void 0&&r.otherSE.point.events===n.otherSE.point.events&&r.segment.consume(n.segment)}}}getAvailableLinkedEvents(){const t=[];for(let e=0,r=this.point.events.length;e<r;e++){const o=this.point.events[e];o!==this&&!o.segment.ringOut&&o.segment.isInResult()&&t.push(o)}return t}getLeftmostComparator(t){const e=new Map,r=o=>{const n=o.otherSE;e.set(o,{sine:Co(this.point,t.point,n.point),cosine:To(this.point,t.point,n.point)})};return(o,n)=>{e.has(o)||r(o),e.has(n)||r(n);const{sine:l,cosine:s}=e.get(o),{sine:c,cosine:a}=e.get(n);return l>=0&&c>=0?s<a?1:s>a?-1:0:l<0&&c<0?s<a?-1:s>a?1:0:c<l?-1:c>l?1:0}}}let Ro=0;class bt{static compare(t,e){const r=t.leftSE.point.x,o=e.leftSE.point.x,n=t.rightSE.point.x,l=e.rightSE.point.x;if(l<r)return 1;if(n<o)return-1;const s=t.leftSE.point.y,c=e.leftSE.point.y,a=t.rightSE.point.y,d=e.rightSE.point.y;if(r<o){if(c<s&&c<a)return 1;if(c>s&&c>a)return-1;const u=t.comparePoint(e.leftSE.point);if(u<0)return 1;if(u>0)return-1;const f=e.comparePoint(t.rightSE.point);return f!==0?f:-1}if(r>o){if(s<c&&s<d)return-1;if(s>c&&s>d)return 1;const u=e.comparePoint(t.leftSE.point);if(u!==0)return u;const f=t.comparePoint(e.rightSE.point);return f<0?1:f>0?-1:1}if(s<c)return-1;if(s>c)return 1;if(n<l){const u=e.comparePoint(t.rightSE.point);if(u!==0)return u}if(n>l){const u=t.comparePoint(e.rightSE.point);if(u<0)return 1;if(u>0)return-1}if(n!==l){const u=a-s,f=n-r,h=d-c,v=l-o;if(u>f&&h<v)return 1;if(u<f&&h>v)return-1}return n>l?1:n<l||a<d?-1:a>d?1:t.id<e.id?-1:t.id>e.id?1:0}constructor(t,e,r,o){this.id=++Ro,this.leftSE=t,t.segment=this,t.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=t,this.rings=r,this.windings=o}static fromRing(t,e,r){let o,n,l;const s=ot.comparePoints(t,e);if(s<0)o=t,n=e,l=1;else if(s>0)o=e,n=t,l=-1;else throw new Error(`Tried to create degenerate segment at [${t.x}, ${t.y}]`);const c=new ot(o,!0),a=new ot(n,!1);return new bt(c,a,[r],[l])}replaceRightSE(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t<e?t:e},ur:{x:this.rightSE.point.x,y:t>e?t:e}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}comparePoint(t){if(this.isAnEndpoint(t))return 0;const e=this.leftSE.point,r=this.rightSE.point,o=this.vector();if(e.x===r.x)return t.x===e.x?0:t.x<e.x?1:-1;const n=(t.y-e.y)/o.y,l=e.x+n*o.x;if(t.x===l)return 0;const s=(t.x-e.x)/o.x,c=e.y+s*o.y;return t.y===c?0:t.y<c?-1:1}getIntersection(t){const e=this.bbox(),r=t.bbox(),o=Ce(e,r);if(o===null)return null;const n=this.leftSE.point,l=this.rightSE.point,s=t.leftSE.point,c=t.rightSE.point,a=Ft(e,s)&&this.comparePoint(s)===0,d=Ft(r,n)&&t.comparePoint(n)===0,u=Ft(e,c)&&this.comparePoint(c)===0,f=Ft(r,l)&&t.comparePoint(l)===0;if(d&&a)return f&&!u?l:!f&&u?c:null;if(d)return u&&n.x===c.x&&n.y===c.y?null:n;if(a)return f&&l.x===s.x&&l.y===s.y?null:s;if(f&&u)return null;if(f)return l;if(u)return c;const h=Po(n,this.vector(),s,t.vector());return h===null||!Ft(o,h)?null:qt.round(h.x,h.y)}split(t){const e=[],r=t.events!==void 0,o=new ot(t,!0),n=new ot(t,!1),l=this.rightSE;this.replaceRightSE(n),e.push(n),e.push(o);const s=new bt(o,l,this.rings.slice(),this.windings.slice());return ot.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),ot.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),r&&(o.checkForConsuming(),n.checkForConsuming()),e}swapEvents(){const t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let e=0,r=this.windings.length;e<r;e++)this.windings[e]*=-1}consume(t){let e=this,r=t;for(;e.consumedBy;)e=e.consumedBy;for(;r.consumedBy;)r=r.consumedBy;const o=bt.compare(e,r);if(o!==0){if(o>0){const n=e;e=r,r=n}if(e.prev===r){const n=e;e=r,r=n}for(let n=0,l=r.rings.length;n<l;n++){const s=r.rings[n],c=r.windings[n],a=e.rings.indexOf(s);a===-1?(e.rings.push(s),e.windings.push(c)):e.windings[a]+=c}r.rings=null,r.windings=null,r.consumedBy=e,r.leftSE.consumedBy=e.leftSE,r.rightSE.consumedBy=e.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};const e=this._afterState.rings,r=this._afterState.windings,o=this._afterState.multiPolys;for(let s=0,c=this.rings.length;s<c;s++){const a=this.rings[s],d=this.windings[s],u=e.indexOf(a);u===-1?(e.push(a),r.push(d)):r[u]+=d}const n=[],l=[];for(let s=0,c=e.length;s<c;s++){if(r[s]===0)continue;const a=e[s],d=a.poly;if(l.indexOf(d)===-1)if(a.isExterior)n.push(d);else{l.indexOf(d)===-1&&l.push(d);const u=n.indexOf(a.poly);u!==-1&&n.splice(u,1)}}for(let s=0,c=n.length;s<c;s++){const a=n[s].multiPoly;o.indexOf(a)===-1&&o.push(a)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const t=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(lt.type){case"union":{const r=t.length===0,o=e.length===0;this._isInResult=r!==o;break}case"intersection":{let r,o;t.length<e.length?(r=t.length,o=e.length):(r=e.length,o=t.length),this._isInResult=o===lt.numMultiPolys&&r<o;break}case"xor":{const r=Math.abs(t.length-e.length);this._isInResult=r%2===1;break}case"difference":{const r=o=>o.length===1&&o[0].isSubject;this._isInResult=r(t)!==r(e);break}default:throw new Error(`Unrecognized operation type found ${lt.type}`)}return this._isInResult}}class pr{constructor(t,e,r){if(!Array.isArray(t)||t.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=r,this.segments=[],typeof t[0][0]!="number"||typeof t[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const o=qt.round(t[0][0],t[0][1]);this.bbox={ll:{x:o.x,y:o.y},ur:{x:o.x,y:o.y}};let n=o;for(let l=1,s=t.length;l<s;l++){if(typeof t[l][0]!="number"||typeof t[l][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let c=qt.round(t[l][0],t[l][1]);c.x===n.x&&c.y===n.y||(this.segments.push(bt.fromRing(n,c,this)),c.x<this.bbox.ll.x&&(this.bbox.ll.x=c.x),c.y<this.bbox.ll.y&&(this.bbox.ll.y=c.y),c.x>this.bbox.ur.x&&(this.bbox.ur.x=c.x),c.y>this.bbox.ur.y&&(this.bbox.ur.y=c.y),n=c)}(o.x!==n.x||o.y!==n.y)&&this.segments.push(bt.fromRing(n,o,this))}getSweepEvents(){const t=[];for(let e=0,r=this.segments.length;e<r;e++){const o=this.segments[e];t.push(o.leftSE),t.push(o.rightSE)}return t}}class Io{constructor(t,e){if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new pr(t[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let r=1,o=t.length;r<o;r++){const n=new pr(t[r],this,!1);n.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=n.bbox.ll.x),n.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=n.bbox.ll.y),n.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=n.bbox.ur.x),n.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=n.bbox.ur.y),this.interiorRings.push(n)}this.multiPoly=e}getSweepEvents(){const t=this.exteriorRing.getSweepEvents();for(let e=0,r=this.interiorRings.length;e<r;e++){const o=this.interiorRings[e].getSweepEvents();for(let n=0,l=o.length;n<l;n++)t.push(o[n])}return t}}class mr{constructor(t,e){if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof t[0][0][0]=="number"&&(t=[t])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let r=0,o=t.length;r<o;r++){const n=new Io(t[r],this);n.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=n.bbox.ll.x),n.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=n.bbox.ll.y),n.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=n.bbox.ur.x),n.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=n.bbox.ur.y),this.polys.push(n)}this.isSubject=e}getSweepEvents(){const t=[];for(let e=0,r=this.polys.length;e<r;e++){const o=this.polys[e].getSweepEvents();for(let n=0,l=o.length;n<l;n++)t.push(o[n])}return t}}class le{static factory(t){const e=[];for(let r=0,o=t.length;r<o;r++){const n=t[r];if(!n.isInResult()||n.ringOut)continue;let l=null,s=n.leftSE,c=n.rightSE;const a=[s],d=s.point,u=[];for(;l=s,s=c,a.push(s),s.point!==d;)for(;;){const f=s.getAvailableLinkedEvents();if(f.length===0){const x=a[0].point,g=a[a.length-1].point;throw new Error(`Unable to complete output ring starting at [${x.x}, ${x.y}]. Last matching segment found ends at [${g.x}, ${g.y}].`)}if(f.length===1){c=f[0].otherSE;break}let h=null;for(let x=0,g=u.length;x<g;x++)if(u[x].point===s.point){h=x;break}if(h!==null){const x=u.splice(h)[0],g=a.splice(x.index);g.unshift(g[0].otherSE),e.push(new le(g.reverse()));continue}u.push({index:a.length,point:s.point});const v=s.getLeftmostComparator(l);c=f.sort(v)[0].otherSE;break}e.push(new le(a))}return e}constructor(t){this.events=t;for(let e=0,r=t.length;e<r;e++)t[e].segment.ringOut=this;this.poly=null}getGeom(){let t=this.events[0].point;const e=[t];for(let a=1,d=this.events.length-1;a<d;a++){const u=this.events[a].point,f=this.events[a+1].point;dr(u,t,f)!==0&&(e.push(u),t=u)}if(e.length===1)return null;const r=e[0],o=e[1];dr(r,t,o)===0&&e.shift(),e.push(e[0]);const n=this.isExteriorRing()?1:-1,l=this.isExteriorRing()?0:e.length-1,s=this.isExteriorRing()?e.length:-1,c=[];for(let a=l;a!=s;a+=n)c.push([e[a].x,e[a].y]);return c}isExteriorRing(){if(this._isExteriorRing===void 0){const t=this.enclosingRing();this._isExteriorRing=t?!t.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let t=this.events[0];for(let o=1,n=this.events.length;o<n;o++){const l=this.events[o];ot.compare(t,l)>0&&(t=l)}let e=t.segment.prevInResult(),r=e?e.prevInResult():null;for(;;){if(!e)return null;if(!r)return e.ringOut;if(r.ringOut!==e.ringOut)return r.ringOut.enclosingRing()!==e.ringOut?e.ringOut:e.ringOut.enclosingRing();e=r.prevInResult(),r=e?e.prevInResult():null}}}class gr{constructor(t){this.exteriorRing=t,t.poly=this,this.interiorRings=[]}addInterior(t){this.interiorRings.push(t),t.poly=this}getGeom(){const t=[this.exteriorRing.getGeom()];if(t[0]===null)return null;for(let e=0,r=this.interiorRings.length;e<r;e++){const o=this.interiorRings[e].getGeom();o!==null&&t.push(o)}return t}}class Wo{constructor(t){this.rings=t,this.polys=this._composePolys(t)}getGeom(){const t=[];for(let e=0,r=this.polys.length;e<r;e++){const o=this.polys[e].getGeom();o!==null&&t.push(o)}return t}_composePolys(t){const e=[];for(let r=0,o=t.length;r<o;r++){const n=t[r];if(!n.poly)if(n.isExteriorRing())e.push(new gr(n));else{const l=n.enclosingRing();l.poly||e.push(new gr(l)),l.poly.addInterior(n)}}return e}}class Oo{constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:bt.compare;this.queue=t,this.tree=new Re(e),this.segments=[]}process(t){const e=t.segment,r=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),r;const o=t.isLeft?this.tree.add(e):this.tree.find(e);if(!o)throw new Error(`Unable to find segment #${e.id} [${e.leftSE.point.x}, ${e.leftSE.point.y}] -> [${e.rightSE.point.x}, ${e.rightSE.point.y}] in SweepLine tree.`);let n=o,l=o,s,c;for(;s===void 0;)n=this.tree.prev(n),n===null?s=null:n.key.consumedBy===void 0&&(s=n.key);for(;c===void 0;)l=this.tree.next(l),l===null?c=null:l.key.consumedBy===void 0&&(c=l.key);if(t.isLeft){let a=null;if(s){const u=s.getIntersection(e);if(u!==null&&(e.isAnEndpoint(u)||(a=u),!s.isAnEndpoint(u))){const f=this._splitSafely(s,u);for(let h=0,v=f.length;h<v;h++)r.push(f[h])}}let d=null;if(c){const u=c.getIntersection(e);if(u!==null&&(e.isAnEndpoint(u)||(d=u),!c.isAnEndpoint(u))){const f=this._splitSafely(c,u);for(let h=0,v=f.length;h<v;h++)r.push(f[h])}}if(a!==null||d!==null){let u=null;a===null?u=d:d===null?u=a:u=ot.comparePoints(a,d)<=0?a:d,this.queue.remove(e.rightSE),r.push(e.rightSE);const f=e.split(u);for(let h=0,v=f.length;h<v;h++)r.push(f[h])}r.length>0?(this.tree.remove(e),r.push(t)):(this.segments.push(e),e.prev=s)}else{if(s&&c){const a=s.getIntersection(c);if(a!==null){if(!s.isAnEndpoint(a)){const d=this._splitSafely(s,a);for(let u=0,f=d.length;u<f;u++)r.push(d[u])}if(!c.isAnEndpoint(a)){const d=this._splitSafely(c,a);for(let u=0,f=d.length;u<f;u++)r.push(d[u])}}}this.tree.remove(e)}return r}_splitSafely(t,e){this.tree.remove(t);const r=t.rightSE;this.queue.remove(r);const o=t.split(e);return o.push(r),t.consumedBy===void 0&&this.tree.add(t),o}}const yr=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Ao=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class Bo{run(t,e,r){lt.type=t,qt.reset();const o=[new mr(e,!0)];for(let d=0,u=r.length;d<u;d++)o.push(new mr(r[d],!1));if(lt.numMultiPolys=o.length,lt.type==="difference"){const d=o[0];let u=1;for(;u<o.length;)Ce(o[u].bbox,d.bbox)!==null?u++:o.splice(u,1)}if(lt.type==="intersection")for(let d=0,u=o.length;d<u;d++){const f=o[d];for(let h=d+1,v=o.length;h<v;h++)if(Ce(f.bbox,o[h].bbox)===null)return[]}const n=new Re(ot.compare);for(let d=0,u=o.length;d<u;d++){const f=o[d].getSweepEvents();for(let h=0,v=f.length;h<v;h++)if(n.insert(f[h]),n.size>yr)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const l=new Oo(n);let s=n.size,c=n.pop();for(;c;){const d=c.key;if(n.size===s){const f=d.segment;throw new Error(`Unable to pop() ${d.isLeft?"left":"right"} SweepEvent [${d.point.x}, ${d.point.y}] from segment #${f.id} [${f.leftSE.point.x}, ${f.leftSE.point.y}] -> [${f.rightSE.point.x}, ${f.rightSE.point.y}] from queue.`)}if(n.size>yr)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(l.segments.length>Ao)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const u=l.process(d);for(let f=0,h=u.length;f<h;f++){const v=u[f];v.consumedBy===void 0&&n.insert(v)}s=n.size,c=n.pop()}qt.reset();const a=le.factory(l.segments);return new Wo(a).getGeom()}}const lt=new Bo,Uo=function(i){for(var t=arguments.length,e=new Array(t>1?t-1:0),r=1;r<t;r++)e[r-1]=arguments[r];return lt.run("union",i,e)},Fo=function(i){for(var t=arguments.length,e=new Array(t>1?t-1:0),r=1;r<t;r++)e[r-1]=arguments[r];return lt.run("intersection",i,e)},Do=function(i){for(var t=arguments.length,e=new Array(t>1?t-1:0),r=1;r<t;r++)e[r-1]=arguments[r];return lt.run("xor",i,e)},zo=function(i){for(var t=arguments.length,e=new Array(t>1?t-1:0),r=1;r<t;r++)e[r-1]=arguments[r];return lt.run("difference",i,e)};var Pr={union:Uo,intersection:Fo,xor:Do,difference:zo};function Rr(i,t,e){if(i!==null)for(var r,o,n,l,s,c,a,d=0,u=0,f,h=i.type,v=h==="FeatureCollection",x=h==="Feature",g=v?i.features.length:1,m=0;m<g;m++){a=v?i.features[m].geometry:x?i.geometry:i,f=a?a.type==="GeometryCollection":!1,s=f?a.geometries.length:1;for(var L=0;L<s;L++){var $=0,E=0;if(l=f?a.geometries[L]:a,l!==null){c=l.coordinates;var _=l.type;switch(d=0,_){case null:break;case"Point":if(t(c,u,m,$,E)===!1)return!1;u++,$++;break;case"LineString":case"MultiPoint":for(r=0;r<c.length;r++){if(t(c[r],u,m,$,E)===!1)return!1;u++,_==="MultiPoint"&&$++}_==="LineString"&&$++;break;case"Polygon":case"MultiLineString":for(r=0;r<c.length;r++){for(o=0;o<c[r].length-d;o++){if(t(c[r][o],u,m,$,E)===!1)return!1;u++}_==="MultiLineString"&&$++,_==="Polygon"&&E++}_==="Polygon"&&$++;break;case"MultiPolygon":for(r=0;r<c.length;r++){for(E=0,o=0;o<c[r].length;o++){for(n=0;n<c[r][o].length-d;n++){if(t(c[r][o][n],u,m,$,E)===!1)return!1;u++}E++}$++}break;case"GeometryCollection":for(r=0;r<l.geometries.length;r++)if(Rr(l.geometries[r],t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Ie(i,t){var e,r,o,n,l,s,c,a,d,u,f=0,h=i.type==="FeatureCollection",v=i.type==="Feature",x=h?i.features.length:1;for(e=0;e<x;e++){for(s=h?i.features[e].geometry:v?i.geometry:i,a=h?i.features[e].properties:v?i.properties:{},d=h?i.features[e].bbox:v?i.bbox:void 0,u=h?i.features[e].id:v?i.id:void 0,c=s?s.type==="GeometryCollection":!1,l=c?s.geometries.length:1,o=0;o<l;o++){if(n=c?s.geometries[o]:s,n===null){if(t(null,f,a,d,u)===!1)return!1;continue}switch(n.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(n,f,a,d,u)===!1)return!1;break}case"GeometryCollection":{for(r=0;r<n.geometries.length;r++)if(t(n.geometries[r],f,a,d,u)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}f++}}function Go(i,t){Ie(i,function(e,r,o,n,l){var s=e===null?null:e.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return t(jt(e,o,{bbox:n,id:l}),r,0)===!1?!1:void 0}var c;switch(s){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var a=0;a<e.coordinates.length;a++){var d=e.coordinates[a],u={type:c,coordinates:d};if(t(jt(u,o),r,a)===!1)return!1}})}function jo(i,t={}){const e=[];if(Ie(i,o=>{e.push(o.coordinates)}),e.length<2)throw new Error("Must have at least 2 geometries");const r=Pr.union(e[0],...e.slice(1));return r.length===0?null:r.length===1?Pe(r[0],t.properties):Cr(r,t.properties)}var Ir=jo;function Ho(i,t={}){if(i.bbox!=null&&t.recompute!==!0)return i.bbox;const e=[1/0,1/0,-1/0,-1/0];return Rr(i,r=>{e[0]>r[0]&&(e[0]=r[0]),e[1]>r[1]&&(e[1]=r[1]),e[2]<r[0]&&(e[2]=r[0]),e[3]<r[1]&&(e[3]=r[1])}),e}var vr=Ho;function qo(i){const t=[];if(Ie(i,o=>{t.push(o.coordinates)}),t.length<2)throw new Error("Must have at least two features");const e=i.features[0].properties||{},r=Pr.difference(t[0],...t.slice(1));return r.length===0?null:r.length===1?Pe(r[0],e):Cr(r,e)}var Zo=qo;function Qo(i){if(!i)throw new Error("geojson is required");var t=[];return Go(i,function(e){t.push(e)}),Ht(t)}var Vo=Qo;function br(i,t){const e=Zo(Ht([Pe([[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]),i]));if(!e)return;e.properties={isMask:!0};const r=ne(vr(i)),o=(r[2]-r[0])/360/1e3,n=r[0]<-180,l=r[2]>180,s=Vo(i);if(s.features.length>1&&(n||l))for(const c of s.features){const a=ne(vr(c));if(l&&a[0]<-180+o)for(const d of c.geometry.coordinates)for(const u of d)u[0]+=360-o;if(n&&a[2]>180-o)for(const d of c.geometry.coordinates)for(const u of d)u[0]-=360-o}t(Ht([s.features.length<2?i:Ir(s)??i,e]))}const xr=Ht([]);function Wr(i,t,e=!0,r=!0,o={},n={},l={fill:{paint:{"fill-color":"#000","fill-opacity":.1},filter:["all",["==",["geometry-type"],"Polygon"],["has","isMask"]]},line:{layout:{"line-cap":"square"},paint:{"line-width":["case",["==",["geometry-type"],"Polygon"],2,3],"line-dasharray":[1,1],"line-color":"#3170fe"},filter:["!",["has","isMask"]]}}){let s;const c=[];let a,d,u;function f(){!i.getSource("full-geom")&&(l!=null&&l.fill||l!=null&&l.line)&&i.addSource("full-geom",{type:"geojson",data:xr}),!i.getLayer("full-geom-fill")&&l!=null&&l.fill&&i.addLayer({...l==null?void 0:l.fill,id:"full-geom-fill",type:"fill",source:"full-geom"}),!i.getLayer("full-geom-line")&&l!=null&&l.line&&i.addLayer({...l==null?void 0:l.line,id:"full-geom-line",type:"line",source:"full-geom"}),u&&x(u)}i.loaded()?f():i.once("load",()=>{f()}),i.on("styledata",()=>{f()});const h=g=>{s==null||s({type:"mapClick",coordinates:[g.lngLat.lng,g.lngLat.lat]})};function v(g=!1){if(!t)throw new Error;const m=document.createElement("div");return g&&m.classList.add("marker-interactive"),new Gi({props:{displayIn:"maplibre"},target:m}),new t.Marker({element:m,offset:[1,-13]})}function x(g){var m;u=g,g&&((m=i.getSource("full-geom"))==null||m.setData(g))}return{setEventHandler(g){g?(s=g,i.on("click",h)):(s=void 0,i.off("click",h))},flyTo(g,m){i.flyTo({center:g,...m?{zoom:m}:{},...o})},fitBounds(g,m,L){i.fitBounds([[g[0],g[1]],[g[2],g[3]]],{padding:m,...L?{maxZoom:L}:{},...n})},indicateReverse(g){i.getCanvasContainer().style.cursor=g?"crosshair":""},setReverseMarker(g){!t||!e||(d?g?d.setLngLat(g):(d.remove(),d=void 0):g&&(d=(typeof e=="object"?new t.Marker(e):v()).setLngLat(g).addTo(i),d.getElement().classList.add("marker-reverse")))},setMarkers(g,m){if(e){for(const L of c)L.remove();if(c.length=0,x(xr),!!t){if(m){let L=!1;if(m.geometry.type==="GeometryCollection"){const $=m.geometry.geometries.filter(E=>E.type==="Polygon"||E.type==="MultiPolygon");t:if($.length>0){const E=Ir(Ht($.map(_=>jt(_))));if(!E)break t;br({...m,geometry:E.geometry},x),L=!0}else{const E=m.geometry.geometries.filter(_=>_.type==="LineString"||_.type==="MultiLineString");E.length>0&&(x({...m,geometry:{type:"GeometryCollection",geometries:E}}),L=!0)}}if(!L){if(m.geometry.type==="Polygon"||m.geometry.type==="MultiPolygon")br(m,x);else if(m.geometry.type==="LineString"||m.geometry.type==="MultiLineString"){x(m);return}}e&&c.push((typeof e=="object"?new t.Marker(e):v()).setLngLat(m.center).addTo(i))}if(r)for(const L of g??[]){if(L===m)continue;const $=(typeof r=="object"?new t.Marker(r):v(!0)).setLngLat(L.center).setPopup(new t.Popup({offset:[1,-27],closeButton:!1,closeOnMove:!0,className:"maptiler-gc-popup"}).setText(L.place_type[0]==="reverse"?L.place_name:L.place_name.replace(/,.*/,""))).addTo(i),E=$.getElement();E.addEventListener("click",_=>{_.stopPropagation(),s==null||s({type:"markerClick",id:L.id})}),E.addEventListener("mouseenter",()=>{s==null||s({type:"markerMouseEnter",id:L.id}),$.togglePopup()}),E.addEventListener("mouseleave",()=>{s==null||s({type:"markerMouseLeave",id:L.id}),$.togglePopup()}),c.push($)}}}},setSelectedMarker(g){a&&a.getElement().classList.toggle("marker-selected",!1),a=g>-1?c[g]:void 0,a==null||a.getElement().classList.toggle("marker-selected",!0)},getCenterAndZoom(){const g=i.getCenter();return[i.getZoom(),g.lng,g.lat]}}}var it,Wt;class Ko extends EventTarget{constructor(t={}){super(),Fe(this,it),Fe(this,Wt),be(this,Wt,t)}onAddInt(t){const e=document.createElement("div");e.className="mapboxgl-ctrl-geocoder mapboxgl-ctrl maplibregl-ctrl-geocoder maplibregl-ctrl mapboxgl-ctrl-group";const{marker:r,showResultMarkers:o,flyTo:n,fullGeometryStyle:l,...s}=st(this,Wt),c=typeof n=="boolean"?{}:n,a=this.getExtraProps(t,e),d={mapController:Wr(t,this.getMapLibreGl(),r,o,c,c,l),flyTo:n===void 0?!0:!!n,apiKey:"",...a,...s};if(!d.apiKey)throw new Error("no apiKey provided");be(this,it,new po({target:e,props:d}));for(const u of["select","pick","featuresListed","featuresMarked","response","optionsVisibilityChange","reverseToggle","queryChange"])st(this,it).$on(u,f=>this.dispatchEvent(f));return e}setOptions(t){var e;be(this,Wt,t);const{marker:r,showResultMarkers:o,flyTo:n,fullGeometryStyle:l,...s}=st(this,Wt);(e=st(this,it))==null||e.$set(s)}setQuery(t,e=!0){var r;(r=st(this,it))==null||r.setQuery(t,e)}clearMap(){var t;(t=st(this,it))==null||t.clearMap()}clearList(){var t;(t=st(this,it))==null||t.clearList()}setReverseMode(t){var e;(e=st(this,it))==null||e.$set({reverseActive:t})}focus(){var t;(t=st(this,it))==null||t.focus()}blur(){var t;(t=st(this,it))==null||t.blur()}onRemove(){var t;(t=st(this,it))==null||t.$destroy()}}it=new WeakMap,Wt=new WeakMap;class Yo extends Ko{getMapLibreGl(){return ii}onAdd(t){return super.onAddInt(t)}getExtraProps(){return{}}}exports.GeocodingControl=Yo;exports.createMapLibreGlMapController=Wr;
|
|
26
23
|
//# sourceMappingURL=index.cjs18.js.map
|