@motionscript/geography 0.0.0-stage → 0.1.0-alpha.10
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/CHANGELOG.md +151 -0
- package/CREDITS.md +8 -0
- package/LICENSE +201 -0
- package/NOTICE +49 -0
- package/README.md +148 -2
- package/data/v1/countries/AD.json +1 -0
- package/data/v1/countries/AE.json +1 -0
- package/data/v1/countries/AF.json +1 -0
- package/data/v1/countries/AG.json +1 -0
- package/data/v1/countries/AI.json +1 -0
- package/data/v1/countries/AL.json +1 -0
- package/data/v1/countries/AM.json +1 -0
- package/data/v1/countries/AO.json +1 -0
- package/data/v1/countries/AQ.json +1 -0
- package/data/v1/countries/AR.json +1 -0
- package/data/v1/countries/AS.json +1 -0
- package/data/v1/countries/AT.json +1 -0
- package/data/v1/countries/AU.json +1 -0
- package/data/v1/countries/AW.json +1 -0
- package/data/v1/countries/AX.json +1 -0
- package/data/v1/countries/AZ.json +1 -0
- package/data/v1/countries/BA.json +1 -0
- package/data/v1/countries/BB.json +1 -0
- package/data/v1/countries/BD.json +1 -0
- package/data/v1/countries/BE.json +1 -0
- package/data/v1/countries/BF.json +1 -0
- package/data/v1/countries/BG.json +1 -0
- package/data/v1/countries/BH.json +1 -0
- package/data/v1/countries/BI.json +1 -0
- package/data/v1/countries/BJ.json +1 -0
- package/data/v1/countries/BL.json +1 -0
- package/data/v1/countries/BM.json +1 -0
- package/data/v1/countries/BN.json +1 -0
- package/data/v1/countries/BO.json +1 -0
- package/data/v1/countries/BQ.json +1 -0
- package/data/v1/countries/BR.json +1 -0
- package/data/v1/countries/BS.json +1 -0
- package/data/v1/countries/BT.json +1 -0
- package/data/v1/countries/BV.json +1 -0
- package/data/v1/countries/BW.json +1 -0
- package/data/v1/countries/BY.json +1 -0
- package/data/v1/countries/BZ.json +1 -0
- package/data/v1/countries/CA.json +1 -0
- package/data/v1/countries/CC.json +1 -0
- package/data/v1/countries/CD.json +1 -0
- package/data/v1/countries/CF.json +1 -0
- package/data/v1/countries/CG.json +1 -0
- package/data/v1/countries/CH.json +1 -0
- package/data/v1/countries/CI.json +1 -0
- package/data/v1/countries/CK.json +1 -0
- package/data/v1/countries/CL.json +1 -0
- package/data/v1/countries/CM.json +1 -0
- package/data/v1/countries/CN.json +1 -0
- package/data/v1/countries/CO.json +1 -0
- package/data/v1/countries/CR.json +1 -0
- package/data/v1/countries/CU.json +1 -0
- package/data/v1/countries/CV.json +1 -0
- package/data/v1/countries/CW.json +1 -0
- package/data/v1/countries/CX.json +1 -0
- package/data/v1/countries/CY.json +1 -0
- package/data/v1/countries/CZ.json +1 -0
- package/data/v1/countries/DE.json +1 -0
- package/data/v1/countries/DJ.json +1 -0
- package/data/v1/countries/DK.json +1 -0
- package/data/v1/countries/DM.json +1 -0
- package/data/v1/countries/DO.json +1 -0
- package/data/v1/countries/DZ.json +1 -0
- package/data/v1/countries/EC.json +1 -0
- package/data/v1/countries/EE.json +1 -0
- package/data/v1/countries/EG.json +1 -0
- package/data/v1/countries/EH.json +1 -0
- package/data/v1/countries/ER.json +1 -0
- package/data/v1/countries/ES.json +1 -0
- package/data/v1/countries/ET.json +1 -0
- package/data/v1/countries/FI.json +1 -0
- package/data/v1/countries/FJ.json +1 -0
- package/data/v1/countries/FK.json +1 -0
- package/data/v1/countries/FM.json +1 -0
- package/data/v1/countries/FO.json +1 -0
- package/data/v1/countries/FR.json +1 -0
- package/data/v1/countries/GA.json +1 -0
- package/data/v1/countries/GB.json +1 -0
- package/data/v1/countries/GD.json +1 -0
- package/data/v1/countries/GE.json +1 -0
- package/data/v1/countries/GF.json +1 -0
- package/data/v1/countries/GG.json +1 -0
- package/data/v1/countries/GH.json +1 -0
- package/data/v1/countries/GI.json +1 -0
- package/data/v1/countries/GL.json +1 -0
- package/data/v1/countries/GM.json +1 -0
- package/data/v1/countries/GN.json +1 -0
- package/data/v1/countries/GP.json +1 -0
- package/data/v1/countries/GQ.json +1 -0
- package/data/v1/countries/GR.json +1 -0
- package/data/v1/countries/GS.json +1 -0
- package/data/v1/countries/GT.json +1 -0
- package/data/v1/countries/GU.json +1 -0
- package/data/v1/countries/GW.json +1 -0
- package/data/v1/countries/GY.json +1 -0
- package/data/v1/countries/HK.json +1 -0
- package/data/v1/countries/HM.json +1 -0
- package/data/v1/countries/HN.json +1 -0
- package/data/v1/countries/HR.json +1 -0
- package/data/v1/countries/HT.json +1 -0
- package/data/v1/countries/HU.json +1 -0
- package/data/v1/countries/ID.json +1 -0
- package/data/v1/countries/IE.json +1 -0
- package/data/v1/countries/IL.json +1 -0
- package/data/v1/countries/IM.json +1 -0
- package/data/v1/countries/IN.json +1 -0
- package/data/v1/countries/IO.json +1 -0
- package/data/v1/countries/IQ.json +1 -0
- package/data/v1/countries/IR.json +1 -0
- package/data/v1/countries/IS.json +1 -0
- package/data/v1/countries/IT.json +1 -0
- package/data/v1/countries/JE.json +1 -0
- package/data/v1/countries/JM.json +1 -0
- package/data/v1/countries/JO.json +1 -0
- package/data/v1/countries/JP.json +1 -0
- package/data/v1/countries/KE.json +1 -0
- package/data/v1/countries/KG.json +1 -0
- package/data/v1/countries/KH.json +1 -0
- package/data/v1/countries/KI.json +1 -0
- package/data/v1/countries/KM.json +1 -0
- package/data/v1/countries/KN.json +1 -0
- package/data/v1/countries/KP.json +1 -0
- package/data/v1/countries/KR.json +1 -0
- package/data/v1/countries/KW.json +1 -0
- package/data/v1/countries/KY.json +1 -0
- package/data/v1/countries/KZ.json +1 -0
- package/data/v1/countries/LA.json +1 -0
- package/data/v1/countries/LB.json +1 -0
- package/data/v1/countries/LC.json +1 -0
- package/data/v1/countries/LI.json +1 -0
- package/data/v1/countries/LK.json +1 -0
- package/data/v1/countries/LR.json +1 -0
- package/data/v1/countries/LS.json +1 -0
- package/data/v1/countries/LT.json +1 -0
- package/data/v1/countries/LU.json +1 -0
- package/data/v1/countries/LV.json +1 -0
- package/data/v1/countries/LY.json +1 -0
- package/data/v1/countries/MA.json +1 -0
- package/data/v1/countries/MC.json +1 -0
- package/data/v1/countries/MD.json +1 -0
- package/data/v1/countries/ME.json +1 -0
- package/data/v1/countries/MF.json +1 -0
- package/data/v1/countries/MG.json +1 -0
- package/data/v1/countries/MH.json +1 -0
- package/data/v1/countries/MK.json +1 -0
- package/data/v1/countries/ML.json +1 -0
- package/data/v1/countries/MM.json +1 -0
- package/data/v1/countries/MN.json +1 -0
- package/data/v1/countries/MO.json +1 -0
- package/data/v1/countries/MP.json +1 -0
- package/data/v1/countries/MQ.json +1 -0
- package/data/v1/countries/MR.json +1 -0
- package/data/v1/countries/MS.json +1 -0
- package/data/v1/countries/MT.json +1 -0
- package/data/v1/countries/MU.json +1 -0
- package/data/v1/countries/MV.json +1 -0
- package/data/v1/countries/MW.json +1 -0
- package/data/v1/countries/MX.json +1 -0
- package/data/v1/countries/MY.json +1 -0
- package/data/v1/countries/MZ.json +1 -0
- package/data/v1/countries/NA.json +1 -0
- package/data/v1/countries/NC.json +1 -0
- package/data/v1/countries/NE.json +1 -0
- package/data/v1/countries/NF.json +1 -0
- package/data/v1/countries/NG.json +1 -0
- package/data/v1/countries/NI.json +1 -0
- package/data/v1/countries/NL.json +1 -0
- package/data/v1/countries/NO.json +1 -0
- package/data/v1/countries/NP.json +1 -0
- package/data/v1/countries/NR.json +1 -0
- package/data/v1/countries/NU.json +1 -0
- package/data/v1/countries/NZ.json +1 -0
- package/data/v1/countries/OM.json +1 -0
- package/data/v1/countries/PA.json +1 -0
- package/data/v1/countries/PE.json +1 -0
- package/data/v1/countries/PF.json +1 -0
- package/data/v1/countries/PG.json +1 -0
- package/data/v1/countries/PH.json +1 -0
- package/data/v1/countries/PK.json +1 -0
- package/data/v1/countries/PL.json +1 -0
- package/data/v1/countries/PM.json +1 -0
- package/data/v1/countries/PN.json +1 -0
- package/data/v1/countries/PR.json +1 -0
- package/data/v1/countries/PS.json +1 -0
- package/data/v1/countries/PT.json +1 -0
- package/data/v1/countries/PW.json +1 -0
- package/data/v1/countries/PY.json +1 -0
- package/data/v1/countries/QA.json +1 -0
- package/data/v1/countries/RE.json +1 -0
- package/data/v1/countries/RO.json +1 -0
- package/data/v1/countries/RS.json +1 -0
- package/data/v1/countries/RU.json +1 -0
- package/data/v1/countries/RW.json +1 -0
- package/data/v1/countries/SA.json +1 -0
- package/data/v1/countries/SB.json +1 -0
- package/data/v1/countries/SC.json +1 -0
- package/data/v1/countries/SD.json +1 -0
- package/data/v1/countries/SE.json +1 -0
- package/data/v1/countries/SG.json +1 -0
- package/data/v1/countries/SH.json +1 -0
- package/data/v1/countries/SI.json +1 -0
- package/data/v1/countries/SJ.json +1 -0
- package/data/v1/countries/SK.json +1 -0
- package/data/v1/countries/SL.json +1 -0
- package/data/v1/countries/SM.json +1 -0
- package/data/v1/countries/SN.json +1 -0
- package/data/v1/countries/SO.json +1 -0
- package/data/v1/countries/SR.json +1 -0
- package/data/v1/countries/SS.json +1 -0
- package/data/v1/countries/ST.json +1 -0
- package/data/v1/countries/SV.json +1 -0
- package/data/v1/countries/SX.json +1 -0
- package/data/v1/countries/SY.json +1 -0
- package/data/v1/countries/SZ.json +1 -0
- package/data/v1/countries/TC.json +1 -0
- package/data/v1/countries/TD.json +1 -0
- package/data/v1/countries/TF.json +1 -0
- package/data/v1/countries/TG.json +1 -0
- package/data/v1/countries/TH.json +1 -0
- package/data/v1/countries/TJ.json +1 -0
- package/data/v1/countries/TK.json +1 -0
- package/data/v1/countries/TL.json +1 -0
- package/data/v1/countries/TM.json +1 -0
- package/data/v1/countries/TN.json +1 -0
- package/data/v1/countries/TO.json +1 -0
- package/data/v1/countries/TR.json +1 -0
- package/data/v1/countries/TT.json +1 -0
- package/data/v1/countries/TV.json +1 -0
- package/data/v1/countries/TW.json +1 -0
- package/data/v1/countries/TZ.json +1 -0
- package/data/v1/countries/UA.json +1 -0
- package/data/v1/countries/UG.json +1 -0
- package/data/v1/countries/UM.json +1 -0
- package/data/v1/countries/US.json +1 -0
- package/data/v1/countries/UY.json +1 -0
- package/data/v1/countries/UZ.json +1 -0
- package/data/v1/countries/VA.json +1 -0
- package/data/v1/countries/VC.json +1 -0
- package/data/v1/countries/VE.json +1 -0
- package/data/v1/countries/VG.json +1 -0
- package/data/v1/countries/VI.json +1 -0
- package/data/v1/countries/VN.json +1 -0
- package/data/v1/countries/VU.json +1 -0
- package/data/v1/countries/WF.json +1 -0
- package/data/v1/countries/WS.json +1 -0
- package/data/v1/countries/XK.json +1 -0
- package/data/v1/countries/XN.json +1 -0
- package/data/v1/countries/XS.json +1 -0
- package/data/v1/countries/YE.json +1 -0
- package/data/v1/countries/YT.json +1 -0
- package/data/v1/countries/ZA.json +1 -0
- package/data/v1/countries/ZM.json +1 -0
- package/data/v1/countries/ZW.json +1 -0
- package/data/v1/index.json +1 -0
- package/data/v1/states/AD.json +1 -0
- package/data/v1/states/AE.json +1 -0
- package/data/v1/states/AF.json +1 -0
- package/data/v1/states/AG.json +1 -0
- package/data/v1/states/AI.json +1 -0
- package/data/v1/states/AL.json +1 -0
- package/data/v1/states/AM.json +1 -0
- package/data/v1/states/AO.json +1 -0
- package/data/v1/states/AQ.json +1 -0
- package/data/v1/states/AR.json +1 -0
- package/data/v1/states/AS.json +1 -0
- package/data/v1/states/AT.json +1 -0
- package/data/v1/states/AU.json +1 -0
- package/data/v1/states/AW.json +1 -0
- package/data/v1/states/AX.json +1 -0
- package/data/v1/states/AZ.json +1 -0
- package/data/v1/states/BA.json +1 -0
- package/data/v1/states/BB.json +1 -0
- package/data/v1/states/BD.json +1 -0
- package/data/v1/states/BE.json +1 -0
- package/data/v1/states/BF.json +1 -0
- package/data/v1/states/BG.json +1 -0
- package/data/v1/states/BH.json +1 -0
- package/data/v1/states/BI.json +1 -0
- package/data/v1/states/BJ.json +1 -0
- package/data/v1/states/BL.json +1 -0
- package/data/v1/states/BM.json +1 -0
- package/data/v1/states/BN.json +1 -0
- package/data/v1/states/BO.json +1 -0
- package/data/v1/states/BR.json +1 -0
- package/data/v1/states/BS.json +1 -0
- package/data/v1/states/BT.json +1 -0
- package/data/v1/states/BW.json +1 -0
- package/data/v1/states/BY.json +1 -0
- package/data/v1/states/BZ.json +1 -0
- package/data/v1/states/CA.json +1 -0
- package/data/v1/states/CD.json +1 -0
- package/data/v1/states/CF.json +1 -0
- package/data/v1/states/CG.json +1 -0
- package/data/v1/states/CH.json +1 -0
- package/data/v1/states/CI.json +1 -0
- package/data/v1/states/CK.json +1 -0
- package/data/v1/states/CL.json +1 -0
- package/data/v1/states/CM.json +1 -0
- package/data/v1/states/CN.json +1 -0
- package/data/v1/states/CO.json +1 -0
- package/data/v1/states/CR.json +1 -0
- package/data/v1/states/CU.json +1 -0
- package/data/v1/states/CV.json +1 -0
- package/data/v1/states/CW.json +1 -0
- package/data/v1/states/CY.json +1 -0
- package/data/v1/states/CZ.json +1 -0
- package/data/v1/states/DE.json +1 -0
- package/data/v1/states/DJ.json +1 -0
- package/data/v1/states/DK.json +1 -0
- package/data/v1/states/DM.json +1 -0
- package/data/v1/states/DO.json +1 -0
- package/data/v1/states/DZ.json +1 -0
- package/data/v1/states/EC.json +1 -0
- package/data/v1/states/EE.json +1 -0
- package/data/v1/states/EG.json +1 -0
- package/data/v1/states/EH.json +1 -0
- package/data/v1/states/ER.json +1 -0
- package/data/v1/states/ES.json +1 -0
- package/data/v1/states/ET.json +1 -0
- package/data/v1/states/FI.json +1 -0
- package/data/v1/states/FJ.json +1 -0
- package/data/v1/states/FK.json +1 -0
- package/data/v1/states/FM.json +1 -0
- package/data/v1/states/FO.json +1 -0
- package/data/v1/states/FR.json +1 -0
- package/data/v1/states/GA.json +1 -0
- package/data/v1/states/GB.json +1 -0
- package/data/v1/states/GD.json +1 -0
- package/data/v1/states/GE.json +1 -0
- package/data/v1/states/GG.json +1 -0
- package/data/v1/states/GH.json +1 -0
- package/data/v1/states/GI.json +1 -0
- package/data/v1/states/GL.json +1 -0
- package/data/v1/states/GM.json +1 -0
- package/data/v1/states/GN.json +1 -0
- package/data/v1/states/GQ.json +1 -0
- package/data/v1/states/GR.json +1 -0
- package/data/v1/states/GS.json +1 -0
- package/data/v1/states/GT.json +1 -0
- package/data/v1/states/GU.json +1 -0
- package/data/v1/states/GW.json +1 -0
- package/data/v1/states/GY.json +1 -0
- package/data/v1/states/HK.json +1 -0
- package/data/v1/states/HM.json +1 -0
- package/data/v1/states/HN.json +1 -0
- package/data/v1/states/HR.json +1 -0
- package/data/v1/states/HT.json +1 -0
- package/data/v1/states/HU.json +1 -0
- package/data/v1/states/ID.json +1 -0
- package/data/v1/states/IE.json +1 -0
- package/data/v1/states/IL.json +1 -0
- package/data/v1/states/IM.json +1 -0
- package/data/v1/states/IN.json +1 -0
- package/data/v1/states/IO.json +1 -0
- package/data/v1/states/IQ.json +1 -0
- package/data/v1/states/IR.json +1 -0
- package/data/v1/states/IS.json +1 -0
- package/data/v1/states/IT.json +1 -0
- package/data/v1/states/JE.json +1 -0
- package/data/v1/states/JM.json +1 -0
- package/data/v1/states/JO.json +1 -0
- package/data/v1/states/JP.json +1 -0
- package/data/v1/states/KE.json +1 -0
- package/data/v1/states/KG.json +1 -0
- package/data/v1/states/KH.json +1 -0
- package/data/v1/states/KI.json +1 -0
- package/data/v1/states/KM.json +1 -0
- package/data/v1/states/KN.json +1 -0
- package/data/v1/states/KP.json +1 -0
- package/data/v1/states/KR.json +1 -0
- package/data/v1/states/KW.json +1 -0
- package/data/v1/states/KY.json +1 -0
- package/data/v1/states/KZ.json +1 -0
- package/data/v1/states/LA.json +1 -0
- package/data/v1/states/LB.json +1 -0
- package/data/v1/states/LC.json +1 -0
- package/data/v1/states/LI.json +1 -0
- package/data/v1/states/LK.json +1 -0
- package/data/v1/states/LR.json +1 -0
- package/data/v1/states/LS.json +1 -0
- package/data/v1/states/LT.json +1 -0
- package/data/v1/states/LU.json +1 -0
- package/data/v1/states/LV.json +1 -0
- package/data/v1/states/LY.json +1 -0
- package/data/v1/states/MA.json +1 -0
- package/data/v1/states/MC.json +1 -0
- package/data/v1/states/MD.json +1 -0
- package/data/v1/states/ME.json +1 -0
- package/data/v1/states/MF.json +1 -0
- package/data/v1/states/MG.json +1 -0
- package/data/v1/states/MH.json +1 -0
- package/data/v1/states/MK.json +1 -0
- package/data/v1/states/ML.json +1 -0
- package/data/v1/states/MM.json +1 -0
- package/data/v1/states/MN.json +1 -0
- package/data/v1/states/MO.json +1 -0
- package/data/v1/states/MP.json +1 -0
- package/data/v1/states/MR.json +1 -0
- package/data/v1/states/MS.json +1 -0
- package/data/v1/states/MT.json +1 -0
- package/data/v1/states/MU.json +1 -0
- package/data/v1/states/MV.json +1 -0
- package/data/v1/states/MW.json +1 -0
- package/data/v1/states/MX.json +1 -0
- package/data/v1/states/MY.json +1 -0
- package/data/v1/states/MZ.json +1 -0
- package/data/v1/states/NA.json +1 -0
- package/data/v1/states/NC.json +1 -0
- package/data/v1/states/NE.json +1 -0
- package/data/v1/states/NF.json +1 -0
- package/data/v1/states/NG.json +1 -0
- package/data/v1/states/NI.json +1 -0
- package/data/v1/states/NL.json +1 -0
- package/data/v1/states/NO.json +1 -0
- package/data/v1/states/NP.json +1 -0
- package/data/v1/states/NR.json +1 -0
- package/data/v1/states/NU.json +1 -0
- package/data/v1/states/NZ.json +1 -0
- package/data/v1/states/OM.json +1 -0
- package/data/v1/states/PA.json +1 -0
- package/data/v1/states/PE.json +1 -0
- package/data/v1/states/PF.json +1 -0
- package/data/v1/states/PG.json +1 -0
- package/data/v1/states/PH.json +1 -0
- package/data/v1/states/PK.json +1 -0
- package/data/v1/states/PL.json +1 -0
- package/data/v1/states/PM.json +1 -0
- package/data/v1/states/PN.json +1 -0
- package/data/v1/states/PS.json +1 -0
- package/data/v1/states/PT.json +1 -0
- package/data/v1/states/PW.json +1 -0
- package/data/v1/states/PY.json +1 -0
- package/data/v1/states/QA.json +1 -0
- package/data/v1/states/RO.json +1 -0
- package/data/v1/states/RS.json +1 -0
- package/data/v1/states/RU.json +1 -0
- package/data/v1/states/RW.json +1 -0
- package/data/v1/states/SA.json +1 -0
- package/data/v1/states/SB.json +1 -0
- package/data/v1/states/SC.json +1 -0
- package/data/v1/states/SD.json +1 -0
- package/data/v1/states/SE.json +1 -0
- package/data/v1/states/SG.json +1 -0
- package/data/v1/states/SH.json +1 -0
- package/data/v1/states/SI.json +1 -0
- package/data/v1/states/SK.json +1 -0
- package/data/v1/states/SL.json +1 -0
- package/data/v1/states/SM.json +1 -0
- package/data/v1/states/SN.json +1 -0
- package/data/v1/states/SO.json +1 -0
- package/data/v1/states/SR.json +1 -0
- package/data/v1/states/SS.json +1 -0
- package/data/v1/states/ST.json +1 -0
- package/data/v1/states/SV.json +1 -0
- package/data/v1/states/SY.json +1 -0
- package/data/v1/states/SZ.json +1 -0
- package/data/v1/states/TC.json +1 -0
- package/data/v1/states/TD.json +1 -0
- package/data/v1/states/TF.json +1 -0
- package/data/v1/states/TG.json +1 -0
- package/data/v1/states/TH.json +1 -0
- package/data/v1/states/TJ.json +1 -0
- package/data/v1/states/TK.json +1 -0
- package/data/v1/states/TL.json +1 -0
- package/data/v1/states/TM.json +1 -0
- package/data/v1/states/TN.json +1 -0
- package/data/v1/states/TO.json +1 -0
- package/data/v1/states/TR.json +1 -0
- package/data/v1/states/TT.json +1 -0
- package/data/v1/states/TV.json +1 -0
- package/data/v1/states/TW.json +1 -0
- package/data/v1/states/TZ.json +1 -0
- package/data/v1/states/UA.json +1 -0
- package/data/v1/states/UG.json +1 -0
- package/data/v1/states/UM.json +1 -0
- package/data/v1/states/US.json +1 -0
- package/data/v1/states/UY.json +1 -0
- package/data/v1/states/UZ.json +1 -0
- package/data/v1/states/VA.json +1 -0
- package/data/v1/states/VC.json +1 -0
- package/data/v1/states/VE.json +1 -0
- package/data/v1/states/VG.json +1 -0
- package/data/v1/states/VI.json +1 -0
- package/data/v1/states/VN.json +1 -0
- package/data/v1/states/VU.json +1 -0
- package/data/v1/states/WF.json +1 -0
- package/data/v1/states/WS.json +1 -0
- package/data/v1/states/XK.json +1 -0
- package/data/v1/states/XN.json +1 -0
- package/data/v1/states/XS.json +1 -0
- package/data/v1/states/YE.json +1 -0
- package/data/v1/states/ZA.json +1 -0
- package/data/v1/states/ZM.json +1 -0
- package/data/v1/states/ZW.json +1 -0
- package/dist/border/format.d.ts +73 -0
- package/dist/border/format.d.ts.map +1 -0
- package/dist/border/format.js +68 -0
- package/dist/border/format.js.map +1 -0
- package/dist/border/geo-border.d.ts +103 -0
- package/dist/border/geo-border.d.ts.map +1 -0
- package/dist/border/geo-border.js +203 -0
- package/dist/border/geo-border.js.map +1 -0
- package/dist/border/geometry.d.ts +40 -0
- package/dist/border/geometry.d.ts.map +1 -0
- package/dist/border/geometry.js +382 -0
- package/dist/border/geometry.js.map +1 -0
- package/dist/border/index.d.ts +15 -0
- package/dist/border/index.d.ts.map +1 -0
- package/dist/border/index.js +15 -0
- package/dist/border/index.js.map +1 -0
- package/dist/border/loader.d.ts +31 -0
- package/dist/border/loader.d.ts.map +1 -0
- package/dist/border/loader.js +87 -0
- package/dist/border/loader.js.map +1 -0
- package/dist/border/registry.d.ts +64 -0
- package/dist/border/registry.d.ts.map +1 -0
- package/dist/border/registry.js +163 -0
- package/dist/border/registry.js.map +1 -0
- package/dist/border/selection.d.ts +21 -0
- package/dist/border/selection.d.ts.map +1 -0
- package/dist/border/selection.js +86 -0
- package/dist/border/selection.js.map +1 -0
- package/dist/border/simplify.d.ts +12 -0
- package/dist/border/simplify.d.ts.map +1 -0
- package/dist/border/simplify.js +116 -0
- package/dist/border/simplify.js.map +1 -0
- package/dist/browser/THIRD_PARTY_LICENSES.txt +58 -0
- package/dist/browser/index.js +2 -0
- package/dist/browser/index.js.map +7 -0
- package/dist/browser/manifest.json +23 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/nodes.d.ts +15 -0
- package/dist/nodes.d.ts.map +1 -0
- package/dist/nodes.js +16 -0
- package/dist/nodes.js.map +1 -0
- package/package.json +83 -3
- package/registry.json +16 -0
- package/src/border/format.ts +147 -0
- package/src/border/geo-border.ts +268 -0
- package/src/border/geometry.ts +463 -0
- package/src/border/index.ts +14 -0
- package/src/border/loader.ts +97 -0
- package/src/border/registry.ts +201 -0
- package/src/border/selection.ts +95 -0
- package/src/border/simplify.ts +110 -0
- package/src/index.ts +2 -0
- package/src/nodes.ts +16 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selection.js","sourceRoot":"","sources":["../../src/border/selection.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAKxC,MAAM,IAAI,GAAG,6BAA6B,CAAA;AAE1C,sFAAsF;AACtF,MAAM,UAAU,YAAY,CAAC,KAAc;IACvC,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;IAClG,MAAM,GAAG,GAAa,EAAE,CAAA;IACxB,KAAK,MAAM,IAAI,IAAI,GAAG,EAAE,CAAC;QACrB,IAAI,OAAO,IAAI,KAAK,QAAQ;YAAE,SAAQ;QACtC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAA;QACtC,IAAI,IAAI,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC;YAAE,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACnD,CAAC;IACD,OAAO,GAAG,CAAA;AACd,CAAC;AAED,SAAS,aAAa,CAAC,IAAY;IAC/B,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AAC7B,CAAC;AAED,oGAAoG;AACpG,MAAM,UAAU,WAAW,CAAC,KAA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YAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;aACzC,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAE,CAAC,CAAA;;YACxC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC3B,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,CAAA;AACzC,CAAC","sourcesContent":["import type { GeoFeature } from \"./format\"\nimport { countryFileKey, geoFileEntry, statesFileKey } from \"./loader\"\nimport { geoRegistry } from \"./registry\"\n\nexport type GeoLevel = \"country\" | \"state\"\nexport type GeoFrame = \"mainland\" | \"all\"\n\nconst CODE = /^[A-Z]{2}(-[A-Z0-9]{1,3})?$/\n\n/** `\"fr, de\"`, `[\"FR\", \"de\"]` → `[\"FR\", \"DE\"]`; unique, in order, empties dropped. */\nexport function normalizeIso(value: unknown): string[] {\n const raw = Array.isArray(value) ? value : typeof value === \"string\" ? value.split(/[\\s,;]+/) : []\n const out: string[] = []\n for (const item of raw) {\n if (typeof item !== \"string\") continue\n const code = item.trim().toUpperCase()\n if (code && !out.includes(code)) out.push(code)\n }\n return out\n}\n\nfunction isSubdivision(code: string): boolean {\n return code.includes(\"-\")\n}\n\n/** Every data file a selection reads, for `declareAssets`. Depends on nothing but its arguments. */\nexport function geoFilesFor(codes: readonly string[], level: GeoLevel): string[] {\n const files = new Set<string>()\n for (const code of codes) {\n if (!CODE.test(code) || geoRegistry.defined(code)) continue\n if (isSubdivision(code)) files.add(statesFileKey(code.slice(0, 2)))\n else files.add(level === \"state\" ? statesFileKey(code) : countryFileKey(code))\n }\n return [...files]\n}\n\nexport interface GeoSelection {\n features: GeoFeature[]\n /** A file this selection needs has not landed yet. */\n pending: boolean\n /** Codes whose file loaded without them. */\n unknown: string[]\n}\n\n/**\n * The features a selection draws. A bare country code at state level is its\n * first-level subdivisions — minus the remote ones when framing the mainland —\n * or the country itself when it has none.\n */\nexport function selectGeoFeatures(codes: readonly string[], level: GeoLevel, frame: GeoFrame): GeoSelection {\n const features: GeoFeature[] = []\n const seen = new Set<string>()\n const unknown: string[] = []\n let pending = false\n\n const add = (feature: GeoFeature) => {\n if (seen.has(feature.code)) return\n seen.add(feature.code)\n features.push(feature)\n }\n\n for (const code of codes) {\n const defined = geoRegistry.defined(code)\n if (defined) {\n add(defined)\n continue\n }\n if (!CODE.test(code)) {\n unknown.push(code)\n continue\n }\n const subdivision = isSubdivision(code)\n const key = subdivision || level === \"state\" ? statesFileKey(code.slice(0, 2)) : countryFileKey(code)\n const entry = geoFileEntry(key)\n if (!entry || entry.status !== \"ready\") {\n if (!entry) pending = true\n continue\n }\n const file = entry.file.features\n if (subdivision || level === \"country\") {\n const feature = file.get(code)\n if (feature) add(feature)\n else unknown.push(code)\n continue\n }\n const children = [...file.values()].filter(\n (f) => f.parent === code && f.first && !(frame === \"mainland\" && f.remote)\n )\n if (children.length > 0) children.forEach(add)\n else if (file.get(code)) add(file.get(code)!)\n else unknown.push(code)\n }\n\n return { features, pending, unknown }\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Visvalingam–Whyatt weights for a hand-defined ring, in the same buckets the
|
|
3
|
+
* generated data carries (`-2·log2` of the effective area in steradians), so a
|
|
4
|
+
* shape passed to `geoRegistry.define` answers to `detail` like any other.
|
|
5
|
+
*
|
|
6
|
+
* Planar in degrees with longitude scaled by latitude: accurate enough for the
|
|
7
|
+
* handful of shapes an author defines, where the generated data uses the exact
|
|
8
|
+
* spherical area.
|
|
9
|
+
*/
|
|
10
|
+
export declare function ringBuckets(points: Float64Array): Uint8Array;
|
|
11
|
+
export declare function weightBucket(weight: number): number;
|
|
12
|
+
//# sourceMappingURL=simplify.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simplify.d.ts","sourceRoot":"","sources":["../../src/border/simplify.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,YAAY,GAAG,UAAU,CA8F5D;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAInD"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Visvalingam–Whyatt weights for a hand-defined ring, in the same buckets the
|
|
3
|
+
* generated data carries (`-2·log2` of the effective area in steradians), so a
|
|
4
|
+
* shape passed to `geoRegistry.define` answers to `detail` like any other.
|
|
5
|
+
*
|
|
6
|
+
* Planar in degrees with longitude scaled by latitude: accurate enough for the
|
|
7
|
+
* handful of shapes an author defines, where the generated data uses the exact
|
|
8
|
+
* spherical area.
|
|
9
|
+
*/
|
|
10
|
+
export function ringBuckets(points) {
|
|
11
|
+
const n = points.length / 2;
|
|
12
|
+
const buckets = new Uint8Array(n);
|
|
13
|
+
if (n < 3)
|
|
14
|
+
return buckets;
|
|
15
|
+
const radians = Math.PI / 180;
|
|
16
|
+
const weight = new Float64Array(n);
|
|
17
|
+
const prev = new Int32Array(n);
|
|
18
|
+
const next = new Int32Array(n);
|
|
19
|
+
for (let i = 0; i < n; i++) {
|
|
20
|
+
prev[i] = i - 1;
|
|
21
|
+
next[i] = i + 1;
|
|
22
|
+
}
|
|
23
|
+
const area = (a, b, c) => {
|
|
24
|
+
const cos = Math.cos(points[b * 2 + 1] * radians);
|
|
25
|
+
const ax = points[a * 2] * cos, ay = points[a * 2 + 1];
|
|
26
|
+
const bx = points[b * 2] * cos, by = points[b * 2 + 1];
|
|
27
|
+
const cx = points[c * 2] * cos, cy = points[c * 2 + 1];
|
|
28
|
+
return (Math.abs((bx - ax) * (cy - ay) - (cx - ax) * (by - ay)) / 2) * radians * radians;
|
|
29
|
+
};
|
|
30
|
+
const heap = [];
|
|
31
|
+
const position = new Int32Array(n).fill(-1);
|
|
32
|
+
const less = (i, j) => weight[heap[i]] < weight[heap[j]];
|
|
33
|
+
const swap = (i, j) => {
|
|
34
|
+
;
|
|
35
|
+
[heap[i], heap[j]] = [heap[j], heap[i]];
|
|
36
|
+
position[heap[i]] = i;
|
|
37
|
+
position[heap[j]] = j;
|
|
38
|
+
};
|
|
39
|
+
const up = (i) => {
|
|
40
|
+
while (i > 0) {
|
|
41
|
+
const parent = (i - 1) >> 1;
|
|
42
|
+
if (!less(i, parent))
|
|
43
|
+
break;
|
|
44
|
+
swap(i, parent);
|
|
45
|
+
i = parent;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
const down = (i) => {
|
|
49
|
+
for (;;) {
|
|
50
|
+
const l = 2 * i + 1;
|
|
51
|
+
const r = l + 1;
|
|
52
|
+
let smallest = i;
|
|
53
|
+
if (l < heap.length && less(l, smallest))
|
|
54
|
+
smallest = l;
|
|
55
|
+
if (r < heap.length && less(r, smallest))
|
|
56
|
+
smallest = r;
|
|
57
|
+
if (smallest === i)
|
|
58
|
+
return;
|
|
59
|
+
swap(i, smallest);
|
|
60
|
+
i = smallest;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
const push = (i) => {
|
|
64
|
+
position[i] = heap.length;
|
|
65
|
+
heap.push(i);
|
|
66
|
+
up(heap.length - 1);
|
|
67
|
+
};
|
|
68
|
+
const remove = (i) => {
|
|
69
|
+
const at = position[i];
|
|
70
|
+
const last = heap.pop();
|
|
71
|
+
position[i] = -1;
|
|
72
|
+
if (at < heap.length) {
|
|
73
|
+
heap[at] = last;
|
|
74
|
+
position[last] = at;
|
|
75
|
+
up(at);
|
|
76
|
+
down(position[last]);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
for (let i = 1; i < n - 1; i++) {
|
|
80
|
+
weight[i] = area(i - 1, i, i + 1);
|
|
81
|
+
push(i);
|
|
82
|
+
}
|
|
83
|
+
let floor = 0;
|
|
84
|
+
const final = new Float64Array(n);
|
|
85
|
+
final[0] = final[n - 1] = Infinity;
|
|
86
|
+
while (heap.length > 0) {
|
|
87
|
+
const i = heap[0];
|
|
88
|
+
remove(i);
|
|
89
|
+
floor = Math.max(floor, weight[i]);
|
|
90
|
+
final[i] = floor;
|
|
91
|
+
const p = prev[i];
|
|
92
|
+
const q = next[i];
|
|
93
|
+
if (p >= 0)
|
|
94
|
+
next[p] = q;
|
|
95
|
+
if (q < n)
|
|
96
|
+
prev[q] = p;
|
|
97
|
+
for (const j of [p, q]) {
|
|
98
|
+
if (j <= 0 || j >= n - 1 || position[j] < 0)
|
|
99
|
+
continue;
|
|
100
|
+
remove(j);
|
|
101
|
+
weight[j] = area(prev[j], j, next[j]);
|
|
102
|
+
push(j);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
for (let i = 0; i < n; i++)
|
|
106
|
+
buckets[i] = weightBucket(final[i]);
|
|
107
|
+
return buckets;
|
|
108
|
+
}
|
|
109
|
+
export function weightBucket(weight) {
|
|
110
|
+
if (weight === Infinity)
|
|
111
|
+
return 0;
|
|
112
|
+
if (!(weight > 0))
|
|
113
|
+
return 255;
|
|
114
|
+
return Math.min(254, Math.max(1, Math.round(-2 * Math.log2(weight))));
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=simplify.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simplify.js","sourceRoot":"","sources":["../../src/border/simplify.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,UAAU,WAAW,CAAC,MAAoB;IAC5C,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,CAAA;IAC3B,MAAM,OAAO,GAAG,IAAI,UAAU,CAAC,CAAC,CAAC,CAAA;IACjC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,OAAO,CAAA;IAEzB,MAAM,OAAO,GAAG,IAAI,CAAC,EAAE,GAAG,GAAG,CAAA;IAC7B,MAAM,MAAM,GAAG,IAAI,YAAY,CAAC,CAAC,CAAC,CAAA;IAClC,MAAM,IAAI,GAAG,IAAI,UAAU,CAAC,CAAC,CA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AG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE;QAAE,OAAO,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;IAC/D,OAAO,OAAO,CAAA;AAClB,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,MAAc;IACvC,IAAI,MAAM,KAAK,QAAQ;QAAE,OAAO,CAAC,CAAA;IACjC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;QAAE,OAAO,GAAG,CAAA;IAC7B,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;AACzE,CAAC","sourcesContent":["/**\n * Visvalingam–Whyatt weights for a hand-defined ring, in the same buckets the\n * generated data carries (`-2·log2` of the effective area in steradians), so a\n * shape passed to `geoRegistry.define` answers to `detail` like any other.\n *\n * Planar in degrees with longitude scaled by latitude: accurate enough for the\n * handful of shapes an author defines, where the generated data uses the exact\n * spherical area.\n */\nexport function ringBuckets(points: Float64Array): Uint8Array {\n const n = points.length / 2\n const buckets = new Uint8Array(n)\n if (n < 3) return buckets\n\n const radians = Math.PI / 180\n const weight = new Float64Array(n)\n const prev = new Int32Array(n)\n const next = new Int32Array(n)\n for (let i = 0; i < n; i++) {\n prev[i] = i - 1\n next[i] = i + 1\n }\n\n const area = (a: number, b: number, c: number): number => {\n const cos = Math.cos(points[b * 2 + 1] * radians)\n const ax = points[a * 2] * cos, ay = points[a * 2 + 1]\n const bx = points[b * 2] * cos, by = points[b * 2 + 1]\n const cx = points[c * 2] * cos, cy = points[c * 2 + 1]\n return (Math.abs((bx - ax) * (cy - ay) - (cx - ax) * (by - ay)) / 2) * radians * radians\n }\n\n const heap: number[] = []\n const position = new Int32Array(n).fill(-1)\n const less = (i: number, j: number) => weight[heap[i]] < weight[heap[j]]\n const swap = (i: number, j: number) => {\n ;[heap[i], heap[j]] = [heap[j], heap[i]]\n position[heap[i]] = i\n position[heap[j]] = j\n }\n const up = (i: number) => {\n while (i > 0) {\n const parent = (i - 1) >> 1\n if (!less(i, parent)) break\n swap(i, parent)\n i = parent\n }\n }\n const down = (i: number) => {\n for (;;) {\n const l = 2 * i + 1\n const r = l + 1\n let smallest = i\n if (l < heap.length && less(l, smallest)) smallest = l\n if (r < heap.length && less(r, smallest)) smallest = r\n if (smallest === i) return\n swap(i, smallest)\n i = smallest\n }\n }\n const push = (i: number) => {\n position[i] = heap.length\n heap.push(i)\n up(heap.length - 1)\n }\n const remove = (i: number) => {\n const at = position[i]\n const last = heap.pop()!\n position[i] = -1\n if (at < heap.length) {\n heap[at] = last\n position[last] = at\n up(at)\n down(position[last])\n }\n }\n\n for (let i = 1; i < n - 1; i++) {\n weight[i] = area(i - 1, i, i + 1)\n push(i)\n }\n\n let floor = 0\n const final = new Float64Array(n)\n final[0] = final[n - 1] = Infinity\n while (heap.length > 0) {\n const i = heap[0]\n remove(i)\n floor = Math.max(floor, weight[i])\n final[i] = floor\n const p = prev[i]\n const q = next[i]\n if (p >= 0) next[p] = q\n if (q < n) prev[q] = p\n for (const j of [p, q]) {\n if (j <= 0 || j >= n - 1 || position[j] < 0) continue\n remove(j)\n weight[j] = area(prev[j], j, next[j])\n push(j)\n }\n }\n\n for (let i = 0; i < n; i++) buckets[i] = weightBucket(final[i])\n return buckets\n}\n\nexport function weightBucket(weight: number): number {\n if (weight === Infinity) return 0\n if (!(weight > 0)) return 255\n return Math.min(254, Math.max(1, Math.round(-2 * Math.log2(weight))))\n}\n"]}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
Third-party software bundled into @motionscript/geography's browser build (dist/browser/).
|
|
2
|
+
|
|
3
|
+
d3-array 3.2.4
|
|
4
|
+
License: ISC
|
|
5
|
+
|
|
6
|
+
Copyright 2010-2023 Mike Bostock
|
|
7
|
+
|
|
8
|
+
Permission to use, copy, modify, and/or distribute this software for any purpose
|
|
9
|
+
with or without fee is hereby granted, provided that the above copyright notice
|
|
10
|
+
and this permission notice appear in all copies.
|
|
11
|
+
|
|
12
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
13
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
14
|
+
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
15
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
|
16
|
+
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
|
17
|
+
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
|
|
18
|
+
THIS SOFTWARE.
|
|
19
|
+
|
|
20
|
+
------------------------------------------------------------------------------
|
|
21
|
+
|
|
22
|
+
d3-geo 3.1.1
|
|
23
|
+
License: ISC
|
|
24
|
+
|
|
25
|
+
Copyright 2010-2024 Mike Bostock
|
|
26
|
+
|
|
27
|
+
Permission to use, copy, modify, and/or distribute this software for any purpose
|
|
28
|
+
with or without fee is hereby granted, provided that the above copyright notice
|
|
29
|
+
and this permission notice appear in all copies.
|
|
30
|
+
|
|
31
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
32
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
33
|
+
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
34
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
|
35
|
+
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
|
36
|
+
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
|
|
37
|
+
THIS SOFTWARE.
|
|
38
|
+
|
|
39
|
+
This license applies to GeographicLib, versions 1.12 and later.
|
|
40
|
+
|
|
41
|
+
Copyright 2008-2012 Charles Karney
|
|
42
|
+
|
|
43
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
44
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
45
|
+
the Software without restriction, including without limitation the rights to
|
|
46
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
47
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
48
|
+
subject to the following conditions:
|
|
49
|
+
|
|
50
|
+
The above copyright notice and this permission notice shall be included in all
|
|
51
|
+
copies or substantial portions of the Software.
|
|
52
|
+
|
|
53
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
54
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
55
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
56
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
57
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
58
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var U=class{constructor(){this._partials=new Float64Array(32),this._n=0}add(n){let e=this._partials,r=0;for(let o=0;o<this._n&&o<32;o++){let a=e[o],f=n+a,i=Math.abs(n)<Math.abs(a)?n-(f-a):a-(f-n);i&&(e[r++]=i),n=f}return e[r]=n,this._n=r+1,this}valueOf(){let n=this._partials,e=this._n,r,o,a,f=0;if(e>0){for(f=n[--e];e>0&&(r=f,o=n[--e],f=r+o,a=o-(f-r),!a););e>0&&(a<0&&n[e-1]<0||a>0&&n[e-1]>0)&&(o=a*2,r=f+o,o==r-f&&(f=r))}return f}};function*qr(t){for(let n of t)yield*n}function Mt(t){return Array.from(qr(t))}var _=1e-6,me=1e-12,P=Math.PI,Y=P/2,Rt=P/4,j=P*2,O=180/P,F=P/180,$=Math.abs,Vt=Math.atan,Z=Math.atan2,I=Math.cos;var ge=Math.exp;var ve=Math.log;var A=Math.sin,_t=Math.sign||function(t){return t>0?1:t<0?-1:0},H=Math.sqrt,xe=Math.tan;function ye(t){return t>1?0:t<-1?P:Math.acos(t)}function X(t){return t>1?Y:t<-1?-Y:Math.asin(t)}function T(){}function Wt(t,n){t&&Se.hasOwnProperty(t.type)&&Se[t.type](t,n)}var we={Feature:function(t,n){Wt(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,o=e.length;++r<o;)Wt(e[r].geometry,n)}},Se={Sphere:function(t,n){n.sphere()},Point:function(t,n){t=t.coordinates,n.point(t[0],t[1],t[2])},MultiPoint:function(t,n){for(var e=t.coordinates,r=-1,o=e.length;++r<o;)t=e[r],n.point(t[0],t[1],t[2])},LineString:function(t,n){En(t.coordinates,n,0)},MultiLineString:function(t,n){for(var e=t.coordinates,r=-1,o=e.length;++r<o;)En(e[r],n,0)},Polygon:function(t,n){Ee(t.coordinates,n)},MultiPolygon:function(t,n){for(var e=t.coordinates,r=-1,o=e.length;++r<o;)Ee(e[r],n)},GeometryCollection:function(t,n){for(var e=t.geometries,r=-1,o=e.length;++r<o;)Wt(e[r],n)}};function En(t,n,e){var r=-1,o=t.length-e,a;for(n.lineStart();++r<o;)a=t[r],n.point(a[0],a[1],a[2]);n.lineEnd()}function Ee(t,n){var e=-1,r=t.length;for(n.polygonStart();++e<r;)En(t[e],n,1);n.polygonEnd()}function V(t,n){t&&we.hasOwnProperty(t.type)?we[t.type](t,n):Wt(t,n)}var qt=new U,Jt=new U,Me,Re,Mn,Rn,_n,rt={point:T,lineStart:T,lineEnd:T,polygonStart:function(){qt=new U,rt.lineStart=zr,rt.lineEnd=Gr},polygonEnd:function(){var t=+qt;Jt.add(t<0?j+t:t),this.lineStart=this.lineEnd=this.point=T},sphere:function(){Jt.add(j)}};function zr(){rt.point=Or}function Gr(){_e(Me,Re)}function Or(t,n){rt.point=_e,Me=t,Re=n,t*=F,n*=F,Mn=t,Rn=I(n=n/2+Rt),_n=A(n)}function _e(t,n){t*=F,n*=F,n=n/2+Rt;var e=t-Mn,r=e>=0?1:-1,o=r*e,a=I(n),f=A(n),i=_n*f,u=Rn*a+i*I(o),l=i*r*A(o);qt.add(Z(l,u)),Mn=t,Rn=a,_n=f}function pt(t){return Jt=new U,V(t,rt),Jt*2}function vt(t){return[Z(t[1],t[0]),X(t[2])]}function et(t){var n=t[0],e=t[1],r=I(e);return[r*I(n),r*A(n),A(e)]}function zt(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function ut(t,n){return[t[1]*n[2]-t[2]*n[1],t[2]*n[0]-t[0]*n[2],t[0]*n[1]-t[1]*n[0]]}function Qt(t,n){t[0]+=n[0],t[1]+=n[1],t[2]+=n[2]}function Gt(t,n){return[t[0]*n,t[1]*n,t[2]*n]}function xt(t){var n=H(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=n,t[1]/=n,t[2]/=n}var k,Q,B,tt,yt,Ne,$e,Pt,Ot,dt,ct,lt={point:Pn,lineStart:Pe,lineEnd:Ae,polygonStart:function(){lt.point=Le,lt.lineStart=Tr,lt.lineEnd=kr,Ot=new U,rt.polygonStart()},polygonEnd:function(){rt.polygonEnd(),lt.point=Pn,lt.lineStart=Pe,lt.lineEnd=Ae,qt<0?(k=-(B=180),Q=-(tt=90)):Ot>_?tt=90:Ot<-_&&(Q=-90),ct[0]=k,ct[1]=B},sphere:function(){k=-(B=180),Q=-(tt=90)}};function Pn(t,n){dt.push(ct=[k=t,B=t]),n<Q&&(Q=n),n>tt&&(tt=n)}function Fe(t,n){var e=et([t*F,n*F]);if(Pt){var r=ut(Pt,e),o=[r[1],-r[0],0],a=ut(o,r);xt(a),a=vt(a);var f=t-yt,i=f>0?1:-1,u=a[0]*O*i,l,s=$(f)>180;s^(i*yt<u&&u<i*t)?(l=a[1]*O,l>tt&&(tt=l)):(u=(u+360)%360-180,s^(i*yt<u&&u<i*t)?(l=-a[1]*O,l<Q&&(Q=l)):(n<Q&&(Q=n),n>tt&&(tt=n))),s?t<yt?b(k,t)>b(k,B)&&(B=t):b(t,B)>b(k,B)&&(k=t):B>=k?(t<k&&(k=t),t>B&&(B=t)):t>yt?b(k,t)>b(k,B)&&(B=t):b(t,B)>b(k,B)&&(k=t)}else dt.push(ct=[k=t,B=t]);n<Q&&(Q=n),n>tt&&(tt=n),Pt=e,yt=t}function Pe(){lt.point=Fe}function Ae(){ct[0]=k,ct[1]=B,lt.point=Pn,Pt=null}function Le(t,n){if(Pt){var e=t-yt;Ot.add($(e)>180?e+(e>0?360:-360):e)}else Ne=t,$e=n;rt.point(t,n),Fe(t,n)}function Tr(){rt.lineStart()}function kr(){Le(Ne,$e),rt.lineEnd(),$(Ot)>_&&(k=-(B=180)),ct[0]=k,ct[1]=B,Pt=null}function b(t,n){return(n-=t)<0?n+360:n}function Br(t,n){return t[0]-n[0]}function Ie(t,n){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:n<t[0]||t[1]<n}function An(t){var n,e,r,o,a,f,i;if(tt=B=-(k=Q=1/0),dt=[],V(t,lt),e=dt.length){for(dt.sort(Br),n=1,r=dt[0],a=[r];n<e;++n)o=dt[n],Ie(r,o[0])||Ie(r,o[1])?(b(r[0],o[1])>b(r[0],r[1])&&(r[1]=o[1]),b(o[0],r[1])>b(r[0],r[1])&&(r[0]=o[0])):a.push(r=o);for(f=-1/0,e=a.length-1,n=0,r=a[e];n<=e;r=o,++n)o=a[n],(i=b(r[1],o[0]))>f&&(f=i,k=o[0],B=r[1])}return dt=ct=null,k===1/0||Q===1/0?[[NaN,NaN],[NaN,NaN]]:[[k,Q],[B,tt]]}function Tt(t,n){function e(r,o){return r=t(r,o),n(r[0],r[1])}return t.invert&&n.invert&&(e.invert=function(r,o){return r=n.invert(r,o),r&&t.invert(r[0],r[1])}),e}function In(t,n){return $(t)>P&&(t-=Math.round(t/j)*j),[t,n]}In.invert=In;function Nn(t,n,e){return(t%=j)?n||e?Tt(qe(t),ze(n,e)):qe(t):n||e?ze(n,e):In}function Ce(t){return function(n,e){return n+=t,$(n)>P&&(n-=Math.round(n/j)*j),[n,e]}}function qe(t){var n=Ce(t);return n.invert=Ce(-t),n}function ze(t,n){var e=I(t),r=A(t),o=I(n),a=A(n);function f(i,u){var l=I(u),s=I(i)*l,c=A(i)*l,p=A(u),d=p*e+s*r;return[Z(c*o-d*a,s*e-p*r),X(d*o+c*a)]}return f.invert=function(i,u){var l=I(u),s=I(i)*l,c=A(i)*l,p=A(u),d=p*o-c*a;return[Z(c*o+p*a,s*e+d*r),X(d*e-s*r)]},f}function Ge(t){t=Nn(t[0]*F,t[1]*F,t.length>2?t[2]*F:0);function n(e){return e=t(e[0]*F,e[1]*F),e[0]*=O,e[1]*=O,e}return n.invert=function(e){return e=t.invert(e[0]*F,e[1]*F),e[0]*=O,e[1]*=O,e},n}function Te(t,n,e,r,o,a){if(e){var f=I(n),i=A(n),u=r*e;o==null?(o=n+r*j,a=n-u/2):(o=Oe(f,o),a=Oe(f,a),(r>0?o<a:o>a)&&(o+=r*j));for(var l,s=o;r>0?s>a:s<a;s-=u)l=vt([f,-i*I(s),-i*A(s)]),t.point(l[0],l[1])}}function Oe(t,n){n=et(n),n[0]-=t,xt(n);var e=ye(-n[1]);return((-n[2]<0?-e:e)+j-_)%j}function bt(){var t=[],n;return{point:function(e,r,o){n.push([e,r,o])},lineStart:function(){t.push(n=[])},lineEnd:T,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var e=t;return t=[],n=null,e}}}function At(t,n){return $(t[0]-n[0])<_&&$(t[1]-n[1])<_}function tn(t,n,e,r){this.x=t,this.z=n,this.o=e,this.e=r,this.v=!1,this.n=this.p=null}function nn(t,n,e,r,o){var a=[],f=[],i,u;if(t.forEach(function(h){if(!((y=h.length-1)<=0)){var y,S=h[0],M=h[y],m;if(At(S,M)){if(!S[2]&&!M[2]){for(o.lineStart(),i=0;i<y;++i)o.point((S=h[i])[0],S[1]);o.lineEnd();return}M[0]+=2*_}a.push(m=new tn(S,h,null,!0)),f.push(m.o=new tn(S,null,m,!1)),a.push(m=new tn(M,h,null,!1)),f.push(m.o=new tn(M,null,m,!0))}}),!!a.length){for(f.sort(n),ke(a),ke(f),i=0,u=f.length;i<u;++i)f[i].e=e=!e;for(var l=a[0],s,c;;){for(var p=l,d=!0;p.v;)if((p=p.n)===l)return;s=p.z,o.lineStart();do{if(p.v=p.o.v=!0,p.e){if(d)for(i=0,u=s.length;i<u;++i)o.point((c=s[i])[0],c[1]);else r(p.x,p.n.x,1,o);p=p.n}else{if(d)for(s=p.p.z,i=s.length-1;i>=0;--i)o.point((c=s[i])[0],c[1]);else r(p.x,p.p.x,-1,o);p=p.p}p=p.o,s=p.z,d=!d}while(!p.v);o.lineEnd()}}}function ke(t){if(n=t.length){for(var n,e=0,r=t[0],o;++e<n;)r.n=o=t[e],o.p=r,r=o;r.n=o=t[0],o.p=r}}function $n(t){return $(t[0])<=P?t[0]:_t(t[0])*(($(t[0])+P)%j-P)}function Be(t,n){var e=$n(n),r=n[1],o=A(r),a=[A(e),-I(e),0],f=0,i=0,u=new U;o===1?r=Y+_:o===-1&&(r=-Y-_);for(var l=0,s=t.length;l<s;++l)if(p=(c=t[l]).length)for(var c,p,d=c[p-1],h=$n(d),y=d[1]/2+Rt,S=A(y),M=I(y),m=0;m<p;++m,h=x,S=E,M=N,d=g){var g=c[m],x=$n(g),w=g[1]/2+Rt,E=A(w),N=I(w),C=x-h,q=C>=0?1:-1,G=q*C,R=G>P,W=S*E;if(u.add(Z(W*q*A(G),M*N+W*I(G))),f+=R?C+q*j:C,R^h>=e^x>=e){var D=ut(et(d),et(g));xt(D);var z=ut(a,D);xt(z);var v=(R^C>=0?-1:1)*X(z[2]);(r>v||r===v&&(D[0]||D[1]))&&(i+=R^C>=0?1:-1)}}return(f<-_||f<_&&u<-me)^i&1}function en(t,n,e,r){return function(o){var a=n(o),f=bt(),i=n(f),u=!1,l,s,c,p={point:d,lineStart:y,lineEnd:S,polygonStart:function(){p.point=M,p.lineStart=m,p.lineEnd=g,s=[],l=[]},polygonEnd:function(){p.point=d,p.lineStart=y,p.lineEnd=S,s=Mt(s);var x=Be(l,r);s.length?(u||(o.polygonStart(),u=!0),nn(s,jr,x,e,o)):x&&(u||(o.polygonStart(),u=!0),o.lineStart(),e(null,null,1,o),o.lineEnd()),u&&(o.polygonEnd(),u=!1),s=l=null},sphere:function(){o.polygonStart(),o.lineStart(),e(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function d(x,w){t(x,w)&&o.point(x,w)}function h(x,w){a.point(x,w)}function y(){p.point=h,a.lineStart()}function S(){p.point=d,a.lineEnd()}function M(x,w){c.push([x,w]),i.point(x,w)}function m(){i.lineStart(),c=[]}function g(){M(c[0][0],c[0][1]),i.lineEnd();var x=i.clean(),w=f.result(),E,N=w.length,C,q,G;if(c.pop(),l.push(c),c=null,!!N){if(x&1){if(q=w[0],(C=q.length-1)>0){for(u||(o.polygonStart(),u=!0),o.lineStart(),E=0;E<C;++E)o.point((G=q[E])[0],G[1]);o.lineEnd()}return}N>1&&x&2&&w.push(w.pop().concat(w.shift())),s.push(w.filter(Dr))}}return p}}function Dr(t){return t.length>1}function jr(t,n){return((t=t.x)[0]<0?t[1]-Y-_:Y-t[1])-((n=n.x)[0]<0?n[1]-Y-_:Y-n[1])}var Fn=en(function(){return!0},Ur,Yr,[-P,-Y]);function Ur(t){var n=NaN,e=NaN,r=NaN,o;return{lineStart:function(){t.lineStart(),o=1},point:function(a,f){var i=a>0?P:-P,u=$(a-n);$(u-P)<_?(t.point(n,e=(e+f)/2>0?Y:-Y),t.point(r,e),t.lineEnd(),t.lineStart(),t.point(i,e),t.point(a,e),o=0):r!==i&&u>=P&&($(n-r)<_&&(n-=r*_),$(a-i)<_&&(a-=i*_),e=Kr(n,e,a,f),t.point(r,e),t.lineEnd(),t.lineStart(),t.point(i,e),o=0),t.point(n=a,e=f),r=i},lineEnd:function(){t.lineEnd(),n=e=NaN},clean:function(){return 2-o}}}function Kr(t,n,e,r){var o,a,f=A(t-e);return $(f)>_?Vt((A(n)*(a=I(r))*A(e)-A(r)*(o=I(n))*A(t))/(o*a*f)):(n+r)/2}function Yr(t,n,e,r){var o;if(t==null)o=e*Y,r.point(-P,o),r.point(0,o),r.point(P,o),r.point(P,0),r.point(P,-o),r.point(0,-o),r.point(-P,-o),r.point(-P,0),r.point(-P,o);else if($(t[0]-n[0])>_){var a=t[0]<n[0]?P:-P;o=e*a/2,r.point(-a,o),r.point(0,o),r.point(a,o)}else r.point(n[0],n[1])}function De(t){var n=I(t),e=2*F,r=n>0,o=$(n)>_;function a(s,c,p,d){Te(d,t,e,p,s,c)}function f(s,c){return I(s)*I(c)>n}function i(s){var c,p,d,h,y;return{lineStart:function(){h=d=!1,y=1},point:function(S,M){var m=[S,M],g,x=f(S,M),w=r?x?0:l(S,M):x?l(S+(S<0?P:-P),M):0;if(!c&&(h=d=x)&&s.lineStart(),x!==d&&(g=u(c,m),(!g||At(c,g)||At(m,g))&&(m[2]=1)),x!==d)y=0,x?(s.lineStart(),g=u(m,c),s.point(g[0],g[1])):(g=u(c,m),s.point(g[0],g[1],2),s.lineEnd()),c=g;else if(o&&c&&r^x){var E;!(w&p)&&(E=u(m,c,!0))&&(y=0,r?(s.lineStart(),s.point(E[0][0],E[0][1]),s.point(E[1][0],E[1][1]),s.lineEnd()):(s.point(E[1][0],E[1][1]),s.lineEnd(),s.lineStart(),s.point(E[0][0],E[0][1],3)))}x&&(!c||!At(c,m))&&s.point(m[0],m[1]),c=m,d=x,p=w},lineEnd:function(){d&&s.lineEnd(),c=null},clean:function(){return y|(h&&d)<<1}}}function u(s,c,p){var d=et(s),h=et(c),y=[1,0,0],S=ut(d,h),M=zt(S,S),m=S[0],g=M-m*m;if(!g)return!p&&s;var x=n*M/g,w=-n*m/g,E=ut(y,S),N=Gt(y,x),C=Gt(S,w);Qt(N,C);var q=E,G=zt(N,q),R=zt(q,q),W=G*G-R*(zt(N,N)-1);if(!(W<0)){var D=H(W),z=Gt(q,(-G-D)/R);if(Qt(z,N),z=vt(z),!p)return z;var v=s[0],L=c[0],K=s[1],J=c[1],nt;L<v&&(nt=v,v=L,L=nt);var Ct=L-v,st=$(Ct-P)<_,gt=st||Ct<_;if(!st&&J<K&&(nt=K,K=J,J=nt),gt?st?K+J>0^z[1]<($(z[0]-v)<_?K:J):K<=z[1]&&z[1]<=J:Ct>P^(v<=z[0]&&z[0]<=L)){var ft=Gt(q,(-G+D)/R);return Qt(ft,N),[z,vt(ft)]}}}function l(s,c){var p=r?t:P-t,d=0;return s<-p?d|=1:s>p&&(d|=2),c<-p?d|=4:c>p&&(d|=8),d}return en(f,i,a,r?[0,-t]:[-P,t-P])}function je(t,n,e,r,o,a){var f=t[0],i=t[1],u=n[0],l=n[1],s=0,c=1,p=u-f,d=l-i,h;if(h=e-f,!(!p&&h>0)){if(h/=p,p<0){if(h<s)return;h<c&&(c=h)}else if(p>0){if(h>c)return;h>s&&(s=h)}if(h=o-f,!(!p&&h<0)){if(h/=p,p<0){if(h>c)return;h>s&&(s=h)}else if(p>0){if(h<s)return;h<c&&(c=h)}if(h=r-i,!(!d&&h>0)){if(h/=d,d<0){if(h<s)return;h<c&&(c=h)}else if(d>0){if(h>c)return;h>s&&(s=h)}if(h=a-i,!(!d&&h<0)){if(h/=d,d<0){if(h>c)return;h>s&&(s=h)}else if(d>0){if(h<s)return;h<c&&(c=h)}return s>0&&(t[0]=f+s*p,t[1]=i+s*d),c<1&&(n[0]=f+c*p,n[1]=i+c*d),!0}}}}}var kt=1e9,rn=-kt;function Ln(t,n,e,r){function o(l,s){return t<=l&&l<=e&&n<=s&&s<=r}function a(l,s,c,p){var d=0,h=0;if(l==null||(d=f(l,c))!==(h=f(s,c))||u(l,s)<0^c>0)do p.point(d===0||d===3?t:e,d>1?r:n);while((d=(d+c+4)%4)!==h);else p.point(s[0],s[1])}function f(l,s){return $(l[0]-t)<_?s>0?0:3:$(l[0]-e)<_?s>0?2:1:$(l[1]-n)<_?s>0?1:0:s>0?3:2}function i(l,s){return u(l.x,s.x)}function u(l,s){var c=f(l,1),p=f(s,1);return c!==p?c-p:c===0?s[1]-l[1]:c===1?l[0]-s[0]:c===2?l[1]-s[1]:s[0]-l[0]}return function(l){var s=l,c=bt(),p,d,h,y,S,M,m,g,x,w,E,N={point:C,lineStart:W,lineEnd:D,polygonStart:G,polygonEnd:R};function C(v,L){o(v,L)&&s.point(v,L)}function q(){for(var v=0,L=0,K=d.length;L<K;++L)for(var J=d[L],nt=1,Ct=J.length,st=J[0],gt,ft,Zt=st[0],Et=st[1];nt<Ct;++nt)gt=Zt,ft=Et,st=J[nt],Zt=st[0],Et=st[1],ft<=r?Et>r&&(Zt-gt)*(r-ft)>(Et-ft)*(t-gt)&&++v:Et<=r&&(Zt-gt)*(r-ft)<(Et-ft)*(t-gt)&&--v;return v}function G(){s=c,p=[],d=[],E=!0}function R(){var v=q(),L=E&&v,K=(p=Mt(p)).length;(L||K)&&(l.polygonStart(),L&&(l.lineStart(),a(null,null,1,l),l.lineEnd()),K&&nn(p,i,v,a,l),l.polygonEnd()),s=l,p=d=h=null}function W(){N.point=z,d&&d.push(h=[]),w=!0,x=!1,m=g=NaN}function D(){p&&(z(y,S),M&&x&&c.rejoin(),p.push(c.result())),N.point=C,x&&s.lineEnd()}function z(v,L){var K=o(v,L);if(d&&h.push([v,L]),w)y=v,S=L,M=K,w=!1,K&&(s.lineStart(),s.point(v,L));else if(K&&x)s.point(v,L);else{var J=[m=Math.max(rn,Math.min(kt,m)),g=Math.max(rn,Math.min(kt,g))],nt=[v=Math.max(rn,Math.min(kt,v)),L=Math.max(rn,Math.min(kt,L))];je(J,nt,t,n,e,r)?(x||(s.lineStart(),s.point(J[0],J[1])),s.point(nt[0],nt[1]),K||s.lineEnd(),E=!1):K&&(s.lineStart(),s.point(v,L),E=!1)}m=v,g=L,x=K}return N}}var Bt=t=>t;var Cn=new U,qn=new U,Ue,Ke,zn,Gn,ht={point:T,lineStart:T,lineEnd:T,polygonStart:function(){ht.lineStart=Hr,ht.lineEnd=Zr},polygonEnd:function(){ht.lineStart=ht.lineEnd=ht.point=T,Cn.add($(qn)),qn=new U},result:function(){var t=Cn/2;return Cn=new U,t}};function Hr(){ht.point=Xr}function Xr(t,n){ht.point=Ye,Ue=zn=t,Ke=Gn=n}function Ye(t,n){qn.add(Gn*t-zn*n),zn=t,Gn=n}function Zr(){Ye(Ue,Ke)}var On=ht;var It=1/0,on=It,Dt=-It,an=Dt,Vr={point:Wr,lineStart:T,lineEnd:T,polygonStart:T,polygonEnd:T,result:function(){var t=[[It,on],[Dt,an]];return Dt=an=-(on=It=1/0),t}};function Wr(t,n){t<It&&(It=t),t>Dt&&(Dt=t),n<on&&(on=n),n>an&&(an=n)}var Nt=Vr;var Tn=0,kn=0,jt=0,sn=0,fn=0,$t=0,Bn=0,Dn=0,Ut=0,Ze,Ve,it,at,ot={point:wt,lineStart:He,lineEnd:Xe,polygonStart:function(){ot.lineStart=br,ot.lineEnd=to},polygonEnd:function(){ot.point=wt,ot.lineStart=He,ot.lineEnd=Xe},result:function(){var t=Ut?[Bn/Ut,Dn/Ut]:$t?[sn/$t,fn/$t]:jt?[Tn/jt,kn/jt]:[NaN,NaN];return Tn=kn=jt=sn=fn=$t=Bn=Dn=Ut=0,t}};function wt(t,n){Tn+=t,kn+=n,++jt}function He(){ot.point=Jr}function Jr(t,n){ot.point=Qr,wt(it=t,at=n)}function Qr(t,n){var e=t-it,r=n-at,o=H(e*e+r*r);sn+=o*(it+t)/2,fn+=o*(at+n)/2,$t+=o,wt(it=t,at=n)}function Xe(){ot.point=wt}function br(){ot.point=no}function to(){We(Ze,Ve)}function no(t,n){ot.point=We,wt(Ze=it=t,Ve=at=n)}function We(t,n){var e=t-it,r=n-at,o=H(e*e+r*r);sn+=o*(it+t)/2,fn+=o*(at+n)/2,$t+=o,o=at*t-it*n,Bn+=o*(it+t),Dn+=o*(at+n),Ut+=o*3,wt(it=t,at=n)}var jn=ot;function un(t){this._context=t}un.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(t,n){switch(this._point){case 0:{this._context.moveTo(t,n),this._point=1;break}case 1:{this._context.lineTo(t,n);break}default:{this._context.moveTo(t+this._radius,n),this._context.arc(t,n,this._radius,0,j);break}}},result:T};var Kn=new U,Un,Je,Qe,Kt,Yt,ln={point:T,lineStart:function(){ln.point=eo},lineEnd:function(){Un&&be(Je,Qe),ln.point=T},polygonStart:function(){Un=!0},polygonEnd:function(){Un=null},result:function(){var t=+Kn;return Kn=new U,t}};function eo(t,n){ln.point=be,Je=Kt=t,Qe=Yt=n}function be(t,n){Kt-=t,Yt-=n,Kn.add(H(Kt*Kt+Yt*Yt)),Kt=t,Yt=n}var Yn=ln;var tr,cn,nr,er,Ft=class{constructor(n){this._append=n==null?rr:ro(n),this._radius=4.5,this._=""}pointRadius(n){return this._radius=+n,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(n,e){switch(this._point){case 0:{this._append`M${n},${e}`,this._point=1;break}case 1:{this._append`L${n},${e}`;break}default:{if(this._append`M${n},${e}`,this._radius!==nr||this._append!==cn){let r=this._radius,o=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,nr=r,cn=this._append,er=this._,this._=o}this._+=er;break}}}result(){let n=this._;return this._="",n.length?n:null}};function rr(t){let n=1;this._+=t[0];for(let e=t.length;n<e;++n)this._+=arguments[n]+t[n]}function ro(t){let n=Math.floor(t);if(!(n>=0))throw new RangeError(`invalid digits: ${t}`);if(n>15)return rr;if(n!==tr){let e=10**n;tr=n,cn=function(o){let a=1;this._+=o[0];for(let f=o.length;a<f;++a)this._+=Math.round(arguments[a]*e)/e+o[a]}}return cn}function Hn(t,n){let e=3,r=4.5,o,a;function f(i){return i&&(typeof r=="function"&&a.pointRadius(+r.apply(this,arguments)),V(i,o(a))),a.result()}return f.area=function(i){return V(i,o(On)),On.result()},f.measure=function(i){return V(i,o(Yn)),Yn.result()},f.bounds=function(i){return V(i,o(Nt)),Nt.result()},f.centroid=function(i){return V(i,o(jn)),jn.result()},f.projection=function(i){return arguments.length?(o=i==null?(t=null,Bt):(t=i).stream,f):t},f.context=function(i){return arguments.length?(a=i==null?(n=null,new Ft(e)):new un(n=i),typeof r!="function"&&a.pointRadius(r),f):n},f.pointRadius=function(i){return arguments.length?(r=typeof i=="function"?i:(a.pointRadius(+i),+i),f):r},f.digits=function(i){if(!arguments.length)return e;if(i==null)e=null;else{let u=Math.floor(i);if(!(u>=0))throw new RangeError(`invalid digits: ${i}`);e=u}return n===null&&(a=new Ft(e)),f},f.projection(t).digits(e).context(n)}function Ht(t){return function(n){var e=new Xn;for(var r in t)e[r]=t[r];return e.stream=n,e}}function Xn(){}Xn.prototype={constructor:Xn,point:function(t,n){this.stream.point(t,n)},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 Zn(t,n,e){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),r!=null&&t.clipExtent(null),V(e,t.stream(Nt)),n(Nt.result()),r!=null&&t.clipExtent(r),t}function Vn(t,n,e){return Zn(t,function(r){var o=n[1][0]-n[0][0],a=n[1][1]-n[0][1],f=Math.min(o/(r[1][0]-r[0][0]),a/(r[1][1]-r[0][1])),i=+n[0][0]+(o-f*(r[1][0]+r[0][0]))/2,u=+n[0][1]+(a-f*(r[1][1]+r[0][1]))/2;t.scale(150*f).translate([i,u])},e)}function or(t,n,e){return Vn(t,[[0,0],n],e)}function ir(t,n,e){return Zn(t,function(r){var o=+n,a=o/(r[1][0]-r[0][0]),f=(o-a*(r[1][0]+r[0][0]))/2,i=-a*r[0][1];t.scale(150*a).translate([f,i])},e)}function ar(t,n,e){return Zn(t,function(r){var o=+n,a=o/(r[1][1]-r[0][1]),f=-a*r[0][0],i=(o-a*(r[1][1]+r[0][1]))/2;t.scale(150*a).translate([f,i])},e)}var sr=16,oo=I(30*F);function Wn(t,n){return+n?ao(t,n):io(t)}function io(t){return Ht({point:function(n,e){n=t(n,e),this.stream.point(n[0],n[1])}})}function ao(t,n){function e(r,o,a,f,i,u,l,s,c,p,d,h,y,S){var M=l-r,m=s-o,g=M*M+m*m;if(g>4*n&&y--){var x=f+p,w=i+d,E=u+h,N=H(x*x+w*w+E*E),C=X(E/=N),q=$($(E)-1)<_||$(a-c)<_?(a+c)/2:Z(w,x),G=t(q,C),R=G[0],W=G[1],D=R-r,z=W-o,v=m*D-M*z;(v*v/g>n||$((M*D+m*z)/g-.5)>.3||f*p+i*d+u*h<oo)&&(e(r,o,a,f,i,u,R,W,q,x/=N,w/=N,E,y,S),S.point(R,W),e(R,W,q,x,w,E,l,s,c,p,d,h,y,S))}}return function(r){var o,a,f,i,u,l,s,c,p,d,h,y,S={point:M,lineStart:m,lineEnd:x,polygonStart:function(){r.polygonStart(),S.lineStart=w},polygonEnd:function(){r.polygonEnd(),S.lineStart=m}};function M(C,q){C=t(C,q),r.point(C[0],C[1])}function m(){c=NaN,S.point=g,r.lineStart()}function g(C,q){var G=et([C,q]),R=t(C,q);e(c,p,s,d,h,y,c=R[0],p=R[1],s=C,d=G[0],h=G[1],y=G[2],sr,r),r.point(c,p)}function x(){S.point=M,r.lineEnd()}function w(){m(),S.point=E,S.lineEnd=N}function E(C,q){g(o=C,q),a=c,f=p,i=d,u=h,l=y,S.point=g}function N(){e(c,p,s,d,h,y,a,f,o,i,u,l,sr,r),S.lineEnd=x,x()}return S}}var so=Ht({point:function(t,n){this.stream.point(t*F,n*F)}});function fo(t){return Ht({point:function(n,e){var r=t(n,e);return this.stream.point(r[0],r[1])}})}function uo(t,n,e,r,o){function a(f,i){return f*=r,i*=o,[n+t*f,e-t*i]}return a.invert=function(f,i){return[(f-n)/t*r,(e-i)/t*o]},a}function fr(t,n,e,r,o,a){if(!a)return uo(t,n,e,r,o);var f=I(a),i=A(a),u=f*t,l=i*t,s=f/t,c=i/t,p=(i*e-f*n)/t,d=(i*n+f*e)/t;function h(y,S){return y*=r,S*=o,[u*y-l*S+n,e-l*y-u*S]}return h.invert=function(y,S){return[r*(s*y-c*S+p),o*(d-c*y-s*S)]},h}function St(t){return Jn(function(){return t})()}function Jn(t){var n,e=150,r=480,o=250,a=0,f=0,i=0,u=0,l=0,s,c=0,p=1,d=1,h=null,y=Fn,S=null,M,m,g,x=Bt,w=.5,E,N,C,q,G;function R(v){return C(v[0]*F,v[1]*F)}function W(v){return v=C.invert(v[0],v[1]),v&&[v[0]*O,v[1]*O]}R.stream=function(v){return q&&G===v?q:q=so(fo(s)(y(E(x(G=v)))))},R.preclip=function(v){return arguments.length?(y=v,h=void 0,z()):y},R.postclip=function(v){return arguments.length?(x=v,S=M=m=g=null,z()):x},R.clipAngle=function(v){return arguments.length?(y=+v?De(h=v*F):(h=null,Fn),z()):h*O},R.clipExtent=function(v){return arguments.length?(x=v==null?(S=M=m=g=null,Bt):Ln(S=+v[0][0],M=+v[0][1],m=+v[1][0],g=+v[1][1]),z()):S==null?null:[[S,M],[m,g]]},R.scale=function(v){return arguments.length?(e=+v,D()):e},R.translate=function(v){return arguments.length?(r=+v[0],o=+v[1],D()):[r,o]},R.center=function(v){return arguments.length?(a=v[0]%360*F,f=v[1]%360*F,D()):[a*O,f*O]},R.rotate=function(v){return arguments.length?(i=v[0]%360*F,u=v[1]%360*F,l=v.length>2?v[2]%360*F:0,D()):[i*O,u*O,l*O]},R.angle=function(v){return arguments.length?(c=v%360*F,D()):c*O},R.reflectX=function(v){return arguments.length?(p=v?-1:1,D()):p<0},R.reflectY=function(v){return arguments.length?(d=v?-1:1,D()):d<0},R.precision=function(v){return arguments.length?(E=Wn(N,w=v*v),z()):H(w)},R.fitExtent=function(v,L){return Vn(R,v,L)},R.fitSize=function(v,L){return or(R,v,L)},R.fitWidth=function(v,L){return ir(R,v,L)},R.fitHeight=function(v,L){return ar(R,v,L)};function D(){var v=fr(e,0,0,p,d,c).apply(null,n(a,f)),L=fr(e,r-v[0],o-v[1],p,d,c);return s=Nn(i,u,l),N=Tt(n,L),C=Tt(s,N),E=Wn(N,w),z()}function z(){return q=G=null,R}return function(){return n=t.apply(this,arguments),R.invert=n.invert&&W,D()}}function ur(t){var n=0,e=P/3,r=Jn(t),o=r(n,e);return o.parallels=function(a){return arguments.length?r(n=a[0]*F,e=a[1]*F):[n*O,e*O]},o}function lr(t){var n=I(t);function e(r,o){return[r*n,A(o)/n]}return e.invert=function(r,o){return[r/n,X(o*n)]},e}function cr(t,n){var e=A(t),r=(e+A(n))/2;if($(r)<_)return lr(t);var o=1+e*(2*r-e),a=H(o)/r;function f(i,u){var l=H(o-2*r*A(u))/r;return[l*A(i*=r),a-l*I(i)]}return f.invert=function(i,u){var l=a-u,s=Z(i,$(l))*_t(l);return l*r<0&&(s-=P*_t(i)*_t(l)),[s/r,X((o-(i*i+l*l)*r*r)/(2*r))]},f}function Qn(){return ur(cr).scale(155.424).center([0,33.6442])}function pr(t){return function(n,e){var r=H(n*n+e*e),o=t(r),a=A(o),f=I(o);return[Z(n*a,r*f),X(r&&e*a/r)]}}function pn(t,n){return[t,ve(xe((Y+n)/2))]}pn.invert=function(t,n){return[t,2*Vt(ge(n))-Y]};function bn(){return lo(pn).scale(961/j)}function lo(t){var n=St(t),e=n.center,r=n.scale,o=n.translate,a=n.clipExtent,f=null,i,u,l;n.scale=function(c){return arguments.length?(r(c),s()):r()},n.translate=function(c){return arguments.length?(o(c),s()):o()},n.center=function(c){return arguments.length?(e(c),s()):e()},n.clipExtent=function(c){return arguments.length?(c==null?f=i=u=l=null:(f=+c[0][0],i=+c[0][1],u=+c[1][0],l=+c[1][1]),s()):f==null?null:[[f,i],[u,l]]};function s(){var c=P*r(),p=n(Ge(n.rotate()).invert([0,0]));return a(f==null?[[p[0]-c,p[1]-c],[p[0]+c,p[1]+c]]:t===pn?[[Math.max(p[0]-c,f),i],[Math.min(p[0]+c,u),l]]:[[f,Math.max(p[1]-c,i)],[u,Math.min(p[1]+c,l)]])}return s()}function dn(t,n){return[t,n]}dn.invert=dn;function te(){return St(dn).scale(152.63)}function ne(t,n){return[I(n)*A(t),A(n)]}ne.invert=pr(X);function ee(){return St(ne).scale(249.5).clipAngle(90+_)}var hn=1;function co(t,n,[e,r],[o,a]){let f=t.length/3,i=new Float64Array(f*2),u=new Uint8Array(f),l=0,s=0;for(let c=0;c<f;c++)l+=t[c*3],s+=t[c*3+1],i[c*2]=l*e+o,i[c*2+1]=s*r+a,u[c]=t[c*3+2];return{key:n,points:i,buckets:u}}function re(t){let n=[];for(let{arc:e,reversed:r}of t){let o=e.buckets.length;for(let a=n.length===0?0:1;a<o;a++){let f=r?o-1-a:a;n.push([e.points[f*2],e.points[f*2+1]])}}return n}function po(t){let n=re(t);if(n.length<4)return 0;let e=pt({type:"Polygon",coordinates:[n]});return e>2*Math.PI?4*Math.PI-e:e}function dr(t){if(t.format!==hn)throw new Error(`geo data format ${t.format} is not supported (expected ${hn})`);let n=t.arcs.map((o,a)=>co(o,t.arcIds[a],t.transform.scale,t.transform.translate)),e=o=>o<0?{arc:n[~o],reversed:!0}:{arc:n[o],reversed:!1},r=new Map;for(let o of t.features){let a=o.mainland?new Set(o.mainland):null;r.set(o.code,{code:o.code,name:o.name,nameNl:o.nameNl??o.name,parent:o.parent,first:o.first,listed:o.listed,remote:o.remote===!0,polygons:o.polygons.map((f,i)=>{let u=f.map(l=>l.map(e));return{rings:u,ringAreas:u.map((l,s)=>s===0?o.areas[i]:po(l)),area:o.areas[i],mainland:a===null||a.has(i)}})})}return{features:r}}import{Flow as ce,Graphics2D as pe,Paint as Xt,Shapes as Co,Types as he,component2d as qo}from"@motionscript/sdk";import{snapValue as Lr}from"@motionscript/sdk/component";var hr=1024,ho=2,mo=7,go=1.5,vo=6,se=t=>t>1?1:t>0?t:0;function xo(t,n){if(t>=1||!(n>0))return 255;let e=n*10**-(ho+mo*se(t));return Math.floor(-2*Math.log2(e))}function yo(t,n){return t>=1?0:n*10**-(go+vo*se(t))}function vr(t,n){let e=[];for(let r of t){let o=n==="mainland"?r.polygons.filter(i=>i.mainland):[],a=o.length>0?o:r.polygons,f=null;for(let i of a)(!f||i.area>f.area)&&(f=i);for(let i of a)e.push({polygon:i,largest:i===f})}return e}function wo(t,n){if(t<=n)return(t+n)/2;let e=(t+n+360)/2;return e>180?e-360:e}function So(t,n,e,r,o){let a=wo(n,r),f=(e+o)/2;switch(t){case"mercator":return bn().rotate([-a,0]);case"equirectangular":return te().rotate([-a,0]);case"orthographic":return ee().rotate([-a,-f]);case"conic":{let i=o-e;return Qn().rotate([-a,0]).center([0,f]).parallels([e+i/6,o-i/6])}}}function Eo(t,n){if(n.length===0)return null;let e={type:"MultiPolygon",coordinates:n.map(({polygon:i})=>[re(i.rings[0])])},[[r,o],[a,f]]=An(e);for(let i of[t,"equirectangular"]){let u=So(i,r,o,a,f).fitSize([hr,hr],e),[[l,s],[c,p]]=Hn(u).bounds(e),d=Math.max(c-l,p-s);if(!(!Number.isFinite(d)||d<=0))return{projection:u,centerX:(l+c)/2,centerY:(s+p)/2,size:d,width:(c-l)/d,height:(p-s)/d}}return null}function mr(t,n,e){let r=[],o=null,{centerX:a,centerY:f,size:i}=t,u={point(l,s){o?.push((l-a)/i,-(s-f)/i)},lineStart(){o=[]},lineEnd(){let l=o;if(o=null,!l||l.length<4)return;let s=e;if(!e){let p=l.length;l[0]===l[p-2]&&l[1]===l[p-1]&&p>=8&&(l.length=p-2,s=!0)}let c=Float32Array.from(l);r.push({points:c,closed:s,length:Mo(c,s)})},polygonStart(){},polygonEnd(){},sphere(){}};return V(n,t.projection.stream(u)),r}function Mo(t,n){let e=0,r=t.length/2;for(let o=1;o<r;o++)e+=Math.hypot(t[o*2]-t[o*2-2],t[o*2+1]-t[o*2-1]);return n&&r>1&&(e+=Math.hypot(t[0]-t[r*2-2],t[1]-t[r*2-1])),e}var gr=20;function Ro(t,n){let e=t.buckets.length,r=new Uint8Array(e),o=t.points[0],a=t.points[1];for(let f=0;f<e;f++){let i=t.points[f*2],u=t.points[f*2+1],l=!1;if(t.buckets[f]>n){let s=Math.abs(i-o);s>180&&(s=360-s),l=Math.abs(u-a)>gr||s*Math.cos(u*Math.PI/180)>gr}(t.buckets[f]<=n||l)&&(r[f]=1,o=i,a=u)}return r}function oe(t,n){let e=[];for(let{arc:r,reversed:o}of t){let a=r.buckets.length,f=n(r);for(let i=e.length===0?0:1;i<a;i++){let u=o?a-1-i:i;f[u]&&e.push([r.points[u*2],r.points[u*2+1]])}}return e}function _o(t,n){let e=0;for(let{arc:o}of t)for(let a=0;a<o.buckets.length-1;a++)o.buckets[a]<=n&&e++;if(e>=3)return n;let r=[];for(let{arc:o}of t)for(let a=0;a<o.buckets.length-1;a++)r.push(o.buckets[a]);return r.sort((o,a)=>o-a),Math.max(n,r[Math.min(2,r.length-1)]??n)}function Po(t,n){return t.length<4?!0:pt({type:"Polygon",coordinates:[t]})>2*Math.PI!==n}var Lt=(t,n)=>{let e=n?t.buckets.length-1:0;return`${t.points[e*2]},${t.points[e*2+1]}`};function Ao(t){let n=new Map;for(let i of t)for(let u of[Lt(i,!1),Lt(i,!0)]){let l=n.get(u);l?l.push(i):n.set(u,[i])}let e=new Set,r=[],o=({arc:i,reversed:u})=>Lt(i,u),a=({arc:i,reversed:u})=>Lt(i,!u),f=i=>{let u=n.get(i);return u.length!==2?null:u.find(l=>!e.has(l))??null};for(let i of t){if(e.has(i))continue;e.add(i);let u=[{arc:i,reversed:!1}];for(let l=f(a(u[u.length-1]));l;l=f(a(u[u.length-1])))e.add(l),u.push({arc:l,reversed:Lt(l,!1)!==a(u[u.length-1])});for(let l=f(o(u[0]));l;l=f(o(u[0])))e.add(l),u.unshift({arc:l,reversed:Lt(l,!0)!==o(u[0])});r.push({refs:u,closed:o(u[0])===a(u[u.length-1])})}return r}function Io(t,n,e,r,o){let a=vr(t,n),f=a.reduce((g,{polygon:x})=>g+x.area,0),i=xo(o,f),u=yo(o,f),l=[];for(let{polygon:g,largest:x}of a)!x&&g.area<u||l.push(g.rings.filter((w,E)=>E===0||g.ringAreas[E]>=u));let s=new Map,c=new Map;for(let g of l)for(let x of g){let w=_o(x,i);for(let{arc:E}of x){s.set(E.key,Math.max(s.get(E.key)??0,w));let N=c.get(E.key);N?N.count++:c.set(E.key,{arc:E,count:1})}}let p=new Map,d=g=>{let x=p.get(g.key);return x||(x=Ro(g,s.get(g.key)??255),p.set(g.key,x)),x};if(i<255)for(let g of l)g.forEach((x,w)=>{let E=Math.min(...x.map(({arc:N})=>s.get(N.key)??i));for(;E<255&&!Po(oe(x,d),w===0);){E=Math.min(255,E+2);for(let{arc:N}of x)s.set(N.key,Math.max(s.get(N.key)??0,E)),p.delete(N.key)}});let h=mr(e,{type:"MultiPolygon",coordinates:l.flatMap(g=>{let[x,...w]=g.map(E=>oe(E,d));return x.length<4?[]:[[x,...w.filter(E=>E.length>=4)]]})},!0),y=[...c.values()].filter(({count:g})=>r==="all"||g===1).map(({arc:g})=>g),S=[];for(let g of Ao(y))S.push(...mr(e,{type:"LineString",coordinates:oe(g.refs,d)},!1));let M=g=>g.reduce((x,w)=>x+w.length,0),m=[...h,...S].reduce((g,x)=>g+x.points.byteLength+32,0);return{width:e.width,height:e.height,fills:h,lines:S,fillLength:M(h),lineLength:M(S),bytes:m}}var mn=class{_budget;_entries=new Map;_bytes=0;constructor(n){this._budget=n}get(n){let e=this._entries.get(n);return e&&(this._entries.delete(n),this._entries.set(n,e)),e}set(n,e){let r=this._entries.get(n);r&&(this._bytes-=r.bytes),this._entries.delete(n),this._entries.set(n,e),this._bytes+=e.bytes;for(let[o,a]of this._entries){if(this._bytes<=this._budget||this._entries.size<=1)break;this._entries.delete(o),this._bytes-=a.bytes}}clear(){this._entries.clear(),this._bytes=0}},ie=new mn(64),ae=new mn(64*1024*1024);function xr(t){let n=Math.round(se(t.detail)*100)/100,e=`${t.selectionKey}|${t.projection}`,r=`${e}|${t.borders}|${n}`,o=ae.get(r);if(o)return o;let a=ie.get(e);if(!a){let i=Eo(t.projection,vr(t.features,t.frame));if(!i)return null;a=i,ie.set(e,{...i,bytes:1})}let f=Io(t.features,t.frame,a,t.borders,n);return ae.set(r,f),f}function ws(){ie.clear(),ae.clear()}function yr(t){let n=t.length/2,e=new Uint8Array(n);if(n<3)return e;let r=Math.PI/180,o=new Float64Array(n),a=new Int32Array(n),f=new Int32Array(n);for(let m=0;m<n;m++)a[m]=m-1,f[m]=m+1;let i=(m,g,x)=>{let w=Math.cos(t[g*2+1]*r),E=t[m*2]*w,N=t[m*2+1],C=t[g*2]*w,q=t[g*2+1],G=t[x*2]*w,R=t[x*2+1];return Math.abs((C-E)*(R-N)-(G-E)*(q-N))/2*r*r},u=[],l=new Int32Array(n).fill(-1),s=(m,g)=>o[u[m]]<o[u[g]],c=(m,g)=>{[u[m],u[g]]=[u[g],u[m]],l[u[m]]=m,l[u[g]]=g},p=m=>{for(;m>0;){let g=m-1>>1;if(!s(m,g))break;c(m,g),m=g}},d=m=>{for(;;){let g=2*m+1,x=g+1,w=m;if(g<u.length&&s(g,w)&&(w=g),x<u.length&&s(x,w)&&(w=x),w===m)return;c(m,w),m=w}},h=m=>{l[m]=u.length,u.push(m),p(u.length-1)},y=m=>{let g=l[m],x=u.pop();l[m]=-1,g<u.length&&(u[g]=x,l[x]=g,p(g),d(l[x]))};for(let m=1;m<n-1;m++)o[m]=i(m-1,m,m+1),h(m);let S=0,M=new Float64Array(n);for(M[0]=M[n-1]=1/0;u.length>0;){let m=u[0];y(m),S=Math.max(S,o[m]),M[m]=S;let g=a[m],x=f[m];g>=0&&(f[g]=x),x<n&&(a[x]=g);for(let w of[g,x])w<=0||w>=n-1||l[w]<0||(y(w),o[w]=i(a[w],w,f[w]),h(w))}for(let m=0;m<n;m++)e[m]=No(M[m]);return e}function No(t){return t===1/0?0:t>0?Math.min(254,Math.max(1,Math.round(-2*Math.log2(t)))):255}var gn=`v${hn}`;function Ps(t,n){return async e=>{let r=typeof t=="function"?t(e):`${t.replace(/\/+$/,"")}/${e}.json`,o=await fetch(r,n);if(o.status===404||o.status===400)return null;if(!o.ok)throw new Error(`${r} \u2192 HTTP ${o.status}`);return o.json()}}function As(t){return async n=>{let e=await t(n);return e==null?null:typeof e=="string"?JSON.parse(e):e instanceof ArrayBuffer||e instanceof Uint8Array?JSON.parse(new TextDecoder().decode(e)):e}}function $o(t,n,e){let r=n.shape.type==="Feature"?n.shape.geometry:n.shape,o=n.shape.type==="Feature"?n.shape:null,a=r.type==="Polygon"?[r.coordinates]:r.coordinates,f=0,i=(s,c)=>{let d=s.length>0&&s[0][0]===s[s.length-1][0]&&s[0][1]===s[s.length-1][1]?s:[...s,s[0]];pt({type:"Polygon",coordinates:[d]})<=2*Math.PI!==c&&(d=[...d].reverse());let y=new Float64Array(d.length*2);return d.forEach(([S,M],m)=>{y[m*2]=S,y[m*2+1]=M}),{arc:{key:`define:${e}:${t}:${f++}`,points:y,buckets:yr(y)},reversed:!1}},u=a.map(s=>{let c=s.map((h,y)=>[i(h,y===0)]),p=s.map(h=>{let y=pt({type:"Polygon",coordinates:[h]});return y>2*Math.PI?4*Math.PI-y:y}),d=Math.max(0,p[0]-p.slice(1).reduce((h,y)=>h+y,0));return{rings:c,ringAreas:p,area:d,mainland:!0}}),l=n.name??o?.properties?.name??t;return{code:t,name:l,nameNl:l,parent:n.parent??(t.includes("-")?t.slice(0,2):null),first:!0,listed:!1,remote:!1,polygons:u}}var fe=class{_sources=[];_defined=new Map;_generation=0;_serial=0;get generation(){return this._generation}get hasSources(){return this._sources.length>0}use(n){return this._sources.push(n),this._generation++,()=>{let e=this._sources.indexOf(n);e<0||(this._sources.splice(e,1),this._generation++)}}define(n){let e=++this._serial,r=Object.entries(n).map(([o,a])=>{let f=o.trim().toUpperCase(),i="shape"in a?a:{shape:a};return this._defined.set(f,{serial:e,feature:$o(f,i,e)}),f});return this._generation++,()=>{for(let o of r)this._defined.get(o)?.serial===e&&this._defined.delete(o);this._generation++}}defined(n){return this._defined.get(n)?.feature}reset(){this._sources=[],this._defined.clear(),this._generation++}async resolve(n){if(this._sources.length===0)throw new Error("No geo source registered \u2014 call geoRegistry.use(geoUrlSource(\u2026)) before rendering GeoBorder");let e=null;for(let r of[...this._sources])try{let o=await r(n);if(o!=null)return o}catch(o){e??=o}if(e)throw e;return null}async index(){return await this.resolve(`${gn}/index`)}},mt=new fe;var yn=new Map,vn=new Map,wr=new Map,xn=new Set,ue=0;function le(t){return`${gn}/countries/${t}`}function wn(t){return`${gn}/states/${t}`}function Sr(){return ue}function Er(t){return yn.get(t)}async function Fo(t){try{let n=await mt.resolve(t);return n===null&&t.includes("/states/")&&(n=await mt.resolve(t.replace("/states/","/countries/"))),n===null?{status:"missing"}:{status:"ready",file:dr(n)}}catch(n){return{status:"failed",error:n}}}function Lo(t){let n=yn.get(t);if(n?.status==="ready")return Promise.resolve(n);let e=vn.get(t);return e||(e=Fo(t).then(r=>(vn.delete(t),yn.set(t,r),ue++,r.status==="ready"?xn.delete(t):xn.has(t)||(xn.add(t),r.status==="failed"?console.warn(`[GeoBorder] could not load ${t}:`,r.error):console.warn(`[GeoBorder] no geo source has ${t}`)),r)),vn.set(t,e)),e}function Mr(t){let n=wr.get(t);return n||(n=async()=>{await Lo(t)},wr.set(t,n)),n}function Fs(){yn.clear(),vn.clear(),xn.clear(),ue++}var Rr=/^[A-Z]{2}(-[A-Z0-9]{1,3})?$/;function _r(t){let n=Array.isArray(t)?t:typeof t=="string"?t.split(/[\s,;]+/):[],e=[];for(let r of n){if(typeof r!="string")continue;let o=r.trim().toUpperCase();o&&!e.includes(o)&&e.push(o)}return e}function Pr(t){return t.includes("-")}function Ar(t,n){let e=new Set;for(let r of t)!Rr.test(r)||mt.defined(r)||(Pr(r)?e.add(wn(r.slice(0,2))):e.add(n==="state"?wn(r):le(r)));return[...e]}function Ir(t,n,e){let r=[],o=new Set,a=[],f=!1,i=u=>{o.has(u.code)||(o.add(u.code),r.push(u))};for(let u of t){let l=mt.defined(u);if(l){i(l);continue}if(!Rr.test(u)){a.push(u);continue}let s=Pr(u),c=s||n==="state"?wn(u.slice(0,2)):le(u),p=Er(c);if(!p||p.status!=="ready"){p||(f=!0);continue}let d=p.file.features;if(s||n==="country"){let y=d.get(u);y?i(y):a.push(u);continue}let h=[...d.values()].filter(y=>y.parent===u&&y.first&&!(e==="mainland"&&y.remote));h.length>0?h.forEach(i):d.get(u)?i(d.get(u)):a.push(u)}return{features:r,pending:f,unknown:a}}var zo=256,Go=4e4,Nr=t=>String(Math.round(t*100)/100);function $r(t,n,e){let r=[],o=[],a=0,f=0,i=0,u=0,l=()=>{if(a===0)return;let s=n>0?Math.min(1,u/n):1;r.push({data:o.join(""),from:i,to:s}),i=s,o=[],a=0,f=0};for(let s of t){let c=s.points;for(let p=0;p<c.length;p+=2)o.push(p===0?"M":"L",Nr(c[p]*e)," ",Nr(-c[p+1]*e));s.closed&&o.push("Z"),a++,f+=c.length/2,u+=s.length,(a>=zo||f>=Go)&&l()}return l(),r}function Sn(t,n){return he.custom(n,{lerp:Lr,options:t})}var Fr=new WeakMap;function Oo(t){let n=Fr.get(t);return n||Fr.set(t,n={drawn:null,warned:new Set}),n}function To(t,n){let e=Oo(t),r=t.iso,{level:o,frame:a}=t,f=Ir(r,o,a);for(let d of f.unknown)e.warned.has(d)||(e.warned.add(d),console.warn(`[GeoBorder] no region with code ${d}`));if(f.features.length===0)return null;let i=xr({selectionKey:`${mt.generation}:${Sr()}:${o}:${a}:${r.join(",")}`,features:f.features,frame:a,projection:t.projection,borders:t.borders,detail:t.detail});if(!i)return null;let{width:u,height:l}=n,s=e.drawn;if(s&&s.geometry===i&&s.width===u&&s.height===l)return s;let c=Math.min(u/i.width,l/i.height),p={geometry:i,width:u,height:l,fills:$r(i.fills,i.fillLength,c),lines:$r(i.lines,i.lineLength,c)};return e.drawn=p,p}function de(t,n,e,r,o){let{width:a,height:f}=e,i=[-a/2,-f/2,a/2,f/2];if(r<=0&&o>=1)return t.path({data:n.data,centerBounds:i}),!0;let u=n.to-n.from;if(u<=0)return!1;let l=Math.max(0,(r-n.from)/u),s=Math.min(1,(o-n.from)/u);return s<=l?!1:(t.path({data:n.data,centerBounds:i,start:l,end:s}),!0)}var Cr=qo({key:"geoBorder",state:{...Xt.state,...ce.state,iso:he.custom(["FR"],{resolve:_r,lerp:Lr}),level:Sn(["country","state"],"country"),detail:he.number(.5,{min:0,max:1,step:.01}),projection:Sn(["conic","mercator","equirectangular","orthographic"],"conic"),frame:Sn(["mainland","all"],"mainland"),borders:Sn(["all","outline"],"all")},commands:{...Xt.commands},load:(t,n)=>{for(let e of Ar(n.iso,n.level))t.task(`geo:${e}`,Mr(e))},measure:(t,n,e)=>ce.measure(t,n,e,Xt.inset(n)),layout:(t,n,e)=>ce.layout(t,n,e,Xt.inset(n)),render:(t,n)=>{let e=t.size,{start:r,end:o}=n,a=n.fill,f=n.shadow,i=()=>To(n,e);t.inFront(()=>{let u=i();if(!u||u.fills.length===0)return;let l=new pe;for(let s of u.fills)de(l,s,e,r,o)&&(f.length>0&&l.shadow(f),l.fill(a));t.draw(l)}),Xt.draw(t,n,null,{clipShape:Co.box(e)}),t.inFront(()=>{let u=n.overlay;if(u.length>0){let h=i();if(h){let y=new pe;for(let S of h.fills)de(y,S,e,r,o)&&y.fill(u);t.draw(y)}}let l=n.stroke;if(l.length===0)return;let s=i();if(!s||s.lines.length===0)return;let c=l.map(h=>h.align===0?h:{...h,align:0}),p=f.length>0&&!a.some(h=>(h.opacity??1)>0),d=new pe;for(let h of s.lines)de(d,h,e,r,o)&&(p&&d.shadow(f),d.stroke(c));t.draw(d)})}});var ko=[Cr];export{hn as GEO_DATA_FORMAT,gn as GEO_DATA_VERSION,Cr as GeoBorder,ko as NODES,Fs as clearGeoFiles,ws as clearGeoGeometry,le as countryFileKey,dr as decodeGeoFile,Sr as geoDataVersion,Er as geoFileEntry,Ar as geoFilesFor,xr as geoGeometry,Mr as geoLoader,As as geoLoaderSource,mt as geoRegistry,Ps as geoUrlSource,Lo as loadGeoFile,_r as normalizeIso,xo as pointBucketLimit,yo as polygonAreaLimit,po as ringArea,re as ringCoordinates,Ir as selectGeoFeatures,wn as statesFileKey};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|